@resistdesign/voltra 3.0.0-alpha.5 → 3.0.0-alpha.51
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 +392 -14
- package/api/DBX/DBXAsserts.d.ts +95 -0
- package/api/DBX/DBXRequest.d.ts +5 -0
- package/api/DBX/DBXRuntime.d.ts +5 -0
- package/api/DBX/DBXScenarioConfig.d.ts +9 -0
- package/api/DBX/DBXSeed.d.ts +124 -0
- package/api/DBX/DBXTypes.d.ts +176 -0
- package/api/DBX/index.d.ts +8 -0
- package/api/DataAccessControl.d.ts +220 -0
- package/api/Indexing/API.d.ts +224 -0
- package/api/Indexing/Cursor.d.ts +101 -0
- package/api/Indexing/Handler/Config.d.ts +39 -0
- package/api/Indexing/Handler.d.ts +166 -0
- package/api/Indexing/Trace.d.ts +54 -0
- package/api/Indexing/Types.d.ts +204 -0
- package/api/Indexing/ddb/AwsSdkV3Adapter.d.ts +8 -0
- package/api/Indexing/ddb/Types.d.ts +209 -0
- package/api/Indexing/docId.d.ts +27 -0
- package/api/Indexing/exact/ExactDdb.d.ts +58 -0
- package/api/Indexing/exact/ExactIndex.d.ts +90 -0
- package/api/Indexing/exact/ExactS3.d.ts +41 -0
- package/api/Indexing/fieldQualification.d.ts +12 -0
- package/api/Indexing/fulltext/FullTextDdbBackend.d.ts +212 -0
- package/api/Indexing/fulltext/FullTextMemoryBackend.d.ts +93 -0
- package/api/Indexing/fulltext/Schema.d.ts +164 -0
- package/api/Indexing/hashUniversal.d.ts +13 -0
- package/api/Indexing/index.d.ts +45 -0
- package/api/Indexing/lossy/LossyDdb.d.ts +43 -0
- package/api/Indexing/lossy/LossyIndex.d.ts +72 -0
- package/api/Indexing/lossy/LossyS3.d.ts +40 -0
- package/api/Indexing/rel/Cursor.d.ts +25 -0
- package/api/Indexing/rel/Handlers.d.ts +144 -0
- package/api/Indexing/rel/RelationalDdb.d.ts +169 -0
- package/api/Indexing/rel/RelationalInMemoryBackend.d.ts +38 -0
- package/api/Indexing/rel/Types.d.ts +69 -0
- package/api/Indexing/structured/Cursor.d.ts +26 -0
- package/api/Indexing/structured/Handlers.d.ts +128 -0
- package/api/Indexing/structured/SearchStructured.d.ts +44 -0
- package/api/Indexing/structured/StructuredDdb.d.ts +184 -0
- package/api/Indexing/structured/StructuredDdbBackend.d.ts +112 -0
- package/api/Indexing/structured/StructuredInMemoryBackend.d.ts +40 -0
- package/api/Indexing/structured/StructuredInMemoryIndex.d.ts +61 -0
- package/api/Indexing/structured/StructuredStringLike.d.ts +54 -0
- package/api/Indexing/structured/StructuredWriter.d.ts +74 -0
- package/api/Indexing/structured/Types.d.ts +126 -0
- package/api/Indexing/structured/index.d.ts +9 -0
- package/api/Indexing/tokenize.d.ts +31 -0
- package/api/ORM/DACUtils.d.ts +270 -0
- package/api/ORM/ListItemUtils.d.ts +40 -0
- package/api/ORM/ORMRouteMap.d.ts +70 -0
- package/api/ORM/TypeInfoORMService.d.ts +879 -0
- package/api/ORM/drivers/DynamoDBDataItemDBDriver/ConfigTypes.d.ts +229 -0
- package/api/ORM/drivers/DynamoDBDataItemDBDriver.d.ts +90 -0
- package/api/ORM/drivers/InMemoryDataItemDBDriver/ConfigTypes.d.ts +4 -0
- package/api/ORM/drivers/InMemoryDataItemDBDriver.d.ts +56 -0
- package/api/ORM/drivers/InMemoryFileItemDBDriver/ConfigTypes.d.ts +13 -0
- package/api/ORM/drivers/InMemoryFileItemDBDriver.d.ts +98 -0
- package/api/ORM/drivers/InMemoryItemRelationshipDBDriver.d.ts +16 -0
- package/api/ORM/drivers/IndexingRelationshipDriver.d.ts +123 -0
- package/api/ORM/drivers/S3FileItemDBDriver/ConfigTypes.d.ts +322 -0
- package/api/ORM/drivers/S3FileItemDBDriver/S3FileDriver.d.ts +118 -0
- package/api/ORM/drivers/S3FileItemDBDriver.d.ts +71 -0
- package/api/ORM/drivers/common/SupportedTypeInfoORMDBDrivers.d.ts +36 -0
- package/api/ORM/drivers/common/Types.d.ts +202 -0
- package/api/ORM/drivers/common/index.d.ts +2 -0
- package/api/ORM/drivers/index.d.ts +8 -0
- package/api/ORM/getTypeInfoORMIndexingConfigFromTypeInfoMap.d.ts +31 -0
- package/api/ORM/index.d.ts +10 -0
- package/api/ORM/indexing/criteriaToStructuredWhere.d.ts +22 -0
- package/api/Router/AWS.d.ts +80 -0
- package/api/Router/Auth.d.ts +14 -0
- package/api/Router/CORS.d.ts +66 -0
- package/api/Router/Types.d.ts +138 -0
- package/api/Router/index.d.ts +89 -0
- package/api/index.d.ts +72 -6
- package/api/index.js +3553 -1948
- package/app/forms/Engine.d.ts +23 -0
- package/app/forms/UI.d.ts +83 -0
- package/app/forms/core/createAutoField.d.ts +43 -0
- package/app/forms/core/createFormRenderer.d.ts +25 -0
- package/app/forms/core/getFieldKind.d.ts +14 -0
- package/app/forms/core/index.d.ts +11 -0
- package/app/forms/core/mergeSuites.d.ts +23 -0
- package/app/forms/core/resolveSuite.d.ts +15 -0
- package/app/forms/core/types.d.ts +180 -0
- package/app/forms/index.d.ts +9 -0
- package/app/forms/types.d.ts +137 -0
- package/app/helpers/styled.d.ts +3 -0
- package/app/index.d.ts +116 -5
- package/app/index.js +120 -382
- package/app/utils/ApplicationState.d.ts +161 -0
- package/app/utils/ApplicationStateLoader.d.ts +91 -0
- package/app/utils/Controller.d.ts +10 -0
- package/app/utils/Debug.d.ts +14 -0
- package/app/utils/EasyLayout.d.ts +89 -0
- package/app/utils/History.d.ts +165 -0
- package/app/utils/Route.d.ts +207 -0
- package/app/utils/RouteHistory.d.ts +27 -0
- package/app/utils/Service.d.ts +45 -0
- package/app/utils/TypeInfoORMAPIUtils.d.ts +94 -0
- package/app/utils/TypeInfoORMClient.d.ts +104 -0
- package/app/utils/UniversalRouteAdapter.d.ts +73 -0
- package/app/utils/easy-layout/computeAreaBounds.d.ts +5 -0
- package/app/utils/easy-layout/computeTracks.d.ts +16 -0
- package/app/utils/easy-layout/index.d.ts +5 -0
- package/app/utils/easy-layout/parseTemplate.d.ts +12 -0
- package/app/utils/easy-layout/types.d.ts +52 -0
- package/app/utils/easy-layout/validateAreas.d.ts +5 -0
- package/app/utils/index.d.ts +24 -0
- package/build/TypeMapping.d.ts +17 -0
- package/build/TypeParsing.d.ts +10 -0
- package/build/index.d.ts +15 -0
- package/build/index.js +569 -0
- package/chunk-2JDOM6PB.js +138 -0
- package/chunk-3HVYVX3S.js +546 -0
- package/chunk-ATO2455Q.js +258 -0
- package/chunk-BSHQIRBV.js +71 -0
- package/chunk-I2KLQ2HA.js +19 -0
- package/chunk-K4R2PFNG.js +1258 -0
- package/chunk-TJFTWPXQ.js +39 -0
- package/chunk-XHOMAXLR.js +84 -0
- package/common/CommandLine/collectRequiredEnvironmentVariables.d.ts +9 -0
- package/common/CommandLine/index.d.ts +6 -0
- package/common/HelperTypes.d.ts +9 -0
- package/common/IdGeneration/getSimpleId.d.ts +8 -0
- package/common/IdGeneration/index.d.ts +1 -0
- package/common/ItemRelationshipInfoTypes.d.ts +64 -0
- package/common/ItemRelationships/ItemRelationshipValidation.d.ts +21 -0
- package/common/ItemRelationships/index.d.ts +2 -0
- package/common/Logging/Utils.d.ts +10 -0
- package/common/Logging/index.d.ts +1 -0
- package/common/Routing.d.ts +81 -0
- package/common/SearchTypes.d.ts +227 -0
- package/common/SearchUtils.d.ts +55 -0
- package/common/SearchValidation.d.ts +27 -0
- package/common/StringTransformers.d.ts +28 -0
- package/common/Testing/CLI.d.ts +6 -0
- package/common/Testing/Types.d.ts +216 -0
- package/common/Testing/Utils.d.ts +112 -0
- package/common/Testing/index.d.ts +8 -0
- package/common/TypeInfoDataItemUtils.d.ts +39 -0
- package/{Types-C7XjUjoF.d.ts → common/TypeInfoORM/Types.d.ts} +150 -20
- package/common/TypeInfoORM/index.d.ts +3 -0
- package/common/TypeParsing/Constants.d.ts +4 -0
- package/common/TypeParsing/ParsingUtils/Constants.d.ts +8 -0
- package/common/TypeParsing/ParsingUtils/checkType.d.ts +14 -0
- package/common/TypeParsing/ParsingUtils/checkUnionType.d.ts +12 -0
- package/common/TypeParsing/ParsingUtils/extractCommentTags.d.ts +8 -0
- package/common/TypeParsing/ParsingUtils/extractLiteralValues.d.ts +12 -0
- package/common/TypeParsing/ParsingUtils/extractTypeDetails.d.ts +14 -0
- package/common/TypeParsing/ParsingUtils/getPrimaryFieldForTypeInfo.d.ts +18 -0
- package/common/TypeParsing/ParsingUtils/getTypeInfo.d.ts +9 -0
- package/common/TypeParsing/ParsingUtils/getTypeInfoField.d.ts +9 -0
- package/common/TypeParsing/ParsingUtils/getTypeInfoFromAliasType.d.ts +11 -0
- package/common/TypeParsing/ParsingUtils/getTypeInfoFromFieldFilter.d.ts +12 -0
- package/common/TypeParsing/ParsingUtils/getTypeInfoFromTypeAlias.d.ts +11 -0
- package/common/TypeParsing/ParsingUtils/getTypeKeyword.d.ts +9 -0
- package/common/TypeParsing/ParsingUtils/getUnionOrIntersectionTypeInfo.d.ts +11 -0
- package/common/TypeParsing/ParsingUtils/getUnionOrLiteralStringValues.d.ts +8 -0
- package/common/TypeParsing/TypeInfo.d.ts +235 -0
- package/common/TypeParsing/Utils.d.ts +47 -0
- package/common/TypeParsing/Validation.d.ts +327 -0
- package/common/TypeParsing/index.d.ts +8 -0
- package/common/index.d.ts +47 -4
- package/common/index.js +25 -1737
- package/{index-BkFZlfit.d.ts → iac/SimpleCFT.d.ts} +5 -25
- package/iac/index.d.ts +40 -2
- package/iac/index.js +2 -1661
- package/iac/packs/auth.d.ts +131 -0
- package/iac/packs/build/utils.d.ts +289 -0
- package/iac/packs/build.d.ts +92 -0
- package/iac/packs/cdn.d.ts +33 -0
- package/iac/packs/cloud-function.d.ts +67 -0
- package/iac/packs/database.d.ts +32 -0
- package/iac/packs/dns.d.ts +34 -0
- package/iac/packs/file-storage.d.ts +46 -0
- package/iac/packs/gateway.d.ts +82 -0
- package/iac/packs/index.d.ts +60 -1
- package/iac/packs/index.js +391 -594
- package/iac/packs/repo.d.ts +28 -0
- package/iac/packs/ssl-certificate.d.ts +28 -0
- package/iac/types/Constants.d.ts +24 -0
- package/{index-DcvJOZ_c.d.ts → iac/types/IaCTypes.d.ts} +23 -1018
- package/iac/types/Renderers.d.ts +96 -0
- package/iac/types/Types.d.ts +131 -0
- package/iac/types/Utils.d.ts +9 -0
- package/iac/types/generate.d.ts +1 -0
- package/iac/utils/index.d.ts +87 -0
- package/iac/utils/patch-utils.d.ts +66 -0
- package/iac-packs/index.d.ts +6 -0
- package/native/forms/UI.d.ts +73 -0
- package/native/forms/createNativeFormRenderer.d.ts +21 -0
- package/native/forms/index.d.ts +25 -0
- package/native/forms/primitives/index.d.ts +38 -0
- package/native/forms/suite.d.ts +15 -0
- package/native/index.d.ts +19 -0
- package/native/index.js +792 -0
- package/native/testing/react-native.d.ts +46 -0
- package/native/utils/EasyLayout.d.ts +88 -0
- package/native/utils/History.d.ts +124 -0
- package/native/utils/NavButton.d.ts +25 -0
- package/native/utils/Route.d.ts +41 -0
- package/native/utils/index.d.ts +25 -0
- package/package.json +54 -21
- package/web/forms/UI.d.ts +74 -0
- package/web/forms/createWebFormRenderer.d.ts +21 -0
- package/web/forms/index.d.ts +9 -0
- package/web/forms/primitives/index.d.ts +21 -0
- package/web/forms/suite.d.ts +15 -0
- package/web/index.d.ts +15 -0
- package/web/index.js +701 -0
- package/web/utils/EasyLayout.d.ts +47 -0
- package/web/utils/NavLink.d.ts +24 -0
- package/web/utils/Route.d.ts +16 -0
- package/web/utils/index.d.ts +8 -0
- package/SearchTypes-DjN6YQzE.d.ts +0 -577
- package/Validation-CFP59oIP.d.ts +0 -226
- package/index-C3-iD9Mh.d.ts +0 -690
- package/index-CK5Qwvfb.d.ts +0 -5378
- package/index-IokxSNxm.d.ts +0 -745
- package/index.d.ts +0 -13
- package/index.js +0 -11005
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UnionTypeNode } from "typescript";
|
|
2
|
+
import { LiteralValue, TypeKeyword } from "../TypeInfo";
|
|
3
|
+
/**
|
|
4
|
+
* Determine literal options and base type keyword for a union type.
|
|
5
|
+
*
|
|
6
|
+
* @param unionType - Union type node to inspect.
|
|
7
|
+
* @returns Literal options and inferred type keyword.
|
|
8
|
+
*/
|
|
9
|
+
export declare const checkUnionType: (unionType: UnionTypeNode) => {
|
|
10
|
+
options: LiteralValue[] | undefined;
|
|
11
|
+
typeKeyword: TypeKeyword;
|
|
12
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Node } from "typescript";
|
|
2
|
+
/**
|
|
3
|
+
* Extract structured comment tags from a TypeScript node's JSDoc.
|
|
4
|
+
*
|
|
5
|
+
* @param node - AST node to read JSDoc tags from.
|
|
6
|
+
* @returns Nested object of tag values keyed by tag name paths.
|
|
7
|
+
*/
|
|
8
|
+
export declare const extractCommentTags: (node: Node) => Record<any, any>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UnionTypeNode } from "typescript";
|
|
2
|
+
import { LiteralValue, TypeKeyword } from "../TypeInfo";
|
|
3
|
+
/**
|
|
4
|
+
* Extract literal values and inferred keyword from a union of literals.
|
|
5
|
+
*
|
|
6
|
+
* @param node - Union type node containing literal members.
|
|
7
|
+
* @returns Literal values and detected type keyword, or undefined if mixed.
|
|
8
|
+
*/
|
|
9
|
+
export declare const extractLiteralValues: (node: UnionTypeNode) => {
|
|
10
|
+
values: LiteralValue[];
|
|
11
|
+
type: TypeKeyword;
|
|
12
|
+
} | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TypeNode } from "typescript";
|
|
2
|
+
import { LiteralValue, TypeKeyword } from "../TypeInfo";
|
|
3
|
+
/**
|
|
4
|
+
* Extract TypeInfo field details from a type node.
|
|
5
|
+
*
|
|
6
|
+
* @param type - Type node to inspect.
|
|
7
|
+
* @returns Type details including keyword, reference, array flag, and options.
|
|
8
|
+
*/
|
|
9
|
+
export declare const extractTypeDetails: (type: TypeNode) => {
|
|
10
|
+
type: TypeKeyword;
|
|
11
|
+
typeReference?: string;
|
|
12
|
+
array: boolean;
|
|
13
|
+
options?: LiteralValue[];
|
|
14
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TypeInfo } from "../TypeInfo";
|
|
2
|
+
/**
|
|
3
|
+
* Errors raised while resolving primary fields.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum TypeInfoPrimaryFieldErrors {
|
|
6
|
+
/**
|
|
7
|
+
* Primary field cannot be read due to denied operations.
|
|
8
|
+
* */
|
|
9
|
+
READ_DENIED_PRIMARY_FIELD_NOT_SUPPORTED = "READ_DENIED_PRIMARY_FIELD_NOT_SUPPORTED"
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the primary field name for a TypeInfo definition.
|
|
13
|
+
*
|
|
14
|
+
* @param typeInfo - TypeInfo definition to inspect.
|
|
15
|
+
* @returns Primary field name, if available.
|
|
16
|
+
* @throws Error when the primary field is read-denied.
|
|
17
|
+
*/
|
|
18
|
+
export declare const getPrimaryFieldForTypeInfo: (typeInfo: TypeInfo) => string | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TypeLiteralNode } from "typescript";
|
|
2
|
+
import { TypeInfo } from "../TypeInfo";
|
|
3
|
+
/**
|
|
4
|
+
* Build a TypeInfo definition from a type literal node.
|
|
5
|
+
*
|
|
6
|
+
* @param typeLiteral - Type literal node to inspect.
|
|
7
|
+
* @returns TypeInfo definition with fields and tags.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getTypeInfo: (typeLiteral: TypeLiteralNode) => TypeInfo;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropertySignature } from "typescript";
|
|
2
|
+
import { TypeInfoField } from "../TypeInfo";
|
|
3
|
+
/**
|
|
4
|
+
* Build TypeInfo field metadata from a property signature.
|
|
5
|
+
*
|
|
6
|
+
* @param propertySignature - Property signature node to inspect.
|
|
7
|
+
* @returns TypeInfo field metadata.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getTypeInfoField: (propertySignature: PropertySignature) => TypeInfoField;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TypeNode } from "typescript";
|
|
2
|
+
import type { TypeMap } from "../../../build/TypeMapping";
|
|
3
|
+
import { TypeInfo } from "../TypeInfo";
|
|
4
|
+
/**
|
|
5
|
+
* Resolve TypeInfo for a type alias node based on its kind.
|
|
6
|
+
*
|
|
7
|
+
* @param type - Alias type node to inspect.
|
|
8
|
+
* @param typeMap - Map of available type aliases.
|
|
9
|
+
* @returns Resolved TypeInfo or undefined when unsupported.
|
|
10
|
+
*/
|
|
11
|
+
export declare const getTypeInfoFromAliasType: (type: TypeNode, typeMap: TypeMap) => TypeInfo | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TypeReferenceNode } from "typescript";
|
|
2
|
+
import type { TypeMap } from "../../../build/TypeMapping";
|
|
3
|
+
import { TypeInfo } from "../TypeInfo";
|
|
4
|
+
/**
|
|
5
|
+
* Resolve TypeInfo for field-filter helper types (Pick/Omit/Exclude).
|
|
6
|
+
*
|
|
7
|
+
* @param typeNameStr - Type name or filter identifier.
|
|
8
|
+
* @param typeRef - Type reference node with type arguments.
|
|
9
|
+
* @param typeMap - Map of available type aliases.
|
|
10
|
+
* @returns Filtered TypeInfo or undefined when not resolvable.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getTypeInfoFromFieldFilter: (typeNameStr: string | undefined, typeRef: TypeReferenceNode, typeMap: TypeMap) => TypeInfo | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TypeAliasDeclaration } from "typescript";
|
|
2
|
+
import type { TypeMap } from "../../../build/TypeMapping";
|
|
3
|
+
import { TypeInfo } from "../TypeInfo";
|
|
4
|
+
/**
|
|
5
|
+
* Resolve TypeInfo for a type alias declaration.
|
|
6
|
+
*
|
|
7
|
+
* @param typeAliasDec - Type alias declaration node.
|
|
8
|
+
* @param typeMap - Map of available type aliases.
|
|
9
|
+
* @returns Resolved TypeInfo or undefined when unsupported.
|
|
10
|
+
*/
|
|
11
|
+
export declare const getTypeInfoFromTypeAlias: (typeAliasDec: TypeAliasDeclaration, typeMap: TypeMap) => TypeInfo | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TypeNode } from "typescript";
|
|
2
|
+
import { TypeKeyword } from "../TypeInfo";
|
|
3
|
+
/**
|
|
4
|
+
* Resolve a TypeScript type node into a TypeInfo keyword.
|
|
5
|
+
*
|
|
6
|
+
* @param node - Type node to inspect.
|
|
7
|
+
* @returns TypeInfo keyword (string, number, boolean).
|
|
8
|
+
*/
|
|
9
|
+
export declare const getTypeKeyword: (node: TypeNode) => TypeKeyword;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IntersectionTypeNode, UnionTypeNode } from "typescript";
|
|
2
|
+
import type { TypeMap } from "../../../build/TypeMapping";
|
|
3
|
+
import { TypeInfo } from "../TypeInfo";
|
|
4
|
+
/**
|
|
5
|
+
* Resolve TypeInfo for union or intersection types.
|
|
6
|
+
*
|
|
7
|
+
* @param unionType - Union or intersection type node to inspect.
|
|
8
|
+
* @param typeMap - Map of available type aliases.
|
|
9
|
+
* @returns Resolved TypeInfo or undefined when unsupported.
|
|
10
|
+
*/
|
|
11
|
+
export declare const getUnionOrIntersectionTypeInfo: (unionType: UnionTypeNode | IntersectionTypeNode, typeMap: TypeMap) => TypeInfo | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Node } from "typescript";
|
|
2
|
+
/**
|
|
3
|
+
* Extract string literal values from a union or literal type node.
|
|
4
|
+
*
|
|
5
|
+
* @param node - Type node to inspect.
|
|
6
|
+
* @returns List of literal values as strings.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getUnionOrLiteralStringValues: (node?: Node) => string[];
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeInfo definitions and tags used across parsing and validation.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* A set of possible operations for a type or field value.
|
|
6
|
+
*
|
|
7
|
+
* @category TypeInfo
|
|
8
|
+
*/
|
|
9
|
+
export declare enum TypeOperation {
|
|
10
|
+
/**
|
|
11
|
+
* Create operation.
|
|
12
|
+
*/
|
|
13
|
+
CREATE = "CREATE",
|
|
14
|
+
/**
|
|
15
|
+
* Read operation.
|
|
16
|
+
*/
|
|
17
|
+
READ = "READ",
|
|
18
|
+
/**
|
|
19
|
+
* Update operation.
|
|
20
|
+
*/
|
|
21
|
+
UPDATE = "UPDATE",
|
|
22
|
+
/**
|
|
23
|
+
* Delete operation.
|
|
24
|
+
*/
|
|
25
|
+
DELETE = "DELETE"
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A map of denied operations for a type or field value.
|
|
29
|
+
* */
|
|
30
|
+
export type DeniedOperations = Partial<Record<TypeOperation, boolean>>;
|
|
31
|
+
/**
|
|
32
|
+
* Voltra supported `TypeInfo` tags.
|
|
33
|
+
* */
|
|
34
|
+
export type SupportedTags = Partial<{
|
|
35
|
+
/**
|
|
36
|
+
* The human-readable label for the type.
|
|
37
|
+
* */
|
|
38
|
+
label: string;
|
|
39
|
+
/**
|
|
40
|
+
* Operations that will be denied at the type level.
|
|
41
|
+
* */
|
|
42
|
+
deniedOperations: DeniedOperations;
|
|
43
|
+
/**
|
|
44
|
+
* Whether a pagination UI should enable full paging or just expect cursor-based paging.
|
|
45
|
+
* */
|
|
46
|
+
fullPaging: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Whether this type will be persisted in a storage solution.
|
|
49
|
+
* */
|
|
50
|
+
persisted: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Voltra supported `TypeInfoField` tags.
|
|
54
|
+
* */
|
|
55
|
+
export type SupportedFieldTags = Partial<{
|
|
56
|
+
/**
|
|
57
|
+
* Is this field the primary (uniquely identifying) field for the type?
|
|
58
|
+
* */
|
|
59
|
+
primaryField: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* The human-readable label for the field.
|
|
62
|
+
* */
|
|
63
|
+
label: string;
|
|
64
|
+
/**
|
|
65
|
+
* The format or "type" for the field inout.
|
|
66
|
+
* Example: "number", "email", "tel", etc.
|
|
67
|
+
* */
|
|
68
|
+
format: string;
|
|
69
|
+
/**
|
|
70
|
+
* Allows a custom entry in a select input.
|
|
71
|
+
* */
|
|
72
|
+
allowCustomSelection: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* A custom type name used to process the field value with custom validators and/or other custom application features.
|
|
75
|
+
* */
|
|
76
|
+
customType: string;
|
|
77
|
+
/**
|
|
78
|
+
* Whether this field is displayed in forms, information displays, lists, etc.
|
|
79
|
+
* */
|
|
80
|
+
hidden: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Whether a pagination UI should enable full paging or just expect cursor-based paging.
|
|
83
|
+
* NOTE: This is only used when the field has type reference.
|
|
84
|
+
* */
|
|
85
|
+
fullPaging: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* A set of constraints for the field value.
|
|
88
|
+
* */
|
|
89
|
+
constraints: Partial<{
|
|
90
|
+
/**
|
|
91
|
+
* The default value for the field.
|
|
92
|
+
*/
|
|
93
|
+
defaultValue: any;
|
|
94
|
+
/**
|
|
95
|
+
* The step increment for the field.
|
|
96
|
+
* */
|
|
97
|
+
step: number;
|
|
98
|
+
/**
|
|
99
|
+
* The minimum value for the field.
|
|
100
|
+
* */
|
|
101
|
+
min: number;
|
|
102
|
+
/**
|
|
103
|
+
* The maximum value for the field.
|
|
104
|
+
* */
|
|
105
|
+
max: number;
|
|
106
|
+
/**
|
|
107
|
+
* A regex pattern used to validate the field value.
|
|
108
|
+
* */
|
|
109
|
+
pattern: string;
|
|
110
|
+
}>;
|
|
111
|
+
/**
|
|
112
|
+
* Operations that will be denied at the field level.
|
|
113
|
+
* */
|
|
114
|
+
deniedOperations: DeniedOperations;
|
|
115
|
+
/**
|
|
116
|
+
* Validation behavior overrides for field processing.
|
|
117
|
+
* */
|
|
118
|
+
validation: Partial<{
|
|
119
|
+
/**
|
|
120
|
+
* Whether hidden fields should be validated.
|
|
121
|
+
* Defaults to false for data-item validation flows that opt into field-level behavior.
|
|
122
|
+
*/
|
|
123
|
+
validateHidden: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Whether readonly fields should enforce required-value checks.
|
|
126
|
+
* Defaults to false for data-item validation flows that opt into field-level behavior.
|
|
127
|
+
*/
|
|
128
|
+
validateReadonly: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Whether empty arrays are accepted for required array fields.
|
|
131
|
+
* Defaults to false.
|
|
132
|
+
*/
|
|
133
|
+
emptyArrayIsValid: boolean;
|
|
134
|
+
}>;
|
|
135
|
+
/**
|
|
136
|
+
* Indexing behavior flags used to derive ORM indexing configuration.
|
|
137
|
+
* */
|
|
138
|
+
indexed: Partial<{
|
|
139
|
+
/**
|
|
140
|
+
* Whether this field should be added to the type's default full-text index fields.
|
|
141
|
+
* */
|
|
142
|
+
fullText: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Whether this field should be added to the type's structured indexed field list.
|
|
145
|
+
* */
|
|
146
|
+
structured: boolean;
|
|
147
|
+
}>;
|
|
148
|
+
}>;
|
|
149
|
+
/**
|
|
150
|
+
* The set of acceptable literal value types.
|
|
151
|
+
*/
|
|
152
|
+
export type LiteralValue = string | number | boolean | null;
|
|
153
|
+
/**
|
|
154
|
+
* The set of acceptable type keywords.
|
|
155
|
+
*/
|
|
156
|
+
export type TypeKeyword = "string" | "number" | "boolean";
|
|
157
|
+
/**
|
|
158
|
+
* Information about a field in a type definition.
|
|
159
|
+
*/
|
|
160
|
+
export type TypeInfoField = {
|
|
161
|
+
/**
|
|
162
|
+
* Scalar type keyword for the field.
|
|
163
|
+
*/
|
|
164
|
+
type: TypeKeyword;
|
|
165
|
+
/**
|
|
166
|
+
* Referenced TypeInfo type name, when relational.
|
|
167
|
+
*/
|
|
168
|
+
typeReference?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Whether the field is an array.
|
|
171
|
+
*/
|
|
172
|
+
array: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Whether the field is read-only.
|
|
175
|
+
*/
|
|
176
|
+
readonly: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Whether the field is optional.
|
|
179
|
+
*/
|
|
180
|
+
optional: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Allowed literal values for the field.
|
|
183
|
+
*/
|
|
184
|
+
possibleValues?: LiteralValue[];
|
|
185
|
+
/**
|
|
186
|
+
* Optional field tags and constraints.
|
|
187
|
+
*/
|
|
188
|
+
tags?: SupportedFieldTags;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Information about a type definition.
|
|
192
|
+
*
|
|
193
|
+
* @category TypeInfo
|
|
194
|
+
*/
|
|
195
|
+
export type TypeInfo = {
|
|
196
|
+
/**
|
|
197
|
+
* Primary field name for the type.
|
|
198
|
+
*/
|
|
199
|
+
primaryField?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Map of field names to field definitions.
|
|
202
|
+
*/
|
|
203
|
+
fields?: Record<string, TypeInfoField>;
|
|
204
|
+
/**
|
|
205
|
+
* Optional type-level tags.
|
|
206
|
+
*/
|
|
207
|
+
tags?: SupportedTags;
|
|
208
|
+
/**
|
|
209
|
+
* Field name groupings for union type definitions.
|
|
210
|
+
*/
|
|
211
|
+
unionFieldSets?: string[][];
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* A map of type information maps.
|
|
215
|
+
*
|
|
216
|
+
* @category TypeInfo
|
|
217
|
+
*/
|
|
218
|
+
export type TypeInfoMap = Record<string, TypeInfo>;
|
|
219
|
+
/**
|
|
220
|
+
* The necessary information to use a {@link TypeInfo} with the entire {@link TypeInfoMap} containing it.
|
|
221
|
+
* */
|
|
222
|
+
export type TypeInfoPack = {
|
|
223
|
+
/**
|
|
224
|
+
* Entry type name to resolve.
|
|
225
|
+
*/
|
|
226
|
+
entryTypeName: string;
|
|
227
|
+
/**
|
|
228
|
+
* Type info map containing the entry type.
|
|
229
|
+
*/
|
|
230
|
+
typeInfoMap: TypeInfoMap;
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* An actual data item described by type info.
|
|
234
|
+
* */
|
|
235
|
+
export type TypeInfoDataItem = Record<string, LiteralValue | LiteralValue[]>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field-selection helpers for shaping TypeInfo data items.
|
|
3
|
+
*/
|
|
4
|
+
import { TypeInfo, TypeInfoDataItem } from "./TypeInfo";
|
|
5
|
+
/**
|
|
6
|
+
* Remove all fields, from a list of selected fields, that are not in the type info.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam ItemType - Data item shape for field selection.
|
|
9
|
+
* @param typeInfo - Type info describing available fields.
|
|
10
|
+
* @param selectedFields - Fields to filter.
|
|
11
|
+
* @returns Filtered list of selected fields.
|
|
12
|
+
* */
|
|
13
|
+
export declare const removeNonexistentFieldsFromSelectedFields: <ItemType extends TypeInfoDataItem>(typeInfo?: TypeInfo, selectedFields?: (keyof ItemType)[]) => (keyof ItemType)[] | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Remove all fields, from a list of selected fields, that are a type reference.
|
|
16
|
+
*
|
|
17
|
+
* @typeParam ItemType - Data item shape for field selection.
|
|
18
|
+
* @param typeInfo - Type info describing available fields.
|
|
19
|
+
* @param selectedFields - Fields to filter.
|
|
20
|
+
* @returns Filtered list of selected fields.
|
|
21
|
+
* */
|
|
22
|
+
export declare const removeTypeReferenceFieldsFromSelectedFields: <ItemType>(typeInfo?: TypeInfo, selectedFields?: (keyof ItemType)[]) => (keyof ItemType)[] | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Remove all fields, from a data item, that are a type reference.
|
|
25
|
+
*
|
|
26
|
+
* @param typeInfo - Type info describing available fields.
|
|
27
|
+
* @param dataItem - Data item to filter.
|
|
28
|
+
* @returns Filtered data item.
|
|
29
|
+
* */
|
|
30
|
+
export declare const removeTypeReferenceFieldsFromDataItem: (typeInfo?: TypeInfo, dataItem?: Partial<TypeInfoDataItem>) => Partial<TypeInfoDataItem>;
|
|
31
|
+
/**
|
|
32
|
+
* Remove all fields, from a data item, that are not in the type info.
|
|
33
|
+
*
|
|
34
|
+
* @param typeInfo - Type info describing available fields.
|
|
35
|
+
* @param dataItem - Data item to filter.
|
|
36
|
+
* @returns Filtered data item.
|
|
37
|
+
* */
|
|
38
|
+
export declare const removeNonexistentFieldsFromDataItem: (typeInfo?: TypeInfo, dataItem?: Partial<TypeInfoDataItem>) => Partial<TypeInfoDataItem>;
|
|
39
|
+
/**
|
|
40
|
+
* Remove all fields, from a data item, that are not selected.
|
|
41
|
+
*
|
|
42
|
+
* @typeParam ItemType - Data item shape for field selection.
|
|
43
|
+
* @param dataItem - Data item to filter.
|
|
44
|
+
* @param selectedFields - Fields to include.
|
|
45
|
+
* @returns Filtered data item.
|
|
46
|
+
* */
|
|
47
|
+
export declare const removeUnselectedFieldsFromDataItem: <ItemType extends TypeInfoDataItem>(dataItem?: Partial<ItemType>, selectedFields?: (keyof ItemType)[]) => Partial<ItemType>;
|