@archbase/core 3.0.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/README.md +42 -0
- package/dist/archbase-core-3.0.0.tgz +0 -0
- package/dist/context/ArchbaseAppContext.d.ts +43 -0
- package/dist/context/ArchbaseGlobalProvider.d.ts +33 -0
- package/dist/context/ArchbaseSimpleAppContext.d.ts +34 -0
- package/dist/context/index.d.ts +5 -0
- package/dist/error/ArchbaseError.d.ts +14 -0
- package/dist/error/index.d.ts +11 -0
- package/dist/errorboundary/ArchbaseErrorBoundary.d.ts +21 -0
- package/dist/errorboundary/ArchbaseErrorBoundaryContext.d.ts +6 -0
- package/dist/errorboundary/ArchbaseErrorFallback.d.ts +7 -0
- package/dist/errorboundary/assertArchbaseErrorBoundaryContext.d.ts +2 -0
- package/dist/errorboundary/index.d.ts +6 -0
- package/dist/errorboundary/types.d.ts +39 -0
- package/dist/errorboundary/useArchbaseErrorBoundary.d.ts +5 -0
- package/dist/errorboundary/withArchbaseErrorBoundary.d.ts +3 -0
- package/dist/exceptions/ApiError.d.ts +27 -0
- package/dist/exceptions/ArchbaseErrorHelper.d.ts +2 -0
- package/dist/exceptions/ArchbaseException.d.ts +9 -0
- package/dist/exceptions/index.d.ts +3 -0
- package/dist/fallback/ArchbaseSafeMigrationWrapper.d.ts +57 -0
- package/dist/helper/ArchbaseClickOutside.d.ts +9 -0
- package/dist/helper/ArchbaseObjectHelper.d.ts +9 -0
- package/dist/helper/index.d.ts +2 -0
- package/dist/hooks/ArchbaseDepencyManager.d.ts +70 -0
- package/dist/hooks/index.d.ts +15 -0
- package/dist/hooks/lifecycle/index.d.ts +54 -0
- package/dist/hooks/useArchbaseAsyncFunction.d.ts +1 -0
- package/dist/hooks/useArchbaseBool.d.ts +6 -0
- package/dist/hooks/useArchbaseForceRenderer.d.ts +1 -0
- package/dist/hooks/useArchbaseLatest.d.ts +3 -0
- package/dist/hooks/useArchbasePassiveLayoutEffect.d.ts +3 -0
- package/dist/hooks/useArchbasePasswordRemember.d.ts +11 -0
- package/dist/hooks/useArchbaseReducer.d.ts +21 -0
- package/dist/hooks/useArchbaseResizeObserver.d.ts +11 -0
- package/dist/hooks/useArchbaseSize.d.ts +12 -0
- package/dist/hooks/useArchbaseStateWithCallback.d.ts +2 -0
- package/dist/hooks/useArchbaseTextSelection.d.ts +14 -0
- package/dist/hooks/useArchbaseTheme.d.ts +6 -0
- package/dist/hooks/useArchbaseValidator.d.ts +2 -0
- package/dist/index.css +108 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +9728 -0
- package/dist/index.js.map +1 -0
- package/dist/ioc/ArchbaseIOCHelper.d.ts +56 -0
- package/dist/ioc/ArchbaseIOCTypes.d.ts +11 -0
- package/dist/ioc/index.d.ts +2 -0
- package/dist/json/ArchbaseJacksonParser.d.ts +15 -0
- package/dist/json/index.d.ts +1 -0
- package/dist/locales/config.d.ts +1781 -0
- package/dist/locales/index.d.ts +1 -0
- package/dist/rsql/ast/ComparisonOperator.d.ts +24 -0
- package/dist/rsql/ast/LogicOperator.d.ts +13 -0
- package/dist/rsql/ast/Node.d.ts +41 -0
- package/dist/rsql/ast/ReservedChars.d.ts +4 -0
- package/dist/rsql/ast/index.d.ts +4 -0
- package/dist/rsql/builder/index.d.ts +20 -0
- package/dist/rsql/emitter/index.d.ts +19 -0
- package/dist/rsql/index.d.ts +7 -0
- package/dist/rsql/parser/Error.d.ts +7 -0
- package/dist/rsql/parser/ParserContext.d.ts +15 -0
- package/dist/rsql/parser/ParserOperation.d.ts +43 -0
- package/dist/rsql/parser/ParserProduction.d.ts +14 -0
- package/dist/rsql/parser/index.d.ts +3 -0
- package/dist/rsql/parser/lexer/LexerContext.d.ts +8 -0
- package/dist/rsql/parser/lexer/LexerProcessor.d.ts +8 -0
- package/dist/rsql/parser/lexer/Token.d.ts +38 -0
- package/dist/rsql/parser/lexer/lex.d.ts +3 -0
- package/dist/rsql/parser/lexer/processors/scanNonReservedSymbol.d.ts +3 -0
- package/dist/rsql/parser/lexer/processors/scanSymbol.d.ts +3 -0
- package/dist/rsql/parser/lexer/processors/seekAnyToken.d.ts +4 -0
- package/dist/rsql/parser/lexer/processors/seekComparisonCustomOperatorToken.d.ts +4 -0
- package/dist/rsql/parser/lexer/processors/seekComparisonOperatorToken.d.ts +4 -0
- package/dist/rsql/parser/lexer/processors/seekLogicCanonicalOperatorToken.d.ts +4 -0
- package/dist/rsql/parser/lexer/processors/seekLogicVerboseOperatorToken.d.ts +4 -0
- package/dist/rsql/parser/lexer/processors/seekParenthesisToken.d.ts +4 -0
- package/dist/rsql/parser/lexer/processors/seekQuotedToken.d.ts +4 -0
- package/dist/rsql/parser/lexer/processors/seekUnquotedToken.d.ts +4 -0
- package/dist/rsql/parser/lexer/processors/skipWhitespace.d.ts +3 -0
- package/dist/types/OptionsResult.d.ts +8 -0
- package/dist/types/filter.d.ts +56 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/querybuilder.d.ts +85 -0
- package/dist/types/token.d.ts +50 -0
- package/dist/types/types.d.ts +5 -0
- package/dist/utils/archbaseLogo.d.ts +3 -0
- package/dist/utils/array.d.ts +1 -0
- package/dist/utils/convertImageToBase64.d.ts +1 -0
- package/dist/utils/deepFilter.d.ts +2 -0
- package/dist/utils/deepFind.d.ts +2 -0
- package/dist/utils/deepForEach.d.ts +2 -0
- package/dist/utils/deepMap.d.ts +2 -0
- package/dist/utils/dom.d.ts +2 -0
- package/dist/utils/enum-utils.d.ts +1 -0
- package/dist/utils/filter.d.ts +2 -0
- package/dist/utils/getElementName.d.ts +2 -0
- package/dist/utils/groupByType.d.ts +2 -0
- package/dist/utils/hasChildren.d.ts +4 -0
- package/dist/utils/hasComplexChildren.d.ts +4 -0
- package/dist/utils/index.d.ts +24 -0
- package/dist/utils/isBase64.d.ts +1 -0
- package/dist/utils/isEmail.d.ts +1 -0
- package/dist/utils/masker.d.ts +27 -0
- package/dist/utils/nestedObject.d.ts +7 -0
- package/dist/utils/object.d.ts +10 -0
- package/dist/utils/objectPrototype.d.ts +2 -0
- package/dist/utils/onlyText.d.ts +3 -0
- package/dist/utils/onlyValid.d.ts +2 -0
- package/dist/utils/propertyUtils.d.ts +1 -0
- package/dist/utils/string-utils.d.ts +138 -0
- package/dist/utils/string.d.ts +11 -0
- package/dist/validation/ValidationErrorsContext.d.ts +25 -0
- package/dist/validator/ArchbaseValidator.d.ts +21 -0
- package/dist/validator/container.d.ts +25 -0
- package/dist/validator/decorator/ValidationOptions.d.ts +25 -0
- package/dist/validator/decorator/array/ArrayContains.d.ts +12 -0
- package/dist/validator/decorator/array/ArrayMaxSize.d.ts +12 -0
- package/dist/validator/decorator/array/ArrayMinSize.d.ts +12 -0
- package/dist/validator/decorator/array/ArrayNotContains.d.ts +12 -0
- package/dist/validator/decorator/array/ArrayNotEmpty.d.ts +12 -0
- package/dist/validator/decorator/array/ArrayUnique.d.ts +13 -0
- package/dist/validator/decorator/common/Allow.d.ts +5 -0
- package/dist/validator/decorator/common/Equals.d.ts +10 -0
- package/dist/validator/decorator/common/IsDefined.d.ts +10 -0
- package/dist/validator/decorator/common/IsEmpty.d.ts +10 -0
- package/dist/validator/decorator/common/IsIn.d.ts +10 -0
- package/dist/validator/decorator/common/IsLatLong.d.ts +10 -0
- package/dist/validator/decorator/common/IsLatitude.d.ts +10 -0
- package/dist/validator/decorator/common/IsLongitude.d.ts +10 -0
- package/dist/validator/decorator/common/IsNotEmpty.d.ts +10 -0
- package/dist/validator/decorator/common/IsNotIn.d.ts +10 -0
- package/dist/validator/decorator/common/IsOptional.d.ts +5 -0
- package/dist/validator/decorator/common/NotEquals.d.ts +10 -0
- package/dist/validator/decorator/common/Validate.d.ts +14 -0
- package/dist/validator/decorator/common/ValidateBy.d.ts +11 -0
- package/dist/validator/decorator/common/ValidateIf.d.ts +5 -0
- package/dist/validator/decorator/common/ValidateNested.d.ts +5 -0
- package/dist/validator/decorator/common/ValidatePromise.d.ts +5 -0
- package/dist/validator/decorator/date/MaxDate.d.ts +10 -0
- package/dist/validator/decorator/date/MinDate.d.ts +10 -0
- package/dist/validator/decorator/decorators.d.ts +111 -0
- package/dist/validator/decorator/number/IsDivisibleBy.d.ts +10 -0
- package/dist/validator/decorator/number/IsNegative.d.ts +10 -0
- package/dist/validator/decorator/number/IsPositive.d.ts +10 -0
- package/dist/validator/decorator/number/Max.d.ts +10 -0
- package/dist/validator/decorator/number/Min.d.ts +10 -0
- package/dist/validator/decorator/object/IsInstance.d.ts +10 -0
- package/dist/validator/decorator/object/IsNotEmptyObject.d.ts +16 -0
- package/dist/validator/decorator/string/Contains.d.ts +12 -0
- package/dist/validator/decorator/string/IsAlpha.d.ts +12 -0
- package/dist/validator/decorator/string/IsAlphanumeric.d.ts +12 -0
- package/dist/validator/decorator/string/IsAscii.d.ts +12 -0
- package/dist/validator/decorator/string/IsBIC.d.ts +12 -0
- package/dist/validator/decorator/string/IsBase32.d.ts +12 -0
- package/dist/validator/decorator/string/IsBase58.d.ts +12 -0
- package/dist/validator/decorator/string/IsBase64.d.ts +12 -0
- package/dist/validator/decorator/string/IsBooleanString.d.ts +12 -0
- package/dist/validator/decorator/string/IsBtcAddress.d.ts +12 -0
- package/dist/validator/decorator/string/IsByteLength.d.ts +12 -0
- package/dist/validator/decorator/string/IsCreditCard.d.ts +12 -0
- package/dist/validator/decorator/string/IsCurrency.d.ts +12 -0
- package/dist/validator/decorator/string/IsDataURI.d.ts +12 -0
- package/dist/validator/decorator/string/IsDateString.d.ts +10 -0
- package/dist/validator/decorator/string/IsDecimal.d.ts +12 -0
- package/dist/validator/decorator/string/IsEAN.d.ts +12 -0
- package/dist/validator/decorator/string/IsEmail.d.ts +12 -0
- package/dist/validator/decorator/string/IsEthereumAddress.d.ts +12 -0
- package/dist/validator/decorator/string/IsFQDN.d.ts +12 -0
- package/dist/validator/decorator/string/IsFirebasePushId.d.ts +12 -0
- package/dist/validator/decorator/string/IsFullWidth.d.ts +12 -0
- package/dist/validator/decorator/string/IsHSL.d.ts +14 -0
- package/dist/validator/decorator/string/IsHalfWidth.d.ts +12 -0
- package/dist/validator/decorator/string/IsHash.d.ts +14 -0
- package/dist/validator/decorator/string/IsHexColor.d.ts +12 -0
- package/dist/validator/decorator/string/IsHexadecimal.d.ts +12 -0
- package/dist/validator/decorator/string/IsIBAN.d.ts +12 -0
- package/dist/validator/decorator/string/IsIP.d.ts +13 -0
- package/dist/validator/decorator/string/IsISBN.d.ts +13 -0
- package/dist/validator/decorator/string/IsISIN.d.ts +12 -0
- package/dist/validator/decorator/string/IsISO31661Alpha2.d.ts +10 -0
- package/dist/validator/decorator/string/IsISO31661Alpha3.d.ts +10 -0
- package/dist/validator/decorator/string/IsISO8601.d.ts +14 -0
- package/dist/validator/decorator/string/IsISRC.d.ts +12 -0
- package/dist/validator/decorator/string/IsISSN.d.ts +12 -0
- package/dist/validator/decorator/string/IsIdentityCard.d.ts +16 -0
- package/dist/validator/decorator/string/IsJSON.d.ts +12 -0
- package/dist/validator/decorator/string/IsJWT.d.ts +12 -0
- package/dist/validator/decorator/string/IsLocale.d.ts +12 -0
- package/dist/validator/decorator/string/IsLowercase.d.ts +12 -0
- package/dist/validator/decorator/string/IsMacAddress.d.ts +13 -0
- package/dist/validator/decorator/string/IsMagnetURI.d.ts +12 -0
- package/dist/validator/decorator/string/IsMilitaryTime.d.ts +12 -0
- package/dist/validator/decorator/string/IsMimeType.d.ts +12 -0
- package/dist/validator/decorator/string/IsMobilePhone.d.ts +28 -0
- package/dist/validator/decorator/string/IsMongoId.d.ts +12 -0
- package/dist/validator/decorator/string/IsMultibyte.d.ts +12 -0
- package/dist/validator/decorator/string/IsNumberString.d.ts +12 -0
- package/dist/validator/decorator/string/IsOctal.d.ts +12 -0
- package/dist/validator/decorator/string/IsPassportNumber.d.ts +12 -0
- package/dist/validator/decorator/string/IsPhoneNumber.d.ts +19 -0
- package/dist/validator/decorator/string/IsPort.d.ts +10 -0
- package/dist/validator/decorator/string/IsPostalCode.d.ts +12 -0
- package/dist/validator/decorator/string/IsRFC3339.d.ts +12 -0
- package/dist/validator/decorator/string/IsRgbColor.d.ts +14 -0
- package/dist/validator/decorator/string/IsSemVer.d.ts +12 -0
- package/dist/validator/decorator/string/IsStrongPassword.d.ts +16 -0
- package/dist/validator/decorator/string/IsSurrogatePair.d.ts +12 -0
- package/dist/validator/decorator/string/IsTimeZone.d.ts +12 -0
- package/dist/validator/decorator/string/IsUUID.d.ts +12 -0
- package/dist/validator/decorator/string/IsUppercase.d.ts +12 -0
- package/dist/validator/decorator/string/IsUrl.d.ts +12 -0
- package/dist/validator/decorator/string/IsVariableWidth.d.ts +12 -0
- package/dist/validator/decorator/string/Length.d.ts +12 -0
- package/dist/validator/decorator/string/Matches.d.ts +14 -0
- package/dist/validator/decorator/string/MaxLength.d.ts +12 -0
- package/dist/validator/decorator/string/MinLength.d.ts +12 -0
- package/dist/validator/decorator/string/NotContains.d.ts +12 -0
- package/dist/validator/decorator/string/is-iso4217-currency-code.d.ts +10 -0
- package/dist/validator/decorator/string/is-tax-id.d.ts +20 -0
- package/dist/validator/decorator/typechecker/IsArray.d.ts +10 -0
- package/dist/validator/decorator/typechecker/IsBoolean.d.ts +10 -0
- package/dist/validator/decorator/typechecker/IsDate.d.ts +10 -0
- package/dist/validator/decorator/typechecker/IsEnum.d.ts +10 -0
- package/dist/validator/decorator/typechecker/IsInt.d.ts +10 -0
- package/dist/validator/decorator/typechecker/IsNumber.d.ts +18 -0
- package/dist/validator/decorator/typechecker/IsObject.d.ts +12 -0
- package/dist/validator/decorator/typechecker/IsString.d.ts +10 -0
- package/dist/validator/index.d.ts +49 -0
- package/dist/validator/metadata/ConstraintMetadata.d.ts +23 -0
- package/dist/validator/metadata/MetadataStorage.d.ts +42 -0
- package/dist/validator/metadata/ValidationMetadata.d.ts +53 -0
- package/dist/validator/metadata/ValidationMetadataArgs.d.ts +38 -0
- package/dist/validator/register-decorator.d.ts +36 -0
- package/dist/validator/utils/convert-to-array.util.d.ts +4 -0
- package/dist/validator/utils/get-global.util.d.ts +7 -0
- package/dist/validator/utils/index.d.ts +3 -0
- package/dist/validator/utils/is-promise.util.d.ts +1 -0
- package/dist/validator/validation/ValidationArguments.d.ts +26 -0
- package/dist/validator/validation/ValidationError.d.ts +42 -0
- package/dist/validator/validation/ValidationExecutor.d.ts +28 -0
- package/dist/validator/validation/ValidationTypes.d.ts +15 -0
- package/dist/validator/validation/ValidationUtils.d.ts +8 -0
- package/dist/validator/validation/Validator.d.ts +37 -0
- package/dist/validator/validation/ValidatorConstraintInterface.d.ts +14 -0
- package/dist/validator/validation/ValidatorOptions.d.ts +75 -0
- package/dist/validator/validation-schema/ValidationSchema.d.ts +57 -0
- package/dist/validator/validation-schema/ValidationSchemaToMetadataTransformer.d.ts +8 -0
- package/package.json +88 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './config';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const EQ: "==";
|
|
2
|
+
declare const NEQ: "!=";
|
|
3
|
+
declare const LE: "<=";
|
|
4
|
+
declare const GE: ">=";
|
|
5
|
+
declare const LT: "<";
|
|
6
|
+
declare const GT: ">";
|
|
7
|
+
declare const IN: "=in=";
|
|
8
|
+
declare const OUT: "=out=";
|
|
9
|
+
declare const BT: "=bt=";
|
|
10
|
+
declare const NB: "=nb=";
|
|
11
|
+
declare const LE_VERBOSE: "=le=";
|
|
12
|
+
declare const GE_VERBOSE: "=ge=";
|
|
13
|
+
declare const LT_VERBOSE: "=lt=";
|
|
14
|
+
declare const GT_VERBOSE: "=gt=";
|
|
15
|
+
type CustomComparisonOperator = string;
|
|
16
|
+
declare const CanonicalComparisonOperators: ("!=" | ">" | "<" | ">=" | "<=" | "==" | "=in=" | "=out=" | "=bt=" | "=nb=")[];
|
|
17
|
+
type CanonicalComparisonOperator = (typeof CanonicalComparisonOperators)[number];
|
|
18
|
+
declare const VerboseComparisonOperators: ("=le=" | "=ge=" | "=lt=" | "=gt=")[];
|
|
19
|
+
type VerboseComparisonOperator = (typeof VerboseComparisonOperators)[number];
|
|
20
|
+
declare const ComparisonOperators: ("!=" | ">" | "<" | ">=" | "<=" | "==" | "=in=" | "=out=" | "=bt=" | "=nb=" | "=le=" | "=ge=" | "=lt=" | "=gt=")[];
|
|
21
|
+
type ComparisonOperator = (typeof ComparisonOperators)[number] | CustomComparisonOperator;
|
|
22
|
+
declare function isComparisonOperator(candidate: string, operator?: ComparisonOperator): candidate is ComparisonOperator;
|
|
23
|
+
export { EQ, NEQ, LE, GE, LT, GT, IN, OUT, BT, NB, LE_VERBOSE, GE_VERBOSE, LT_VERBOSE, GT_VERBOSE, ComparisonOperators, CanonicalComparisonOperators, VerboseComparisonOperators, isComparisonOperator, };
|
|
24
|
+
export type { ComparisonOperator, CanonicalComparisonOperator, VerboseComparisonOperator };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const AND: ";";
|
|
2
|
+
declare const OR: ",";
|
|
3
|
+
declare const AND_VERBOSE: "and";
|
|
4
|
+
declare const OR_VERBOSE: "or";
|
|
5
|
+
declare const CanonicalLogicOperators: (";" | ",")[];
|
|
6
|
+
type CanonicalLogicOperator = (typeof CanonicalLogicOperators)[number];
|
|
7
|
+
declare const VerboseLogicOperators: ("and" | "or")[];
|
|
8
|
+
type VerboseLogicOperator = (typeof VerboseLogicOperators)[number];
|
|
9
|
+
declare const LogicOperators: (";" | "," | "and" | "or")[];
|
|
10
|
+
type LogicOperator = (typeof LogicOperators)[number];
|
|
11
|
+
declare function isLogicOperator(candidate: string, operator?: LogicOperator): candidate is LogicOperator;
|
|
12
|
+
export { AND, OR, AND_VERBOSE, OR_VERBOSE, CanonicalLogicOperators, VerboseLogicOperators, LogicOperators, isLogicOperator };
|
|
13
|
+
export type { CanonicalLogicOperator, VerboseLogicOperator, LogicOperator };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ComparisonOperator } from './ComparisonOperator';
|
|
2
|
+
import { LogicOperator } from './LogicOperator';
|
|
3
|
+
declare const NodeType: {
|
|
4
|
+
readonly SELECTOR: "SELECTOR";
|
|
5
|
+
readonly VALUE: "VALUE";
|
|
6
|
+
readonly COMPARISON: "COMPARISON";
|
|
7
|
+
readonly LOGIC: "LOGIC";
|
|
8
|
+
};
|
|
9
|
+
interface Node<TType = string> {
|
|
10
|
+
readonly type: TType;
|
|
11
|
+
}
|
|
12
|
+
interface SelectorNode extends Node<typeof NodeType.SELECTOR> {
|
|
13
|
+
readonly selector: string;
|
|
14
|
+
}
|
|
15
|
+
interface ValueNode extends Node<typeof NodeType.VALUE> {
|
|
16
|
+
readonly value: string | string[];
|
|
17
|
+
}
|
|
18
|
+
interface BinaryNode<TType extends string = string, TLeft extends Node = Node, TOperator extends string = string, TRight extends Node = Node> extends Node<TType> {
|
|
19
|
+
readonly left: TLeft;
|
|
20
|
+
readonly operator: TOperator;
|
|
21
|
+
readonly right: TRight;
|
|
22
|
+
}
|
|
23
|
+
type ComparisonNode = BinaryNode<typeof NodeType.COMPARISON, SelectorNode, ComparisonOperator, ValueNode>;
|
|
24
|
+
type LogicNode = BinaryNode<typeof NodeType.LOGIC, ExpressionNode, LogicOperator, ExpressionNode>;
|
|
25
|
+
type ExpressionNode = ComparisonNode | LogicNode;
|
|
26
|
+
declare function isNode(candidate: unknown): candidate is Node;
|
|
27
|
+
declare function isSelectorNode(candidate: unknown): candidate is SelectorNode;
|
|
28
|
+
declare function isValueNode(candidate: unknown): candidate is ValueNode;
|
|
29
|
+
declare function isComparisonNode(candidate: unknown, operator?: ComparisonOperator): candidate is ComparisonNode;
|
|
30
|
+
declare function isLogicNode(candidate: unknown, operator?: LogicOperator): candidate is LogicNode;
|
|
31
|
+
declare function isExpressionNode(candidate: unknown): candidate is ExpressionNode;
|
|
32
|
+
declare function getSelector(comparison: ComparisonNode): string;
|
|
33
|
+
declare function getValue(comparison: ComparisonNode): string | string[];
|
|
34
|
+
declare function getSingleValue(comparison: ComparisonNode): string;
|
|
35
|
+
declare function getMultiValue(comparison: ComparisonNode): string[];
|
|
36
|
+
declare function createSelectorNode(selector: string, skipChecks?: boolean): SelectorNode;
|
|
37
|
+
declare function createValueNode(value: string | string[], skipChecks?: boolean): ValueNode;
|
|
38
|
+
declare function createComparisonNode(selector: SelectorNode, operator: ComparisonOperator, value: ValueNode, skipChecks?: boolean): ComparisonNode;
|
|
39
|
+
declare function createLogicNode(left: ExpressionNode, operator: LogicOperator, right: ExpressionNode, skipChecks?: boolean): LogicNode;
|
|
40
|
+
export { createSelectorNode, createValueNode, createComparisonNode, createLogicNode, isNode, isSelectorNode, isValueNode, isComparisonNode, isLogicNode, isExpressionNode, getSelector, getValue, getSingleValue, getMultiValue, };
|
|
41
|
+
export type { Node, SelectorNode, ValueNode, BinaryNode, ComparisonNode, LogicNode, ExpressionNode };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComparisonOperator, LogicOperator, ComparisonNode, ExpressionNode } from '../ast';
|
|
2
|
+
interface Builder {
|
|
3
|
+
comparison(selector: string, operator: ComparisonOperator, value: string | number | (string | number)[]): ComparisonNode;
|
|
4
|
+
eq(selector: string, value: string | number): ComparisonNode;
|
|
5
|
+
bt(selector: string, value1: string | number, value2: string | number): ComparisonNode;
|
|
6
|
+
nb(selector: string, value1: string | number, value2: string | number): ComparisonNode;
|
|
7
|
+
neq(selector: string, value: string | number): ComparisonNode;
|
|
8
|
+
le(selector: string, value: string | number): ComparisonNode;
|
|
9
|
+
lt(selector: string, value: string | number): ComparisonNode;
|
|
10
|
+
ge(selector: string, value: string | number): ComparisonNode;
|
|
11
|
+
gt(selector: string, value: string | number): ComparisonNode;
|
|
12
|
+
in(selector: string, values: (string | number)[]): ComparisonNode;
|
|
13
|
+
out(selector: string, values: (string | number)[]): ComparisonNode;
|
|
14
|
+
logic(expressions: ExpressionNode[], operator: LogicOperator): ExpressionNode;
|
|
15
|
+
and(...expressions: ExpressionNode[]): ExpressionNode;
|
|
16
|
+
or(...expressions: ExpressionNode[]): ExpressionNode;
|
|
17
|
+
}
|
|
18
|
+
declare const builder: Builder;
|
|
19
|
+
export { builder };
|
|
20
|
+
export type { Builder };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ExpressionNode } from '../ast';
|
|
2
|
+
type Quote = '"' | "'";
|
|
3
|
+
interface EmitOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The preferred quote character to use when `emit` encounters a comparison value that needs to be escaped by wrapping
|
|
6
|
+
* in quotes. Either `"` (the ASCII double quote character) or `'` (the ASCII single quote character). Defaults to `"`
|
|
7
|
+
* (the ASCII double quote character).
|
|
8
|
+
*/
|
|
9
|
+
preferredQuote?: Quote;
|
|
10
|
+
/**
|
|
11
|
+
* If `true`, `emit` will override the `preferredQuote` setting on a comparison value-by-comparison value basis if
|
|
12
|
+
* doing so would shorten the emitted RSQL. If `false`, `emit` will use the `preferredQuote` as the quote character
|
|
13
|
+
* for all comparison values encountered. Defaults to `true`.
|
|
14
|
+
*/
|
|
15
|
+
optimizeQuotes?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare function emit(expression: ExpressionNode, options?: EmitOptions): string;
|
|
18
|
+
export { emit };
|
|
19
|
+
export type { EmitOptions, Quote };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnyToken } from './lexer/Token';
|
|
2
|
+
declare function createErrorForUnexpectedCharacter(position: number, source: string): SyntaxError;
|
|
3
|
+
declare function createErrorForUnclosedQuote(position: number, source: string): SyntaxError;
|
|
4
|
+
declare function createErrorForUnexpectedToken(token: AnyToken, source: string): SyntaxError;
|
|
5
|
+
declare function createErrorForUnclosedParenthesis(_token: AnyToken, source: string, parentPosition: number): SyntaxError;
|
|
6
|
+
declare function createErrorForEmptyInput(_token: AnyToken, source: string): SyntaxError;
|
|
7
|
+
export { createErrorForUnexpectedCharacter, createErrorForUnclosedQuote, createErrorForUnexpectedToken, createErrorForUnclosedParenthesis, createErrorForEmptyInput, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Node } from '../ast';
|
|
2
|
+
import { AnyToken } from './lexer/Token';
|
|
3
|
+
interface ParserContext {
|
|
4
|
+
position: number;
|
|
5
|
+
readonly tokens: AnyToken[];
|
|
6
|
+
readonly stack: (AnyToken | Node)[];
|
|
7
|
+
readonly state: number[];
|
|
8
|
+
readonly parent: ParserContext | null;
|
|
9
|
+
}
|
|
10
|
+
declare function getParserContextState(context: ParserContext): number;
|
|
11
|
+
declare function getParserContextToken(context: ParserContext): AnyToken;
|
|
12
|
+
declare function getParserContextHead(context: ParserContext): AnyToken | Node;
|
|
13
|
+
declare function createParserContext(tokens: AnyToken[]): ParserContext;
|
|
14
|
+
export default ParserContext;
|
|
15
|
+
export { getParserContextState, getParserContextToken, getParserContextHead, createParserContext };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare const OperationType: {
|
|
2
|
+
readonly SHIFT: 0;
|
|
3
|
+
readonly PUSH: 1;
|
|
4
|
+
readonly REDUCE: 2;
|
|
5
|
+
readonly POP: 3;
|
|
6
|
+
readonly GOTO: 4;
|
|
7
|
+
readonly ACCEPT: 5;
|
|
8
|
+
};
|
|
9
|
+
interface ShiftOperation {
|
|
10
|
+
type: typeof OperationType.SHIFT;
|
|
11
|
+
state: number;
|
|
12
|
+
}
|
|
13
|
+
interface PushOperation {
|
|
14
|
+
type: typeof OperationType.PUSH;
|
|
15
|
+
state: number;
|
|
16
|
+
}
|
|
17
|
+
interface ReduceOperation {
|
|
18
|
+
type: typeof OperationType.REDUCE;
|
|
19
|
+
production: number;
|
|
20
|
+
}
|
|
21
|
+
interface PopOperation {
|
|
22
|
+
type: typeof OperationType.POP;
|
|
23
|
+
production: number;
|
|
24
|
+
}
|
|
25
|
+
interface GoToOperation {
|
|
26
|
+
type: typeof OperationType.GOTO;
|
|
27
|
+
state: number;
|
|
28
|
+
}
|
|
29
|
+
interface AcceptOperation {
|
|
30
|
+
type: typeof OperationType.ACCEPT;
|
|
31
|
+
}
|
|
32
|
+
type NoOperation = undefined;
|
|
33
|
+
type TokenOperation = ShiftOperation | ReduceOperation | PushOperation | PopOperation | AcceptOperation | NoOperation;
|
|
34
|
+
type NodeOperation = GoToOperation | NoOperation;
|
|
35
|
+
declare function shift(state: number): ShiftOperation;
|
|
36
|
+
declare function reduce(production: number): ReduceOperation;
|
|
37
|
+
declare function push(state: number): PushOperation;
|
|
38
|
+
declare function pop(production: number): PopOperation;
|
|
39
|
+
declare function goto(state: number): GoToOperation;
|
|
40
|
+
declare function accept(): AcceptOperation;
|
|
41
|
+
declare const noop: NoOperation;
|
|
42
|
+
export { OperationType, shift, reduce, push, pop, accept, goto, noop };
|
|
43
|
+
export type { ShiftOperation, ReduceOperation, PushOperation, PopOperation, AcceptOperation, GoToOperation, NoOperation, TokenOperation, NodeOperation, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Node } from '../ast';
|
|
2
|
+
import { AnyToken } from './lexer/Token';
|
|
3
|
+
type ParserProduction = (stack: (AnyToken | Node)[]) => {
|
|
4
|
+
consumed: number;
|
|
5
|
+
produced: Node;
|
|
6
|
+
};
|
|
7
|
+
declare const comparisonExpressionProduction: ParserProduction;
|
|
8
|
+
declare const logicalExpressionProduction: ParserProduction;
|
|
9
|
+
declare const groupExpressionProduction: ParserProduction;
|
|
10
|
+
declare const selectorProduction: ParserProduction;
|
|
11
|
+
declare const singleValueProduction: ParserProduction;
|
|
12
|
+
declare const multiValueProduction: ParserProduction;
|
|
13
|
+
export { selectorProduction, singleValueProduction, multiValueProduction, comparisonExpressionProduction, logicalExpressionProduction, groupExpressionProduction, };
|
|
14
|
+
export type { ParserProduction };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Token from './Token';
|
|
2
|
+
import LexerContext from './LexerContext';
|
|
3
|
+
type LexerProcessor<TOutput> = (context: LexerContext) => TOutput;
|
|
4
|
+
type SeekProcessor<TToken extends Token = Token> = LexerProcessor<TToken | null>;
|
|
5
|
+
type SkipProcessor = LexerProcessor<void>;
|
|
6
|
+
type ScanProcessor<TSymbol extends string> = LexerProcessor<TSymbol | null>;
|
|
7
|
+
export default LexerProcessor;
|
|
8
|
+
export type { SeekProcessor, SkipProcessor, ScanProcessor };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ComparisonOperator, LogicOperator } from '../../ast';
|
|
2
|
+
declare const TokenType: {
|
|
3
|
+
readonly UNQUOTED: "UNQUOTED";
|
|
4
|
+
readonly QUOTED: "QUOTED";
|
|
5
|
+
readonly PARENTHESIS: "PARENTHESIS";
|
|
6
|
+
readonly OPERATOR: "OPERATOR";
|
|
7
|
+
readonly END: "END";
|
|
8
|
+
};
|
|
9
|
+
interface Token<TType extends string = string, TValue = any> {
|
|
10
|
+
readonly type: TType;
|
|
11
|
+
readonly value: TValue;
|
|
12
|
+
readonly position: number;
|
|
13
|
+
}
|
|
14
|
+
type UnquotedToken = Token<typeof TokenType.UNQUOTED, string>;
|
|
15
|
+
type QuotedToken = Token<typeof TokenType.QUOTED, string>;
|
|
16
|
+
type ParenthesisToken = Token<typeof TokenType.PARENTHESIS, '(' | ')'>;
|
|
17
|
+
type OperatorToken = Token<typeof TokenType.OPERATOR, ComparisonOperator | LogicOperator>;
|
|
18
|
+
type EndToken = Token<typeof TokenType.END, 'END'>;
|
|
19
|
+
declare function createUnquotedToken(value: string, position: number): UnquotedToken;
|
|
20
|
+
declare function createQuotedToken(value: string, position: number): QuotedToken;
|
|
21
|
+
declare function createParenthesisToken(value: '(' | ')', position: number): ParenthesisToken;
|
|
22
|
+
declare function createOperatorToken(value: ComparisonOperator | LogicOperator, position: number): OperatorToken;
|
|
23
|
+
declare function createEndToken(position: number): EndToken;
|
|
24
|
+
type AnyToken = UnquotedToken | QuotedToken | ParenthesisToken | OperatorToken | EndToken;
|
|
25
|
+
declare function isToken(candidate: object): candidate is Token;
|
|
26
|
+
declare function isUnquotedToken(candidate: object): candidate is UnquotedToken;
|
|
27
|
+
declare function isQuotedToken(candidate: object): candidate is QuotedToken;
|
|
28
|
+
declare function isParenthesisToken(candidate: object): candidate is ParenthesisToken;
|
|
29
|
+
declare function isOpenParenthesisToken(candidate: object): candidate is ParenthesisToken;
|
|
30
|
+
declare function isCloseParenthesisToken(candidate: object): candidate is ParenthesisToken;
|
|
31
|
+
declare function isOperatorToken(candidate: object): candidate is OperatorToken;
|
|
32
|
+
declare function isComparisonOperatorToken(candidate: object): candidate is OperatorToken;
|
|
33
|
+
declare function isOrOperatorToken(candidate: object): candidate is OperatorToken;
|
|
34
|
+
declare function isAndOperatorToken(candidate: object): candidate is OperatorToken;
|
|
35
|
+
declare function isEndToken(candidate: object): candidate is EndToken;
|
|
36
|
+
export default Token;
|
|
37
|
+
export { createUnquotedToken, createQuotedToken, createParenthesisToken, createOperatorToken, createEndToken, isToken, isUnquotedToken, isQuotedToken, isParenthesisToken, isOpenParenthesisToken, isCloseParenthesisToken, isOperatorToken, isComparisonOperatorToken, isOrOperatorToken, isAndOperatorToken, isEndToken, };
|
|
38
|
+
export type { AnyToken, UnquotedToken, QuotedToken, ParenthesisToken, OperatorToken, EndToken };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filter and Query types for Archbase Core
|
|
3
|
+
*/
|
|
4
|
+
export interface IQueryFilterEntity {
|
|
5
|
+
id?: any;
|
|
6
|
+
companyId?: any;
|
|
7
|
+
filter?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
userOwner?: string;
|
|
11
|
+
shared?: boolean;
|
|
12
|
+
readOnly?: boolean;
|
|
13
|
+
componentId?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class QueryFilterEntity implements IQueryFilterEntity {
|
|
16
|
+
id?: any;
|
|
17
|
+
companyId?: any;
|
|
18
|
+
filter?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
userOwner?: string;
|
|
22
|
+
shared?: boolean;
|
|
23
|
+
readOnly?: boolean;
|
|
24
|
+
componentId?: string;
|
|
25
|
+
constructor(data?: Partial<IQueryFilterEntity>);
|
|
26
|
+
}
|
|
27
|
+
export type DelegatorCallback = (error: string | null, result?: any) => void;
|
|
28
|
+
export interface ArchbaseQueryFilterDelegator {
|
|
29
|
+
onSaveFilter?: DelegatorCallback;
|
|
30
|
+
onRemoveFilter?: DelegatorCallback;
|
|
31
|
+
onSelectFilter?: DelegatorCallback;
|
|
32
|
+
onClearFilter?: DelegatorCallback;
|
|
33
|
+
addNewFilter?(filter: IQueryFilterEntity, onResult: DelegatorCallback): void;
|
|
34
|
+
saveFilter?(filter: IQueryFilterEntity, onResult: DelegatorCallback): void;
|
|
35
|
+
removeFilterBy?(filter: IQueryFilterEntity, onResult: DelegatorCallback): void;
|
|
36
|
+
getFilterById?(id: any): IQueryFilterEntity | undefined;
|
|
37
|
+
getFirstFilter?(): IQueryFilterEntity | undefined;
|
|
38
|
+
getFilters?(): IQueryFilterEntity[];
|
|
39
|
+
}
|
|
40
|
+
export interface ArchbaseQueryFilter {
|
|
41
|
+
filter?: any;
|
|
42
|
+
sort?: any;
|
|
43
|
+
searchText?: string;
|
|
44
|
+
activeFilterIndex?: number;
|
|
45
|
+
quickFilterText?: string;
|
|
46
|
+
activeFilter?: IQueryFilterEntity;
|
|
47
|
+
}
|
|
48
|
+
export declare const FILTER_TYPE: {
|
|
49
|
+
readonly QUICK: "QUICK";
|
|
50
|
+
readonly NORMAL: "NORMAL";
|
|
51
|
+
readonly ADVANCED: "ADVANCED";
|
|
52
|
+
};
|
|
53
|
+
export type FilterType = typeof FILTER_TYPE[keyof typeof FILTER_TYPE];
|
|
54
|
+
export declare const QUICK: "QUICK";
|
|
55
|
+
export declare const NORMAL: "NORMAL";
|
|
56
|
+
export declare const ADVANCED: "ADVANCED";
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extended types for QueryBuilder system (specific to querybuilder components)
|
|
3
|
+
* Base types are in filter.ts to avoid duplication
|
|
4
|
+
*/
|
|
5
|
+
export type PositionType = 'filter' | 'fields' | 'range' | undefined;
|
|
6
|
+
export type RangeType = 'month' | 'week' | 'range' | 'day' | undefined;
|
|
7
|
+
export type DataType = 'string' | 'number' | 'date' | 'date_time' | 'time' | 'boolean';
|
|
8
|
+
export interface FilterValue {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SortField {
|
|
13
|
+
name: string;
|
|
14
|
+
selected: boolean;
|
|
15
|
+
order: number;
|
|
16
|
+
asc_desc: string;
|
|
17
|
+
label: string;
|
|
18
|
+
}
|
|
19
|
+
export interface Field {
|
|
20
|
+
name: string;
|
|
21
|
+
label: string;
|
|
22
|
+
dataType: DataType;
|
|
23
|
+
operator: string;
|
|
24
|
+
quickFilter: boolean;
|
|
25
|
+
quickFilterSort: boolean;
|
|
26
|
+
sortable: boolean;
|
|
27
|
+
listValues: FilterValue[];
|
|
28
|
+
searchComponent?: any;
|
|
29
|
+
searchField?: any;
|
|
30
|
+
nameSql?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface Rule {
|
|
33
|
+
field: string;
|
|
34
|
+
operator: string;
|
|
35
|
+
value: any;
|
|
36
|
+
condition?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface Filter {
|
|
39
|
+
id: string;
|
|
40
|
+
selectedFields: Field[];
|
|
41
|
+
quickFilterText: string;
|
|
42
|
+
quickFilterFieldsText: string;
|
|
43
|
+
rules: Rule[];
|
|
44
|
+
condition: string;
|
|
45
|
+
filterType: any;
|
|
46
|
+
}
|
|
47
|
+
export interface Sort {
|
|
48
|
+
quickFilterSort: string;
|
|
49
|
+
sortFields: SortField[];
|
|
50
|
+
activeIndex: number;
|
|
51
|
+
}
|
|
52
|
+
export interface ArchbaseQueryBuilderFilter {
|
|
53
|
+
id?: number;
|
|
54
|
+
filter: Filter;
|
|
55
|
+
sort: Sort;
|
|
56
|
+
name?: string;
|
|
57
|
+
viewName?: string;
|
|
58
|
+
apiVersion?: string;
|
|
59
|
+
selectedFields?: Field[];
|
|
60
|
+
}
|
|
61
|
+
export interface FilterOptions {
|
|
62
|
+
currentFilter?: ArchbaseQueryBuilderFilter;
|
|
63
|
+
activeFilterIndex: number;
|
|
64
|
+
enabledAdvancedFilter: boolean;
|
|
65
|
+
apiVersion: string;
|
|
66
|
+
viewName: string;
|
|
67
|
+
componentName: string;
|
|
68
|
+
onApplyFilter?: (currentFilter: ArchbaseQueryBuilderFilter, index: number) => void;
|
|
69
|
+
}
|
|
70
|
+
export declare const QUICK_FILTER_INDEX = -2;
|
|
71
|
+
export declare const NEW_FILTER_INDEX = -1;
|
|
72
|
+
export declare const OP_NULL = "null";
|
|
73
|
+
export declare const OP_NOT_NULL = "notNull";
|
|
74
|
+
export declare const OP_CONTAINS = "contains";
|
|
75
|
+
export declare const OP_STARTSWITH = "startsWith";
|
|
76
|
+
export declare const OP_ENDSWITH = "endsWith";
|
|
77
|
+
export declare const OP_EQUALS = "=";
|
|
78
|
+
export declare const OP_NOT_EQUALS = "!=";
|
|
79
|
+
export declare const OP_GREATER = ">";
|
|
80
|
+
export declare const OP_LESS = "<";
|
|
81
|
+
export declare const OP_GREATER_OR_EQUAL = ">=";
|
|
82
|
+
export declare const OP_LESS_OR_EQUAL = "<=";
|
|
83
|
+
export declare const OP_BETWEEN = "between";
|
|
84
|
+
export declare const OP_IN_LIST = "inList";
|
|
85
|
+
export declare const OP_NOT_IN_LIST = "notInList";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface representing an access token used for authentication
|
|
3
|
+
*/
|
|
4
|
+
export interface ArchbaseAccessToken {
|
|
5
|
+
token_type: string;
|
|
6
|
+
scope: string;
|
|
7
|
+
expires_in: number;
|
|
8
|
+
ext_expires_in: number;
|
|
9
|
+
access_token: string;
|
|
10
|
+
refresh_token: string;
|
|
11
|
+
id_token: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Interface representing username and password credentials
|
|
15
|
+
*/
|
|
16
|
+
export interface ArchbaseUsernameAndPassword {
|
|
17
|
+
username: string;
|
|
18
|
+
password: string;
|
|
19
|
+
remember: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Interface representing a user in the system
|
|
23
|
+
*/
|
|
24
|
+
export interface ArchbaseUser {
|
|
25
|
+
id: string;
|
|
26
|
+
displayName: string;
|
|
27
|
+
email: string;
|
|
28
|
+
photo: string;
|
|
29
|
+
isAdmin: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Interface for token management operations
|
|
33
|
+
*/
|
|
34
|
+
export interface ArchbaseTokenManager {
|
|
35
|
+
saveUsernameAndPassword(username: string, password: string): void;
|
|
36
|
+
getUsernameAndPassword(): ArchbaseUsernameAndPassword | null;
|
|
37
|
+
saveUsername(username: string): void;
|
|
38
|
+
getUsername(): string | null;
|
|
39
|
+
saveToken(accessToken?: ArchbaseAccessToken): void;
|
|
40
|
+
clearToken(): void;
|
|
41
|
+
clearUsernameAndPassword(): void;
|
|
42
|
+
getToken(): ArchbaseAccessToken | null;
|
|
43
|
+
isTokenExpired(token?: ArchbaseAccessToken, expirationThreshold?: number): boolean;
|
|
44
|
+
/** Salva o contexto da autenticação como string JSON */
|
|
45
|
+
saveContext?(context: string): void;
|
|
46
|
+
/** Recupera o contexto salvo */
|
|
47
|
+
getContext?(): string | null;
|
|
48
|
+
/** Limpa contexto */
|
|
49
|
+
clearContext?(): void;
|
|
50
|
+
}
|