@resistdesign/voltra 3.0.0-alpha.3 → 3.0.0-alpha.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/README.md +75 -0
- package/SearchTypes-DjN6YQzE.d.ts +577 -0
- package/Types-C7XjUjoF.d.ts +240 -0
- package/Validation-CFP59oIP.d.ts +226 -0
- package/api/index.d.ts +6 -0
- package/api/index.js +7968 -0
- package/app/index.d.ts +5 -0
- package/app/index.js +810 -0
- package/common/Testing/CLI.js +432 -0
- package/common/index.d.ts +4 -0
- package/common/index.js +1760 -0
- package/iac/index.d.ts +2 -0
- package/iac/index.js +1661 -0
- package/iac/packs/index.d.ts +1 -0
- package/iac/packs/index.js +1620 -0
- package/index-BkFZlfit.d.ts +112 -0
- package/index-C3-iD9Mh.d.ts +690 -0
- package/index-DZ2BB4iX.d.ts +5357 -0
- package/{src/iac/types/IaCTypes.d.ts → index-DcvJOZ_c.d.ts} +1018 -23
- package/index-IokxSNxm.d.ts +745 -0
- package/index.d.ts +13 -0
- package/index.js +10973 -0
- package/package.json +40 -41
- package/src/api/DataAccessControl.d.ts +0 -85
- package/src/api/DataAccessControl.js +0 -159
- package/src/api/ORM/DACUtils.d.ts +0 -60
- package/src/api/ORM/DACUtils.js +0 -197
- package/src/api/ORM/ListItemUtils.d.ts +0 -7
- package/src/api/ORM/ListItemUtils.js +0 -22
- package/src/api/ORM/ORMRouteMap.d.ts +0 -19
- package/src/api/ORM/ORMRouteMap.js +0 -82
- package/src/api/ORM/TypeInfoORMService.d.ts +0 -103
- package/src/api/ORM/TypeInfoORMService.js +0 -581
- package/src/api/ORM/drivers/DynamoDBDataItemDBDriver/ConfigTypes.d.ts +0 -63
- package/src/api/ORM/drivers/DynamoDBDataItemDBDriver/ConfigTypes.js +0 -2
- package/src/api/ORM/drivers/DynamoDBDataItemDBDriver.d.ts +0 -36
- package/src/api/ORM/drivers/DynamoDBDataItemDBDriver.js +0 -282
- package/src/api/ORM/drivers/S3FileItemDBDriver/ConfigTypes.d.ts +0 -90
- package/src/api/ORM/drivers/S3FileItemDBDriver/ConfigTypes.js +0 -2
- package/src/api/ORM/drivers/S3FileItemDBDriver/S3FileDriver.d.ts +0 -45
- package/src/api/ORM/drivers/S3FileItemDBDriver/S3FileDriver.js +0 -127
- package/src/api/ORM/drivers/S3FileItemDBDriver.d.ts +0 -44
- package/src/api/ORM/drivers/S3FileItemDBDriver.js +0 -182
- package/src/api/ORM/drivers/common/SupportedTypeInfoORMDBDrivers.d.ts +0 -12
- package/src/api/ORM/drivers/common/SupportedTypeInfoORMDBDrivers.js +0 -20
- package/src/api/ORM/drivers/common/Types.d.ts +0 -77
- package/src/api/ORM/drivers/common/Types.js +0 -14
- package/src/api/ORM/drivers/common/index.d.ts +0 -2
- package/src/api/ORM/drivers/common/index.js +0 -18
- package/src/api/ORM/drivers/index.d.ts +0 -3
- package/src/api/ORM/drivers/index.js +0 -19
- package/src/api/ORM/index.d.ts +0 -4
- package/src/api/ORM/index.js +0 -43
- package/src/api/Router/AWS.d.ts +0 -26
- package/src/api/Router/AWS.js +0 -76
- package/src/api/Router/Auth.d.ts +0 -2
- package/src/api/Router/Auth.js +0 -9
- package/src/api/Router/CORS.d.ts +0 -6
- package/src/api/Router/CORS.js +0 -27
- package/src/api/Router/Types.d.ts +0 -71
- package/src/api/Router/Types.js +0 -2
- package/src/api/Router/index.d.ts +0 -18
- package/src/api/Router/index.js +0 -145
- package/src/api/index.d.ts +0 -3
- package/src/api/index.js +0 -39
- package/src/app/index.d.ts +0 -1
- package/src/app/index.js +0 -37
- package/src/app/utils/ApplicationState.d.ts +0 -52
- package/src/app/utils/ApplicationState.js +0 -86
- package/src/app/utils/ApplicationStateLoader.d.ts +0 -46
- package/src/app/utils/ApplicationStateLoader.js +0 -57
- package/src/app/utils/Controller.d.ts +0 -4
- package/src/app/utils/Controller.js +0 -47
- package/src/app/utils/Debug.d.ts +0 -4
- package/src/app/utils/Debug.js +0 -30
- package/src/app/utils/EasyLayout.d.ts +0 -49
- package/src/app/utils/EasyLayout.js +0 -122
- package/src/app/utils/Route.d.ts +0 -28
- package/src/app/utils/Route.js +0 -102
- package/src/app/utils/Service.d.ts +0 -12
- package/src/app/utils/Service.js +0 -34
- package/src/app/utils/TypeInfoORMAPIUtils.d.ts +0 -20
- package/src/app/utils/TypeInfoORMAPIUtils.js +0 -62
- package/src/app/utils/TypeInfoORMClient.d.ts +0 -24
- package/src/app/utils/TypeInfoORMClient.js +0 -69
- package/src/app/utils/index.d.ts +0 -8
- package/src/app/utils/index.js +0 -24
- package/src/common/CommandLine/collectRequiredEnvironmentVariables.d.ts +0 -1
- package/src/common/CommandLine/collectRequiredEnvironmentVariables.js +0 -16
- package/src/common/HelperTypes.d.ts +0 -3
- package/src/common/HelperTypes.js +0 -2
- package/src/common/IdGeneration/getSimpleId.d.ts +0 -4
- package/src/common/IdGeneration/getSimpleId.js +0 -16
- package/src/common/IdGeneration/index.d.ts +0 -1
- package/src/common/IdGeneration/index.js +0 -17
- package/src/common/ItemRelationshipInfoTypes.d.ts +0 -46
- package/src/common/ItemRelationshipInfoTypes.js +0 -20
- package/src/common/ItemRelationships/ItemRelationshipValidation.d.ts +0 -10
- package/src/common/ItemRelationships/ItemRelationshipValidation.js +0 -43
- package/src/common/ItemRelationships/index.d.ts +0 -1
- package/src/common/ItemRelationships/index.js +0 -17
- package/src/common/Logging/Utils.d.ts +0 -10
- package/src/common/Logging/Utils.js +0 -33
- package/src/common/Logging/index.d.ts +0 -1
- package/src/common/Logging/index.js +0 -17
- package/src/common/Routing.d.ts +0 -25
- package/src/common/Routing.js +0 -102
- package/src/common/SearchTypes.d.ts +0 -98
- package/src/common/SearchTypes.js +0 -39
- package/src/common/SearchUtils.d.ts +0 -22
- package/src/common/SearchUtils.js +0 -134
- package/src/common/SearchValidation.d.ts +0 -17
- package/src/common/SearchValidation.js +0 -90
- package/src/common/Storyboarding/Types.d.ts +0 -25
- package/src/common/Storyboarding/Types.js +0 -2
- package/src/common/StringTransformers.d.ts +0 -17
- package/src/common/StringTransformers.js +0 -36
- package/src/common/Testing/CLI.d.ts +0 -2
- package/src/common/Testing/CLI.js +0 -56
- package/src/common/Testing/Types.d.ts +0 -117
- package/src/common/Testing/Types.js +0 -19
- package/src/common/Testing/Utils.d.ts +0 -48
- package/src/common/Testing/Utils.js +0 -334
- package/src/common/Testing/index.d.ts +0 -2
- package/src/common/Testing/index.js +0 -18
- package/src/common/TypeInfoDataItemUtils.d.ts +0 -10
- package/src/common/TypeInfoDataItemUtils.js +0 -55
- package/src/common/TypeInfoORM/Types.d.ts +0 -76
- package/src/common/TypeInfoORM/Types.js +0 -55
- package/src/common/TypeInfoORM/index.d.ts +0 -1
- package/src/common/TypeInfoORM/index.js +0 -17
- package/src/common/TypeParsing/Constants.d.ts +0 -1
- package/src/common/TypeParsing/Constants.js +0 -4
- package/src/common/TypeParsing/ParsingUtils/Constants.d.ts +0 -5
- package/src/common/TypeParsing/ParsingUtils/Constants.js +0 -8
- package/src/common/TypeParsing/ParsingUtils/checkType.d.ts +0 -8
- package/src/common/TypeParsing/ParsingUtils/checkType.js +0 -46
- package/src/common/TypeParsing/ParsingUtils/checkUnionType.d.ts +0 -6
- package/src/common/TypeParsing/ParsingUtils/checkUnionType.js +0 -15
- package/src/common/TypeParsing/ParsingUtils/extractCommentTags.d.ts +0 -2
- package/src/common/TypeParsing/ParsingUtils/extractCommentTags.js +0 -105
- package/src/common/TypeParsing/ParsingUtils/extractLiteralValues.d.ts +0 -6
- package/src/common/TypeParsing/ParsingUtils/extractLiteralValues.js +0 -42
- package/src/common/TypeParsing/ParsingUtils/extractTypeDetails.d.ts +0 -8
- package/src/common/TypeParsing/ParsingUtils/extractTypeDetails.js +0 -14
- package/src/common/TypeParsing/ParsingUtils/getPrimaryFieldForTypeInfo.d.ts +0 -5
- package/src/common/TypeParsing/ParsingUtils/getPrimaryFieldForTypeInfo.js +0 -27
- package/src/common/TypeParsing/ParsingUtils/getTypeInfo.d.ts +0 -3
- package/src/common/TypeParsing/ParsingUtils/getTypeInfo.js +0 -27
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoField.d.ts +0 -3
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoField.js +0 -44
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromAliasType.d.ts +0 -4
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromAliasType.js +0 -28
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromFieldFilter.d.ts +0 -4
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromFieldFilter.js +0 -105
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromTypeAlias.d.ts +0 -4
- package/src/common/TypeParsing/ParsingUtils/getTypeInfoFromTypeAlias.js +0 -20
- package/src/common/TypeParsing/ParsingUtils/getTypeKeyword.d.ts +0 -3
- package/src/common/TypeParsing/ParsingUtils/getTypeKeyword.js +0 -17
- package/src/common/TypeParsing/ParsingUtils/getUnionOrIntersectionTypeInfo.d.ts +0 -4
- package/src/common/TypeParsing/ParsingUtils/getUnionOrIntersectionTypeInfo.js +0 -49
- package/src/common/TypeParsing/ParsingUtils/getUnionOrLiteralStringValues.d.ts +0 -2
- package/src/common/TypeParsing/ParsingUtils/getUnionOrLiteralStringValues.js +0 -24
- package/src/common/TypeParsing/TypeInfo.d.ts +0 -142
- package/src/common/TypeParsing/TypeInfo.js +0 -13
- package/src/common/TypeParsing/TypeMapping.d.ts +0 -9
- package/src/common/TypeParsing/TypeMapping.js +0 -32
- package/src/common/TypeParsing/TypeParsing.d.ts +0 -5
- package/src/common/TypeParsing/TypeParsing.js +0 -39
- package/src/common/TypeParsing/Utils.d.ts +0 -21
- package/src/common/TypeParsing/Utils.js +0 -94
- package/src/common/TypeParsing/Validation.d.ts +0 -92
- package/src/common/TypeParsing/Validation.js +0 -340
- package/src/common/TypeParsing/index.d.ts +0 -5
- package/src/common/TypeParsing/index.js +0 -44
- package/src/common/index.d.ts +0 -11
- package/src/common/index.js +0 -47
- package/src/iac/SimpleCFT.d.ts +0 -48
- package/src/iac/SimpleCFT.js +0 -82
- package/src/iac/index.d.ts +0 -9
- package/src/iac/index.js +0 -48
- package/src/iac/packs/auth/user-management.d.ts +0 -14
- package/src/iac/packs/auth/user-management.js +0 -302
- package/src/iac/packs/auth.d.ts +0 -19
- package/src/iac/packs/auth.js +0 -47
- package/src/iac/packs/build/utils.d.ts +0 -100
- package/src/iac/packs/build/utils.js +0 -23
- package/src/iac/packs/build.d.ts +0 -29
- package/src/iac/packs/build.js +0 -217
- package/src/iac/packs/cdn.d.ts +0 -12
- package/src/iac/packs/cdn.js +0 -126
- package/src/iac/packs/cloud-function.d.ts +0 -17
- package/src/iac/packs/cloud-function.js +0 -69
- package/src/iac/packs/database.d.ts +0 -29
- package/src/iac/packs/database.js +0 -27
- package/src/iac/packs/dns.d.ts +0 -13
- package/src/iac/packs/dns.js +0 -26
- package/src/iac/packs/file-storage.d.ts +0 -14
- package/src/iac/packs/file-storage.js +0 -71
- package/src/iac/packs/gateway.d.ts +0 -27
- package/src/iac/packs/gateway.js +0 -342
- package/src/iac/packs/index.d.ts +0 -11
- package/src/iac/packs/index.js +0 -27
- package/src/iac/packs/repo.d.ts +0 -10
- package/src/iac/packs/repo.js +0 -34
- package/src/iac/packs/ssl-certificate.d.ts +0 -10
- package/src/iac/packs/ssl-certificate.js +0 -36
- package/src/iac/types/CloudFormationResourceSpecification.d.ts +0 -2
- package/src/iac/types/Constants.d.ts +0 -9
- package/src/iac/types/Constants.js +0 -20
- package/src/iac/types/IaCTypes.js +0 -14
- package/src/iac/types/Renderers.d.ts +0 -12
- package/src/iac/types/Renderers.js +0 -112
- package/src/iac/types/Types.d.ts +0 -37
- package/src/iac/types/Types.js +0 -2
- package/src/iac/types/Utils.d.ts +0 -2
- package/src/iac/types/Utils.js +0 -60
- package/src/iac/types/generate.d.ts +0 -1
- package/src/iac/types/generate.js +0 -31
- package/src/iac/utils/index.d.ts +0 -36
- package/src/iac/utils/index.js +0 -105
- package/src/iac/utils/patch-utils.d.ts +0 -15
- package/src/iac/utils/patch-utils.js +0 -62
- package/src/index.d.ts +0 -178
- package/src/index.js +0 -214
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A set of possible operations for a type or field value.
|
|
3
|
-
* */
|
|
4
|
-
export declare enum TypeOperation {
|
|
5
|
-
CREATE = "CREATE",
|
|
6
|
-
READ = "READ",
|
|
7
|
-
UPDATE = "UPDATE",
|
|
8
|
-
DELETE = "DELETE"
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* A map of denied operations for a type or field value.
|
|
12
|
-
* */
|
|
13
|
-
export type DeniedOperations = Partial<Record<TypeOperation, boolean>>;
|
|
14
|
-
/**
|
|
15
|
-
* Voltra supported `TypeInfo` tags.
|
|
16
|
-
* */
|
|
17
|
-
export type SupportedTags = Partial<{
|
|
18
|
-
/**
|
|
19
|
-
* The human-readable label for the type.
|
|
20
|
-
* */
|
|
21
|
-
label: string;
|
|
22
|
-
/**
|
|
23
|
-
* Operations that will be denied at the type level.
|
|
24
|
-
* */
|
|
25
|
-
deniedOperations: DeniedOperations;
|
|
26
|
-
/**
|
|
27
|
-
* Whether a pagination UI should enable full paging or just expect cursor-based paging.
|
|
28
|
-
* */
|
|
29
|
-
fullPaging: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Whether this type will be persisted in a storage solution.
|
|
32
|
-
* */
|
|
33
|
-
persisted: boolean;
|
|
34
|
-
}>;
|
|
35
|
-
/**
|
|
36
|
-
* Voltra supported `TypeInfoField` tags.
|
|
37
|
-
* */
|
|
38
|
-
export type SupportedFieldTags = Partial<{
|
|
39
|
-
/**
|
|
40
|
-
* Is this field the primary (uniquely identifying) field for the type?
|
|
41
|
-
* */
|
|
42
|
-
primaryField: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* The human-readable label for the field.
|
|
45
|
-
* */
|
|
46
|
-
label: string;
|
|
47
|
-
/**
|
|
48
|
-
* The format or "type" for the field inout.
|
|
49
|
-
* Example: "number", "email", "tel", etc.
|
|
50
|
-
* */
|
|
51
|
-
format: string;
|
|
52
|
-
/**
|
|
53
|
-
* Allows a custom entry in a select input.
|
|
54
|
-
* */
|
|
55
|
-
allowCustomSelection: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* A custom type name used to process the field value with custom validators and/or other custom application features.
|
|
58
|
-
* */
|
|
59
|
-
customType: string;
|
|
60
|
-
/**
|
|
61
|
-
* Whether this field is displayed in forms, information displays, lists, etc.
|
|
62
|
-
* */
|
|
63
|
-
hidden: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Whether a pagination UI should enable full paging or just expect cursor-based paging.
|
|
66
|
-
* NOTE: This is only used when the field has type reference.
|
|
67
|
-
* */
|
|
68
|
-
fullPaging: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* A set of constraints for the field value.
|
|
71
|
-
* */
|
|
72
|
-
constraints: Partial<{
|
|
73
|
-
/**
|
|
74
|
-
* The default value for the field.
|
|
75
|
-
*/
|
|
76
|
-
defaultValue: any;
|
|
77
|
-
/**
|
|
78
|
-
* The step increment for the field.
|
|
79
|
-
* */
|
|
80
|
-
step: number;
|
|
81
|
-
/**
|
|
82
|
-
* The minimum value for the field.
|
|
83
|
-
* */
|
|
84
|
-
min: number;
|
|
85
|
-
/**
|
|
86
|
-
* The maximum value for the field.
|
|
87
|
-
* */
|
|
88
|
-
max: number;
|
|
89
|
-
/**
|
|
90
|
-
* A regex pattern used to validate the field value.
|
|
91
|
-
* */
|
|
92
|
-
pattern: string;
|
|
93
|
-
}>;
|
|
94
|
-
/**
|
|
95
|
-
* Operations that will be denied at the field level.
|
|
96
|
-
* */
|
|
97
|
-
deniedOperations: DeniedOperations;
|
|
98
|
-
}>;
|
|
99
|
-
/**
|
|
100
|
-
* The set of acceptable literal value types.
|
|
101
|
-
*/
|
|
102
|
-
export type LiteralValue = string | number | boolean | null;
|
|
103
|
-
/**
|
|
104
|
-
* The set of acceptable type keywords.
|
|
105
|
-
*/
|
|
106
|
-
export type TypeKeyword = "string" | "number" | "boolean";
|
|
107
|
-
/**
|
|
108
|
-
* Information about a field in a type definition.
|
|
109
|
-
*/
|
|
110
|
-
export type TypeInfoField = {
|
|
111
|
-
type: TypeKeyword;
|
|
112
|
-
typeReference?: string;
|
|
113
|
-
array: boolean;
|
|
114
|
-
readonly: boolean;
|
|
115
|
-
optional: boolean;
|
|
116
|
-
possibleValues?: LiteralValue[];
|
|
117
|
-
tags?: SupportedFieldTags;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* Information about a type definition.
|
|
121
|
-
*/
|
|
122
|
-
export type TypeInfo = {
|
|
123
|
-
primaryField?: string;
|
|
124
|
-
fields?: Record<string, TypeInfoField>;
|
|
125
|
-
tags?: SupportedTags;
|
|
126
|
-
unionFieldSets?: string[][];
|
|
127
|
-
};
|
|
128
|
-
/**
|
|
129
|
-
* A map of type information maps.
|
|
130
|
-
*/
|
|
131
|
-
export type TypeInfoMap = Record<string, TypeInfo>;
|
|
132
|
-
/**
|
|
133
|
-
* The necessary information to use a {@link TypeInfo} with the entire {@link TypeInfoMap} containing it.
|
|
134
|
-
* */
|
|
135
|
-
export type TypeInfoPack = {
|
|
136
|
-
entryTypeName: string;
|
|
137
|
-
typeInfoMap: TypeInfoMap;
|
|
138
|
-
};
|
|
139
|
-
/**
|
|
140
|
-
* An actual data item described by type info.
|
|
141
|
-
* */
|
|
142
|
-
export type TypeInfoDataItem = Record<string, LiteralValue | LiteralValue[]>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TypeOperation = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* A set of possible operations for a type or field value.
|
|
6
|
-
* */
|
|
7
|
-
var TypeOperation;
|
|
8
|
-
(function (TypeOperation) {
|
|
9
|
-
TypeOperation["CREATE"] = "CREATE";
|
|
10
|
-
TypeOperation["READ"] = "READ";
|
|
11
|
-
TypeOperation["UPDATE"] = "UPDATE";
|
|
12
|
-
TypeOperation["DELETE"] = "DELETE";
|
|
13
|
-
})(TypeOperation || (exports.TypeOperation = TypeOperation = {}));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Node, TypeAliasDeclaration } from "typescript";
|
|
2
|
-
/**
|
|
3
|
-
* A map of type aliases in the TypeScript AST.
|
|
4
|
-
*/
|
|
5
|
-
export type TypeMap = Record<string, TypeAliasDeclaration>;
|
|
6
|
-
/**
|
|
7
|
-
* Converts a TypeScript AST to a map of type aliases.
|
|
8
|
-
*/
|
|
9
|
-
export declare const convertASTToMap: (node: Node, map?: Record<string, TypeAliasDeclaration>, parentName?: string) => TypeMap;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertASTToMap = void 0;
|
|
4
|
-
const typescript_1 = require("typescript");
|
|
5
|
-
/**
|
|
6
|
-
* Converts a TypeScript AST to a map of type aliases.
|
|
7
|
-
*/
|
|
8
|
-
const convertASTToMap = (node, map = {}, parentName) => {
|
|
9
|
-
node.forEachChild((child) => {
|
|
10
|
-
const { kind: childKind } = child;
|
|
11
|
-
if (childKind === typescript_1.SyntaxKind.ModuleDeclaration) {
|
|
12
|
-
const moduleNode = child;
|
|
13
|
-
const { name: moduleName } = moduleNode;
|
|
14
|
-
const textModuleName = moduleName.getText();
|
|
15
|
-
const fullModuleName = parentName
|
|
16
|
-
? `${parentName}.${textModuleName}`
|
|
17
|
-
: textModuleName;
|
|
18
|
-
(0, exports.convertASTToMap)(moduleNode, map, fullModuleName);
|
|
19
|
-
}
|
|
20
|
-
if (childKind === typescript_1.SyntaxKind.ModuleBlock) {
|
|
21
|
-
(0, exports.convertASTToMap)(child, map, parentName);
|
|
22
|
-
}
|
|
23
|
-
if (childKind === typescript_1.SyntaxKind.TypeAliasDeclaration) {
|
|
24
|
-
const typeAliasDec = child;
|
|
25
|
-
const { name: { text: typeName }, } = typeAliasDec;
|
|
26
|
-
const fullTypeName = parentName ? `${parentName}.${typeName}` : typeName;
|
|
27
|
-
map[fullTypeName] = typeAliasDec;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
return map;
|
|
31
|
-
};
|
|
32
|
-
exports.convertASTToMap = convertASTToMap;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTypeInfoMapFromTypeScript = void 0;
|
|
4
|
-
const typescript_1 = require("typescript");
|
|
5
|
-
const TypeMapping_1 = require("./TypeMapping");
|
|
6
|
-
const getTypeInfoFromTypeAlias_1 = require("./ParsingUtils/getTypeInfoFromTypeAlias");
|
|
7
|
-
const getPrimaryFieldForTypeInfo_1 = require("./ParsingUtils/getPrimaryFieldForTypeInfo");
|
|
8
|
-
/**
|
|
9
|
-
* Extracts type information from TypeScript content.
|
|
10
|
-
*/
|
|
11
|
-
const getTypeInfoMapFromTypeScript = (source) => {
|
|
12
|
-
const typeScriptNode = (0, typescript_1.createSourceFile)("x.ts", source, typescript_1.ScriptTarget.Latest, true);
|
|
13
|
-
const typeMap = (0, TypeMapping_1.convertASTToMap)(typeScriptNode, {});
|
|
14
|
-
const typeInfoMap = {};
|
|
15
|
-
for (const key in typeMap) {
|
|
16
|
-
const typeAliasDec = typeMap[key];
|
|
17
|
-
const { modifiers } = typeAliasDec;
|
|
18
|
-
let outputTypeInfo = false;
|
|
19
|
-
if (modifiers) {
|
|
20
|
-
modifiers.forEach((modifier) => {
|
|
21
|
-
const { kind } = modifier;
|
|
22
|
-
if (kind === typescript_1.SyntaxKind.ExportKeyword) {
|
|
23
|
-
outputTypeInfo = true;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
if (outputTypeInfo) {
|
|
28
|
-
const typeInfo = (0, getTypeInfoFromTypeAlias_1.getTypeInfoFromTypeAlias)(typeAliasDec, typeMap);
|
|
29
|
-
if (typeInfo) {
|
|
30
|
-
typeInfoMap[key] = {
|
|
31
|
-
...typeInfo,
|
|
32
|
-
primaryField: (0, getPrimaryFieldForTypeInfo_1.getPrimaryFieldForTypeInfo)(typeInfo),
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return typeInfoMap;
|
|
38
|
-
};
|
|
39
|
-
exports.getTypeInfoMapFromTypeScript = getTypeInfoMapFromTypeScript;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { TypeInfo, TypeInfoDataItem } from "./TypeInfo";
|
|
2
|
-
/**
|
|
3
|
-
* Remove all fields, from a list of selected fields, that are not in the type info.
|
|
4
|
-
* */
|
|
5
|
-
export declare const removeNonexistentFieldsFromSelectedFields: <ItemType extends TypeInfoDataItem>(typeInfo?: TypeInfo, selectedFields?: (keyof ItemType)[]) => (keyof ItemType)[] | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* Remove all fields, from a list of selected fields, that are a type reference.
|
|
8
|
-
* */
|
|
9
|
-
export declare const removeTypeReferenceFieldsFromSelectedFields: <ItemType>(typeInfo?: TypeInfo, selectedFields?: (keyof ItemType)[]) => (keyof ItemType)[] | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* Remove all fields, from a data item, that are a type reference.
|
|
12
|
-
* */
|
|
13
|
-
export declare const removeTypeReferenceFieldsFromDataItem: (typeInfo?: TypeInfo, dataItem?: Partial<TypeInfoDataItem>) => Partial<TypeInfoDataItem>;
|
|
14
|
-
/**
|
|
15
|
-
* Remove all fields, from a data item, that are not in the type info.
|
|
16
|
-
* */
|
|
17
|
-
export declare const removeNonexistentFieldsFromDataItem: (typeInfo?: TypeInfo, dataItem?: Partial<TypeInfoDataItem>) => Partial<TypeInfoDataItem>;
|
|
18
|
-
/**
|
|
19
|
-
* Remove all fields, from a data item, that are not selected.
|
|
20
|
-
* */
|
|
21
|
-
export declare const removeUnselectedFieldsFromDataItem: <ItemType extends TypeInfoDataItem>(dataItem?: Partial<ItemType>, selectedFields?: (keyof ItemType)[]) => Partial<ItemType>;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeUnselectedFieldsFromDataItem = exports.removeNonexistentFieldsFromDataItem = exports.removeTypeReferenceFieldsFromDataItem = exports.removeTypeReferenceFieldsFromSelectedFields = exports.removeNonexistentFieldsFromSelectedFields = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Remove all fields, from a list of selected fields, that are not in the type info.
|
|
6
|
-
* */
|
|
7
|
-
const removeNonexistentFieldsFromSelectedFields = (typeInfo = {}, selectedFields) => {
|
|
8
|
-
if (Array.isArray(selectedFields)) {
|
|
9
|
-
const { fields = {} } = typeInfo;
|
|
10
|
-
const cleanSelectFields = [];
|
|
11
|
-
for (const tIF in fields) {
|
|
12
|
-
if (selectedFields.includes(tIF)) {
|
|
13
|
-
cleanSelectFields.push(tIF);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return cleanSelectFields;
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
return selectedFields;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
exports.removeNonexistentFieldsFromSelectedFields = removeNonexistentFieldsFromSelectedFields;
|
|
23
|
-
/**
|
|
24
|
-
* Remove all fields, from a list of selected fields, that are a type reference.
|
|
25
|
-
* */
|
|
26
|
-
const removeTypeReferenceFieldsFromSelectedFields = (typeInfo = {}, selectedFields) => {
|
|
27
|
-
if (Array.isArray(selectedFields)) {
|
|
28
|
-
const { fields = {} } = typeInfo;
|
|
29
|
-
const cleanSelectFields = [];
|
|
30
|
-
for (const tIF in fields) {
|
|
31
|
-
const { typeReference } = fields[tIF];
|
|
32
|
-
if (typeof typeReference === "undefined" &&
|
|
33
|
-
selectedFields.includes(tIF)) {
|
|
34
|
-
cleanSelectFields.push(tIF);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return cleanSelectFields;
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
return selectedFields;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.removeTypeReferenceFieldsFromSelectedFields = removeTypeReferenceFieldsFromSelectedFields;
|
|
44
|
-
/**
|
|
45
|
-
* Remove all fields, from a data item, that are a type reference.
|
|
46
|
-
* */
|
|
47
|
-
const removeTypeReferenceFieldsFromDataItem = (typeInfo = {}, dataItem = {}) => {
|
|
48
|
-
const { fields = {} } = typeInfo;
|
|
49
|
-
const cleanItem = {};
|
|
50
|
-
for (const tIF in fields) {
|
|
51
|
-
const { typeReference } = fields[tIF];
|
|
52
|
-
if (typeof typeReference === "undefined" &&
|
|
53
|
-
typeof dataItem[tIF] !== "undefined") {
|
|
54
|
-
cleanItem[tIF] = dataItem[tIF];
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return cleanItem;
|
|
58
|
-
};
|
|
59
|
-
exports.removeTypeReferenceFieldsFromDataItem = removeTypeReferenceFieldsFromDataItem;
|
|
60
|
-
/**
|
|
61
|
-
* Remove all fields, from a data item, that are not in the type info.
|
|
62
|
-
* */
|
|
63
|
-
const removeNonexistentFieldsFromDataItem = (typeInfo = {}, dataItem = {}) => {
|
|
64
|
-
const { fields = {} } = typeInfo;
|
|
65
|
-
const cleanItem = {};
|
|
66
|
-
for (const tIF in dataItem) {
|
|
67
|
-
if (fields[tIF]) {
|
|
68
|
-
cleanItem[tIF] = dataItem[tIF];
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return cleanItem;
|
|
72
|
-
};
|
|
73
|
-
exports.removeNonexistentFieldsFromDataItem = removeNonexistentFieldsFromDataItem;
|
|
74
|
-
/**
|
|
75
|
-
* Remove all fields, from a data item, that are not selected.
|
|
76
|
-
* */
|
|
77
|
-
const removeUnselectedFieldsFromDataItem = (dataItem = {}, selectedFields) => {
|
|
78
|
-
if (!selectedFields) {
|
|
79
|
-
return dataItem;
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
const cleanInitialDataItem = typeof dataItem === "object" && dataItem !== null
|
|
83
|
-
? dataItem
|
|
84
|
-
: {};
|
|
85
|
-
const cleanItem = {};
|
|
86
|
-
for (const f in cleanInitialDataItem) {
|
|
87
|
-
if (selectedFields.includes(f)) {
|
|
88
|
-
cleanItem[f] = dataItem[f];
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return cleanItem;
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
exports.removeUnselectedFieldsFromDataItem = removeUnselectedFieldsFromDataItem;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { TypeInfo, TypeInfoField, TypeInfoMap, TypeKeyword, TypeOperation } from "./TypeInfo";
|
|
2
|
-
export declare enum RelationshipValidationType {
|
|
3
|
-
INCLUDE = "INCLUDE",
|
|
4
|
-
EXCLUDE = "EXCLUDE",
|
|
5
|
-
STRICT_EXCLUDE = "STRICT_EXCLUDE"
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* A custom type info field validator.
|
|
9
|
-
* */
|
|
10
|
-
export type CustomTypeInfoFieldValidator = (value: any) => boolean;
|
|
11
|
-
/**
|
|
12
|
-
* A map of custom type info field validators.
|
|
13
|
-
* */
|
|
14
|
-
export type CustomTypeInfoFieldValidatorMap = Record<string, CustomTypeInfoFieldValidator>;
|
|
15
|
-
/**
|
|
16
|
-
* A map of errors.
|
|
17
|
-
* */
|
|
18
|
-
export type ErrorMap = {
|
|
19
|
-
[key: string]: string[];
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* The validation results for type info fields.
|
|
23
|
-
*/
|
|
24
|
-
export type TypeInfoValidationResults = {
|
|
25
|
-
typeName: string | null;
|
|
26
|
-
valid: boolean;
|
|
27
|
-
error: string;
|
|
28
|
-
errorMap: ErrorMap;
|
|
29
|
-
};
|
|
30
|
-
export declare const INVALID_CUSTOM_TYPE = "INVALID_CUSTOM_TYPE";
|
|
31
|
-
export declare const PRIMITIVE_ERROR_MESSAGE_CONSTANTS: Record<TypeKeyword, string>;
|
|
32
|
-
export declare const ERROR_MESSAGE_CONSTANTS: {
|
|
33
|
-
MISSING: string;
|
|
34
|
-
INVALID_OPTION: string;
|
|
35
|
-
INVALID_FIELD: string;
|
|
36
|
-
RELATIONSHIP_VALUES_ARE_STRICTLY_EXCLUDED: string;
|
|
37
|
-
INVALID_TYPE: string;
|
|
38
|
-
NO_UNION_TYPE_MATCHED: string;
|
|
39
|
-
TYPE_DOES_NOT_EXIST: string;
|
|
40
|
-
INVALID_PATTERN: string;
|
|
41
|
-
VALUE_DOES_NOT_MATCH_PATTERN: string;
|
|
42
|
-
};
|
|
43
|
-
export declare const DENIED_TYPE_OPERATIONS: Record<TypeOperation, string>;
|
|
44
|
-
/**
|
|
45
|
-
* Validates a value against a pattern.
|
|
46
|
-
*
|
|
47
|
-
* `value` must be a string or not supplied.
|
|
48
|
-
* `pattern` must be a string or not supplied.
|
|
49
|
-
*
|
|
50
|
-
* If either are not supplied, the result is valid.
|
|
51
|
-
* */
|
|
52
|
-
export declare const validateValueMatchesPattern: (typeName: string, value?: any, pattern?: string) => TypeInfoValidationResults;
|
|
53
|
-
/**
|
|
54
|
-
* Gets the validity value.
|
|
55
|
-
*/
|
|
56
|
-
export declare const getValidityValue: (existing: boolean, pending: boolean) => boolean;
|
|
57
|
-
/**
|
|
58
|
-
* The validators for primitive values.
|
|
59
|
-
*/
|
|
60
|
-
export declare const TYPE_KEYWORD_VALIDATORS: Record<TypeKeyword, (value: any) => boolean>;
|
|
61
|
-
/**
|
|
62
|
-
* Checks if a value has a value.
|
|
63
|
-
*/
|
|
64
|
-
export declare const hasValue: (value: any) => boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Validates a primitive value.
|
|
67
|
-
*/
|
|
68
|
-
export declare const validateKeywordType: (value: any, type: string) => boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Validates a custom type.
|
|
71
|
-
*/
|
|
72
|
-
export declare const validateCustomType: (value: any, customType?: string, customValidators?: CustomTypeInfoFieldValidatorMap) => boolean;
|
|
73
|
-
/**
|
|
74
|
-
* Validates a type info field value.
|
|
75
|
-
*/
|
|
76
|
-
export declare const validateTypeInfoFieldValue: (value: any, typeInfoField: TypeInfoField, typeInfoMap: TypeInfoMap, ignoreArray?: boolean, strict?: boolean, customValidators?: CustomTypeInfoFieldValidatorMap, typeOperation?: TypeOperation, relationshipValidationType?: RelationshipValidationType, itemIsPartial?: boolean) => TypeInfoValidationResults;
|
|
77
|
-
/**
|
|
78
|
-
* Validates an array of type info field values.
|
|
79
|
-
*/
|
|
80
|
-
export declare const validateArrayOfTypeInfoFieldValues: (values: any[] | undefined, typeInfoField: TypeInfoField, typeInfoMap: TypeInfoMap, strict?: boolean, customValidators?: CustomTypeInfoFieldValidatorMap, typeOperation?: TypeOperation, relationshipValidationType?: RelationshipValidationType, itemIsPartial?: boolean) => TypeInfoValidationResults;
|
|
81
|
-
/**
|
|
82
|
-
* Validates a type info field operation.
|
|
83
|
-
* */
|
|
84
|
-
export declare const validateTypeInfoFieldOperationAllowed: (fieldName: string, fieldOperation?: TypeOperation, typeInfoField?: TypeInfoField) => TypeInfoValidationResults;
|
|
85
|
-
/**
|
|
86
|
-
* Validates a type info operation.
|
|
87
|
-
* */
|
|
88
|
-
export declare const validateTypeOperationAllowed: (typeName: string, valueFields: string[], typeOperation: TypeOperation, typeInfo: TypeInfo) => TypeInfoValidationResults;
|
|
89
|
-
/**
|
|
90
|
-
* Validates a type info value.
|
|
91
|
-
*/
|
|
92
|
-
export declare const validateTypeInfoValue: (value: any, typeInfoFullName: string, typeInfoMap: TypeInfoMap, strict?: boolean, customValidators?: CustomTypeInfoFieldValidatorMap, typeOperation?: TypeOperation, relationshipValidationType?: RelationshipValidationType, itemIsPartial?: boolean) => TypeInfoValidationResults;
|