@resistdesign/voltra 3.0.0-alpha.2 → 3.0.0-alpha.21
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 +327 -7
- 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 +169 -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 +210 -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 +143 -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 +166 -0
- package/api/Indexing/structured/StructuredDdbBackend.d.ts +109 -0
- package/api/Indexing/structured/StructuredInMemoryBackend.d.ts +34 -0
- package/api/Indexing/structured/StructuredInMemoryIndex.d.ts +58 -0
- package/api/Indexing/structured/StructuredStringLike.d.ts +25 -0
- package/api/Indexing/structured/StructuredWriter.d.ts +61 -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 +55 -0
- package/api/ORM/TypeInfoORMService.d.ts +555 -0
- package/api/ORM/drivers/DynamoDBDataItemDBDriver/ConfigTypes.d.ts +229 -0
- package/api/ORM/drivers/DynamoDBDataItemDBDriver.d.ts +89 -0
- package/api/ORM/drivers/InMemoryDataItemDBDriver/ConfigTypes.d.ts +4 -0
- package/api/ORM/drivers/InMemoryDataItemDBDriver.d.ts +55 -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/{src/api → api}/ORM/drivers/S3FileItemDBDriver.d.ts +27 -0
- package/api/ORM/drivers/common/SupportedTypeInfoORMDBDrivers.d.ts +36 -0
- package/{src/api → api}/ORM/drivers/common/Types.d.ts +120 -0
- package/api/ORM/drivers/index.d.ts +7 -0
- package/api/ORM/index.d.ts +7 -0
- package/api/ORM/indexing/criteriaToStructuredWhere.d.ts +17 -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/{src/api → api}/Router/Types.d.ts +70 -4
- package/api/Router/index.d.ts +89 -0
- package/api/index.d.ts +68 -0
- package/api/index.js +9204 -0
- package/app/forms/Engine.d.ts +20 -0
- package/app/forms/core/createAutoField.d.ts +35 -0
- package/app/forms/core/createFormRenderer.d.ts +24 -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 +22 -0
- package/app/forms/core/resolveSuite.d.ts +14 -0
- package/app/forms/core/types.d.ts +153 -0
- package/app/forms/index.d.ts +9 -0
- package/app/forms/types.d.ts +156 -0
- package/app/helpers/styled.d.ts +3 -0
- package/app/index.d.ts +98 -0
- package/app/index.js +1386 -0
- package/{src/app → app}/utils/ApplicationState.d.ts +115 -0
- package/{src/app → app}/utils/ApplicationStateLoader.d.ts +40 -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 +148 -0
- package/app/utils/Route.d.ts +129 -0
- package/app/utils/RouteHistory.d.ts +26 -0
- package/app/utils/Service.d.ts +45 -0
- package/app/utils/TypeInfoORMAPIUtils.d.ts +94 -0
- package/app/utils/TypeInfoORMClient.d.ts +103 -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 +23 -0
- package/{src/common/TypeParsing → build}/TypeMapping.d.ts +8 -0
- package/build/TypeParsing.d.ts +10 -0
- package/build/index.d.ts +15 -0
- package/build/index.js +579 -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/{src/common → common}/ItemRelationshipInfoTypes.d.ts +19 -1
- package/common/ItemRelationships/ItemRelationshipValidation.d.ts +21 -0
- package/common/Logging/Utils.d.ts +19 -0
- package/common/Routing.d.ts +67 -0
- package/common/SearchTypes.d.ts +248 -0
- package/common/SearchUtils.d.ts +55 -0
- package/{src/common → common}/SearchValidation.d.ts +10 -0
- package/{src/common → common}/StringTransformers.d.ts +11 -0
- package/common/Testing/CLI.d.ts +6 -0
- package/common/Testing/CLI.js +432 -0
- package/{src/common → common}/Testing/Types.d.ts +103 -4
- package/{src/common → common}/Testing/Utils.d.ts +65 -1
- package/common/Testing/index.d.ts +8 -0
- package/common/TypeInfoDataItemUtils.d.ts +39 -0
- package/common/TypeInfoORM/Types.d.ts +342 -0
- package/common/TypeParsing/Constants.d.ts +4 -0
- package/{src/common → common}/TypeParsing/ParsingUtils/Constants.d.ts +3 -0
- package/{src/common → common}/TypeParsing/ParsingUtils/checkType.d.ts +6 -0
- package/{src/common → common}/TypeParsing/ParsingUtils/checkUnionType.d.ts +6 -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/{src/common → common}/TypeParsing/ParsingUtils/getTypeInfoField.d.ts +6 -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/{src/common → common}/TypeParsing/TypeInfo.d.ts +61 -1
- package/{src/common → common}/TypeParsing/Utils.d.ts +26 -0
- package/{src/common → common}/TypeParsing/Validation.d.ts +105 -0
- package/common/TypeParsing/index.d.ts +8 -0
- package/common/index.d.ts +50 -0
- package/common/index.js +413 -0
- package/{src/iac → iac}/SimpleCFT.d.ts +46 -2
- package/iac/index.d.ts +40 -0
- package/iac/index.js +258 -0
- package/iac/packs/auth/user-management.d.ts +80 -0
- package/iac/packs/auth.d.ts +86 -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/{src/iac → iac}/packs/database.d.ts +4 -1
- package/{src/iac → iac}/packs/dns.d.ts +22 -1
- package/iac/packs/file-storage.d.ts +46 -0
- package/iac/packs/gateway.d.ts +79 -0
- package/iac/packs/index.d.ts +60 -0
- package/iac/packs/index.js +1622 -0
- package/iac/packs/repo.d.ts +28 -0
- package/iac/packs/ssl-certificate.d.ts +28 -0
- package/{src/iac → iac}/types/Constants.d.ts +15 -0
- 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/{src/iac → iac}/utils/index.d.ts +56 -5
- package/iac/utils/patch-utils.d.ts +66 -0
- package/native/forms/createNativeFormRenderer.d.ts +21 -0
- package/native/forms/index.d.ts +8 -0
- package/native/forms/primitives/index.d.ts +48 -0
- package/native/forms/suite.d.ts +15 -0
- package/native/index.d.ts +15 -0
- package/native/index.js +1323 -0
- package/native/utils/EasyLayout.d.ts +88 -0
- package/native/utils/History.d.ts +113 -0
- package/native/utils/NativeRoute.d.ts +44 -0
- package/native/utils/Route.d.ts +50 -0
- package/native/utils/index.d.ts +11 -0
- package/package.json +87 -42
- package/web/forms/UI.d.ts +67 -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 +1297 -0
- package/web/utils/EasyLayout.d.ts +47 -0
- package/web/utils/Route.d.ts +20 -0
- package/web/utils/index.d.ts +7 -0
- 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.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.js +0 -14
- 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.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.js +0 -86
- 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.js +0 -17
- 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.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.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.js +0 -90
- package/src/common/Storyboarding/Types.d.ts +0 -25
- package/src/common/Storyboarding/Types.js +0 -2
- 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.js +0 -19
- 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.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.js +0 -8
- package/src/common/TypeParsing/ParsingUtils/checkType.js +0 -46
- 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.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.js +0 -13
- 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.js +0 -94
- 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.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 -113
- package/src/iac/packs/cloud-function.d.ts +0 -17
- package/src/iac/packs/cloud-function.js +0 -69
- package/src/iac/packs/database.js +0 -27
- 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/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.js +0 -31
- 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
- /package/{src/api → api}/ORM/drivers/common/index.d.ts +0 -0
- /package/{src/common → common}/IdGeneration/index.d.ts +0 -0
- /package/{src/common → common}/ItemRelationships/index.d.ts +0 -0
- /package/{src/common → common}/Logging/index.d.ts +0 -0
- /package/{src/common → common}/TypeInfoORM/index.d.ts +0 -0
- /package/{src/iac → iac}/types/CloudFormationResourceSpecification.d.ts +0 -0
- /package/{src/iac → iac}/types/IaCTypes.d.ts +0 -0
- /package/{src/iac → iac}/types/generate.d.ts +0 -0
package/build/index.js
ADDED
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
import { SyntaxKind, isLiteralTypeNode, isStringLiteral, isNumericLiteral, createSourceFile, ScriptTarget } from 'typescript';
|
|
2
|
+
|
|
3
|
+
// src/build/TypeMapping.ts
|
|
4
|
+
var convertASTToMap = (node, map = {}, parentName) => {
|
|
5
|
+
node.forEachChild((child) => {
|
|
6
|
+
const { kind: childKind } = child;
|
|
7
|
+
if (childKind === SyntaxKind.ModuleDeclaration) {
|
|
8
|
+
const moduleNode = child;
|
|
9
|
+
const { name: moduleName } = moduleNode;
|
|
10
|
+
const textModuleName = moduleName.getText();
|
|
11
|
+
const fullModuleName = parentName ? `${parentName}.${textModuleName}` : textModuleName;
|
|
12
|
+
convertASTToMap(moduleNode, map, fullModuleName);
|
|
13
|
+
}
|
|
14
|
+
if (childKind === SyntaxKind.ModuleBlock) {
|
|
15
|
+
convertASTToMap(child, map, parentName);
|
|
16
|
+
}
|
|
17
|
+
if (childKind === SyntaxKind.TypeAliasDeclaration) {
|
|
18
|
+
const typeAliasDec = child;
|
|
19
|
+
const {
|
|
20
|
+
name: { text: typeName }
|
|
21
|
+
} = typeAliasDec;
|
|
22
|
+
const fullTypeName = parentName ? `${parentName}.${typeName}` : typeName;
|
|
23
|
+
map[fullTypeName] = typeAliasDec;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return map;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// src/common/Routing.ts
|
|
30
|
+
var PATH_DELIMITER = "/";
|
|
31
|
+
var getPotentialJSONValue = (value) => {
|
|
32
|
+
try {
|
|
33
|
+
return JSON.parse(value);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var getPathArray = (path, delimiter = PATH_DELIMITER, filterEmptyOutput = false, filterEmptyInput = true, useJson = true, uriDecodeParts = true) => path.split(delimiter).filter(filterEmptyInput ? (p) => p !== "" : () => true).map(uriDecodeParts ? decodeURIComponent : (x) => x).map(useJson ? getPotentialJSONValue : (p) => p).filter(filterEmptyOutput ? (p) => p ?? false : () => true);
|
|
39
|
+
|
|
40
|
+
// src/common/TypeParsing/ParsingUtils/extractCommentTags.ts
|
|
41
|
+
var TAG_NAME_PATH_DELIMITER = ".";
|
|
42
|
+
var getFlatTagValue = (tagValue) => {
|
|
43
|
+
if (typeof tagValue === "undefined") {
|
|
44
|
+
return "";
|
|
45
|
+
} else if (Array.isArray(tagValue)) {
|
|
46
|
+
const valueNodeArray = tagValue;
|
|
47
|
+
const valueList = [];
|
|
48
|
+
for (let i = 0; i < valueNodeArray.length; i++) {
|
|
49
|
+
const { text } = valueNodeArray[i];
|
|
50
|
+
valueList.push(getFlatTagValue(text));
|
|
51
|
+
}
|
|
52
|
+
return valueList.join(" ");
|
|
53
|
+
} else {
|
|
54
|
+
return `${tagValue}`;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
var getTagNameAndValue = (tag) => {
|
|
58
|
+
let name = tag.tagName.text, value = getFlatTagValue(tag.comment);
|
|
59
|
+
if (value.startsWith(TAG_NAME_PATH_DELIMITER)) {
|
|
60
|
+
const extendedTagNameEndIndex = value.indexOf(" ");
|
|
61
|
+
const hasActualValue = extendedTagNameEndIndex !== -1;
|
|
62
|
+
name += hasActualValue ? value.slice(0, extendedTagNameEndIndex) : value;
|
|
63
|
+
value = hasActualValue ? value.slice(extendedTagNameEndIndex + 1) : "";
|
|
64
|
+
}
|
|
65
|
+
if (value === "") {
|
|
66
|
+
value = "true";
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
name,
|
|
70
|
+
value
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
var getObjectWithValueAppliedToPath = (path = [], value, baseObject) => {
|
|
74
|
+
let baseParentObject = void 0, currentParent = void 0;
|
|
75
|
+
if (path.length === 0) {
|
|
76
|
+
baseParentObject = value;
|
|
77
|
+
} else {
|
|
78
|
+
for (let i = 0; i < path.length; i++) {
|
|
79
|
+
const pathPart = path[i];
|
|
80
|
+
const cleanPathPart = typeof pathPart === "number" ? pathPart : `${typeof pathPart !== "undefined" ? pathPart : ""}`;
|
|
81
|
+
const isNum = typeof cleanPathPart === "number";
|
|
82
|
+
let newCurrentParent = void 0;
|
|
83
|
+
if (i === 0) {
|
|
84
|
+
if (!baseObject) {
|
|
85
|
+
baseParentObject = isNum ? [] : {};
|
|
86
|
+
} else {
|
|
87
|
+
baseParentObject = isNum ? [...Array.isArray(baseObject) ? baseObject : []] : {
|
|
88
|
+
...typeof baseObject === "object" ? baseObject : {}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
currentParent = baseParentObject;
|
|
92
|
+
}
|
|
93
|
+
if (i < path.length - 1) {
|
|
94
|
+
const existingNewCurrentParent = currentParent[cleanPathPart];
|
|
95
|
+
newCurrentParent = isNum ? [
|
|
96
|
+
...Array.isArray(existingNewCurrentParent) ? existingNewCurrentParent : []
|
|
97
|
+
] : {
|
|
98
|
+
...typeof existingNewCurrentParent === "object" ? existingNewCurrentParent : {}
|
|
99
|
+
};
|
|
100
|
+
currentParent[cleanPathPart] = newCurrentParent;
|
|
101
|
+
currentParent = newCurrentParent;
|
|
102
|
+
} else {
|
|
103
|
+
currentParent[cleanPathPart] = value;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return baseParentObject;
|
|
108
|
+
};
|
|
109
|
+
var extractCommentTags = (node) => {
|
|
110
|
+
const jsDocComments = node["jsDoc"];
|
|
111
|
+
let commentTags = {};
|
|
112
|
+
if (jsDocComments) {
|
|
113
|
+
jsDocComments.forEach((jsDoc) => {
|
|
114
|
+
const tags = jsDoc.tags;
|
|
115
|
+
if (tags) {
|
|
116
|
+
tags.forEach((tag) => {
|
|
117
|
+
const { name: tagName, value: tagValue } = getTagNameAndValue(tag);
|
|
118
|
+
const potentialJSONValue = getPotentialJSONValue(tagValue);
|
|
119
|
+
commentTags = getObjectWithValueAppliedToPath(
|
|
120
|
+
getPathArray(tagName, TAG_NAME_PATH_DELIMITER),
|
|
121
|
+
potentialJSONValue,
|
|
122
|
+
commentTags
|
|
123
|
+
);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return commentTags;
|
|
129
|
+
};
|
|
130
|
+
var extractLiteralValues = (node) => {
|
|
131
|
+
const literalValues = [];
|
|
132
|
+
let detectedTypeKeyword;
|
|
133
|
+
for (const type of node.types) {
|
|
134
|
+
if (isLiteralTypeNode(type)) {
|
|
135
|
+
const literal = type.literal;
|
|
136
|
+
if (isStringLiteral(literal)) {
|
|
137
|
+
if (!detectedTypeKeyword) detectedTypeKeyword = "string";
|
|
138
|
+
if (detectedTypeKeyword === "string") {
|
|
139
|
+
literalValues.push(literal.text);
|
|
140
|
+
}
|
|
141
|
+
} else if (isNumericLiteral(literal)) {
|
|
142
|
+
if (!detectedTypeKeyword) detectedTypeKeyword = "number";
|
|
143
|
+
if (detectedTypeKeyword === "number") {
|
|
144
|
+
literalValues.push(Number(literal.text));
|
|
145
|
+
}
|
|
146
|
+
} else if (literal.kind === SyntaxKind.TrueKeyword || literal.kind === SyntaxKind.FalseKeyword) {
|
|
147
|
+
if (!detectedTypeKeyword) detectedTypeKeyword = "boolean";
|
|
148
|
+
if (detectedTypeKeyword === "boolean") {
|
|
149
|
+
literalValues.push(literal.kind === SyntaxKind.TrueKeyword);
|
|
150
|
+
}
|
|
151
|
+
} else if (literal.kind === SyntaxKind.NullKeyword) {
|
|
152
|
+
literalValues.push(null);
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
return void 0;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return literalValues.length ? { values: literalValues, type: detectedTypeKeyword } : void 0;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
// src/common/TypeParsing/ParsingUtils/checkUnionType.ts
|
|
162
|
+
var checkUnionType = (unionType) => {
|
|
163
|
+
const extracted = extractLiteralValues(unionType);
|
|
164
|
+
let typeKeyword = "string";
|
|
165
|
+
let options;
|
|
166
|
+
if (extracted) {
|
|
167
|
+
options = extracted.values;
|
|
168
|
+
typeKeyword = extracted.type;
|
|
169
|
+
}
|
|
170
|
+
return { options: options || [], typeKeyword };
|
|
171
|
+
};
|
|
172
|
+
var getTypeKeyword = (node) => {
|
|
173
|
+
switch (node.kind) {
|
|
174
|
+
case SyntaxKind.StringKeyword:
|
|
175
|
+
return "string";
|
|
176
|
+
case SyntaxKind.NumberKeyword:
|
|
177
|
+
return "number";
|
|
178
|
+
case SyntaxKind.BooleanKeyword:
|
|
179
|
+
return "boolean";
|
|
180
|
+
default:
|
|
181
|
+
return "string";
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
// src/common/TypeParsing/ParsingUtils/checkType.ts
|
|
186
|
+
var checkType = (node) => {
|
|
187
|
+
let typeReference;
|
|
188
|
+
let isArray = false;
|
|
189
|
+
let typeKeyword;
|
|
190
|
+
let options;
|
|
191
|
+
if (node.kind === SyntaxKind.TypeReference) {
|
|
192
|
+
typeReference = node.typeName.getText();
|
|
193
|
+
typeKeyword = "string";
|
|
194
|
+
} else if (node.kind === SyntaxKind.ArrayType) {
|
|
195
|
+
isArray = true;
|
|
196
|
+
const elementType = node.elementType;
|
|
197
|
+
const {
|
|
198
|
+
typeReference: elementReference,
|
|
199
|
+
typeKeyword: elementKeyword,
|
|
200
|
+
options: elementOptions
|
|
201
|
+
} = checkType(elementType);
|
|
202
|
+
typeReference = elementReference;
|
|
203
|
+
typeKeyword = elementKeyword || "string";
|
|
204
|
+
options = elementOptions;
|
|
205
|
+
} else if (node.kind === SyntaxKind.UnionType) {
|
|
206
|
+
const { types: unionTypes } = node;
|
|
207
|
+
const { options: unionOptions, typeKeyword: unionTypeKeyword } = checkUnionType(node);
|
|
208
|
+
options = unionOptions;
|
|
209
|
+
typeKeyword = unionTypeKeyword;
|
|
210
|
+
if (!options) {
|
|
211
|
+
typeKeyword = getTypeKeyword(unionTypes[0]);
|
|
212
|
+
}
|
|
213
|
+
} else if (node.kind === SyntaxKind.ParenthesizedType) {
|
|
214
|
+
const {
|
|
215
|
+
typeReference: parenthesizedReference,
|
|
216
|
+
isArray: parenthesizedIsArray,
|
|
217
|
+
typeKeyword: parenthesizedKeyword,
|
|
218
|
+
options: parenthesizedOptions
|
|
219
|
+
} = checkType(node.type);
|
|
220
|
+
typeReference = parenthesizedReference;
|
|
221
|
+
isArray = !!parenthesizedIsArray;
|
|
222
|
+
typeKeyword = parenthesizedKeyword || "string";
|
|
223
|
+
options = parenthesizedOptions;
|
|
224
|
+
} else {
|
|
225
|
+
typeKeyword = getTypeKeyword(node);
|
|
226
|
+
}
|
|
227
|
+
return { typeReference, isArray, typeKeyword, options };
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
// src/common/TypeParsing/ParsingUtils/extractTypeDetails.ts
|
|
231
|
+
var extractTypeDetails = (type) => {
|
|
232
|
+
const { isArray, typeReference, options, typeKeyword } = checkType(type);
|
|
233
|
+
return {
|
|
234
|
+
type: typeKeyword || "string",
|
|
235
|
+
typeReference,
|
|
236
|
+
array: !!isArray,
|
|
237
|
+
options
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// src/common/TypeParsing/ParsingUtils/getTypeInfoField.ts
|
|
242
|
+
var getTypeInfoField = (propertySignature) => {
|
|
243
|
+
const { type, modifiers } = propertySignature;
|
|
244
|
+
const {
|
|
245
|
+
array,
|
|
246
|
+
typeReference,
|
|
247
|
+
type: typeKeyword,
|
|
248
|
+
options
|
|
249
|
+
} = type ? extractTypeDetails(type) : {
|
|
250
|
+
array: false,
|
|
251
|
+
typeReference: void 0,
|
|
252
|
+
type: "string",
|
|
253
|
+
options: void 0
|
|
254
|
+
};
|
|
255
|
+
const readonly = modifiers ? modifiers.some((modifier) => modifier.kind === SyntaxKind.ReadonlyKeyword) : false;
|
|
256
|
+
const optional = !!propertySignature.questionToken;
|
|
257
|
+
let tags = extractCommentTags(propertySignature);
|
|
258
|
+
if (readonly) {
|
|
259
|
+
const {
|
|
260
|
+
deniedOperations,
|
|
261
|
+
deniedOperations: { CREATE, UPDATE, DELETE } = {}
|
|
262
|
+
} = tags || {};
|
|
263
|
+
tags = {
|
|
264
|
+
...tags,
|
|
265
|
+
deniedOperations: {
|
|
266
|
+
...deniedOperations,
|
|
267
|
+
create: CREATE ?? true,
|
|
268
|
+
update: UPDATE ?? true,
|
|
269
|
+
delete: DELETE ?? true
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
return {
|
|
274
|
+
type: typeKeyword,
|
|
275
|
+
array,
|
|
276
|
+
readonly,
|
|
277
|
+
optional,
|
|
278
|
+
typeReference,
|
|
279
|
+
possibleValues: options,
|
|
280
|
+
tags
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
// src/common/TypeParsing/ParsingUtils/getTypeInfo.ts
|
|
285
|
+
var getTypeInfo = (typeLiteral) => {
|
|
286
|
+
const { members } = typeLiteral;
|
|
287
|
+
const tags = extractCommentTags(typeLiteral);
|
|
288
|
+
let fields = {};
|
|
289
|
+
for (const m of members) {
|
|
290
|
+
const { name, kind } = m;
|
|
291
|
+
if (name && kind === SyntaxKind.PropertySignature) {
|
|
292
|
+
const fieldName = name.getText();
|
|
293
|
+
const field = getTypeInfoField(m);
|
|
294
|
+
fields = {
|
|
295
|
+
...fields,
|
|
296
|
+
[fieldName]: field
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return {
|
|
301
|
+
fields,
|
|
302
|
+
tags
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
var getUnionOrIntersectionTypeInfo = (unionType, typeMap) => {
|
|
306
|
+
const { kind, types } = unionType;
|
|
307
|
+
const isUnion = kind === SyntaxKind.UnionType;
|
|
308
|
+
let typeInfo;
|
|
309
|
+
for (const t of types) {
|
|
310
|
+
const { kind: kind2 } = t;
|
|
311
|
+
let nextTypeInfo;
|
|
312
|
+
if (kind2 === SyntaxKind.TypeReference) {
|
|
313
|
+
const { typeName } = t;
|
|
314
|
+
const refNode = typeMap[typeName.getText()];
|
|
315
|
+
if (refNode) {
|
|
316
|
+
nextTypeInfo = getTypeInfoFromTypeAlias(refNode, typeMap);
|
|
317
|
+
}
|
|
318
|
+
} else if (kind2 === SyntaxKind.TypeLiteral) {
|
|
319
|
+
nextTypeInfo = getTypeInfo(t);
|
|
320
|
+
}
|
|
321
|
+
if (nextTypeInfo) {
|
|
322
|
+
const {
|
|
323
|
+
fields: existingFields = {},
|
|
324
|
+
unionFieldSets: existingFieldSets = []
|
|
325
|
+
} = typeInfo || {};
|
|
326
|
+
const { fields: nextFields, unionFieldSets: nextUnionFieldSets = [] } = nextTypeInfo;
|
|
327
|
+
if (isUnion && nextFields) {
|
|
328
|
+
const newUnionFieldSet = Object.keys(nextFields);
|
|
329
|
+
typeInfo = {
|
|
330
|
+
...typeInfo,
|
|
331
|
+
unionFieldSets: [
|
|
332
|
+
...existingFieldSets,
|
|
333
|
+
...nextUnionFieldSets,
|
|
334
|
+
newUnionFieldSet
|
|
335
|
+
]
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
typeInfo = {
|
|
339
|
+
...typeInfo,
|
|
340
|
+
fields: {
|
|
341
|
+
...existingFields,
|
|
342
|
+
...nextFields
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
return typeInfo;
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
// src/common/TypeParsing/ParsingUtils/Constants.ts
|
|
351
|
+
var FIELD_FILTERS = {
|
|
352
|
+
OMIT: "Omit",
|
|
353
|
+
PICK: "Pick",
|
|
354
|
+
EXCLUDE: "Exclude"
|
|
355
|
+
};
|
|
356
|
+
var getUnionOrLiteralStringValues = (node) => {
|
|
357
|
+
let values = [];
|
|
358
|
+
if (node) {
|
|
359
|
+
if (node.kind === SyntaxKind.LiteralType) {
|
|
360
|
+
const { literal } = node;
|
|
361
|
+
if (literal.kind === SyntaxKind.StringLiteral || literal.kind === SyntaxKind.NumericLiteral) {
|
|
362
|
+
const { text } = literal;
|
|
363
|
+
values = [text];
|
|
364
|
+
}
|
|
365
|
+
} else if (node.kind === SyntaxKind.UnionType) {
|
|
366
|
+
const { types } = node;
|
|
367
|
+
for (const type of types) {
|
|
368
|
+
values = [...values, ...getUnionOrLiteralStringValues(type)];
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return values;
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
// src/common/TypeParsing/ParsingUtils/getTypeInfoFromFieldFilter.ts
|
|
376
|
+
var getTypeInfoFromPickOmitFieldFilters = (typeNameStr, typeRef, typeMap) => {
|
|
377
|
+
const picking = typeNameStr === FIELD_FILTERS.PICK;
|
|
378
|
+
const omitTypeKind = typeRef.typeArguments?.[0].kind;
|
|
379
|
+
let typeInfo;
|
|
380
|
+
if (omitTypeKind === SyntaxKind.TypeReference && typeRef.typeArguments && typeRef.typeArguments[0].kind === SyntaxKind.TypeReference) {
|
|
381
|
+
const omitType = typeRef.typeArguments[0];
|
|
382
|
+
const omitTypeFields = typeRef.typeArguments[1];
|
|
383
|
+
const omitTypeName = omitType.typeName.getText();
|
|
384
|
+
const refNode = typeMap[omitTypeName];
|
|
385
|
+
if (refNode) {
|
|
386
|
+
const {
|
|
387
|
+
fields: existingFields = {},
|
|
388
|
+
unionFieldSets: existingUnionFieldSets,
|
|
389
|
+
...typeInfoOther
|
|
390
|
+
} = getTypeInfoFromTypeAlias(refNode, typeMap) || {};
|
|
391
|
+
const omitFieldNames = getUnionOrLiteralStringValues(omitTypeFields);
|
|
392
|
+
const cleanTypeInfoFields = Object.keys(
|
|
393
|
+
existingFields
|
|
394
|
+
).reduce(
|
|
395
|
+
(acc, key) => {
|
|
396
|
+
if (acc && (picking && omitFieldNames.includes(key) || !picking && !omitFieldNames.includes(key)) && existingFields[key]) {
|
|
397
|
+
acc[key] = existingFields[key];
|
|
398
|
+
}
|
|
399
|
+
return acc;
|
|
400
|
+
},
|
|
401
|
+
{}
|
|
402
|
+
);
|
|
403
|
+
const cleanUnionFieldSets = existingUnionFieldSets ? existingUnionFieldSets.map(
|
|
404
|
+
(fieldSet) => fieldSet.filter(
|
|
405
|
+
(field) => picking ? omitFieldNames.includes(field) : !omitFieldNames.includes(field)
|
|
406
|
+
)
|
|
407
|
+
) : void 0;
|
|
408
|
+
typeInfo = {
|
|
409
|
+
...typeInfoOther,
|
|
410
|
+
fields: cleanTypeInfoFields,
|
|
411
|
+
unionFieldSets: cleanUnionFieldSets
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return typeInfo;
|
|
416
|
+
};
|
|
417
|
+
var getTypeInfoFromExcludeFieldFilter = (typeNameStr, typeRef, typeMap) => {
|
|
418
|
+
const baseTypeKind = typeRef.typeArguments?.[0].kind;
|
|
419
|
+
const excludeTypeKind = typeRef.typeArguments?.[1].kind;
|
|
420
|
+
let typeInfo;
|
|
421
|
+
if (baseTypeKind === SyntaxKind.TypeReference && excludeTypeKind === SyntaxKind.TypeReference && typeRef.typeArguments) {
|
|
422
|
+
const baseType = typeRef.typeArguments[0];
|
|
423
|
+
const excludeType = typeRef.typeArguments[1];
|
|
424
|
+
const baseTypeName = baseType.typeName.getText();
|
|
425
|
+
const excludeTypeName = excludeType.typeName.getText();
|
|
426
|
+
const refNode = typeMap[baseTypeName];
|
|
427
|
+
const excludeNode = typeMap[excludeTypeName];
|
|
428
|
+
if (refNode && excludeNode) {
|
|
429
|
+
const baseTypeInfo = getTypeInfoFromTypeAlias(refNode, typeMap);
|
|
430
|
+
const excludeTypeInfo = getTypeInfoFromTypeAlias(excludeNode, typeMap);
|
|
431
|
+
if (baseTypeInfo && excludeTypeInfo) {
|
|
432
|
+
const {
|
|
433
|
+
fields: baseFields = {},
|
|
434
|
+
unionFieldSets: existingUnionFieldSets
|
|
435
|
+
} = baseTypeInfo;
|
|
436
|
+
const { fields: excludeFields = {} } = excludeTypeInfo;
|
|
437
|
+
const excludeFieldNames = Object.keys(excludeFields);
|
|
438
|
+
const cleanTypeInfoFields = Object.keys(
|
|
439
|
+
baseFields
|
|
440
|
+
).reduce(
|
|
441
|
+
(acc, key) => {
|
|
442
|
+
if (acc && !excludeFieldNames.includes(key) && baseFields[key]) {
|
|
443
|
+
acc[key] = baseFields[key];
|
|
444
|
+
}
|
|
445
|
+
return acc;
|
|
446
|
+
},
|
|
447
|
+
{}
|
|
448
|
+
);
|
|
449
|
+
const cleanUnionFieldSets = existingUnionFieldSets ? existingUnionFieldSets.map(
|
|
450
|
+
(fieldSet) => fieldSet.filter((field) => !excludeFieldNames.includes(field))
|
|
451
|
+
) : void 0;
|
|
452
|
+
typeInfo = {
|
|
453
|
+
...baseTypeInfo,
|
|
454
|
+
fields: cleanTypeInfoFields,
|
|
455
|
+
unionFieldSets: cleanUnionFieldSets
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return typeInfo;
|
|
461
|
+
};
|
|
462
|
+
var defaultFieldFilterProcessor = (typeNameStr, typeRef, typeMap) => {
|
|
463
|
+
const refNode = typeNameStr ? typeMap[typeNameStr] : void 0;
|
|
464
|
+
let typeInfo;
|
|
465
|
+
if (refNode) {
|
|
466
|
+
typeInfo = getTypeInfoFromTypeAlias(refNode, typeMap);
|
|
467
|
+
}
|
|
468
|
+
return typeInfo;
|
|
469
|
+
};
|
|
470
|
+
var FIELD_FILTER_PROCESSORS = {
|
|
471
|
+
[FIELD_FILTERS.PICK]: getTypeInfoFromPickOmitFieldFilters,
|
|
472
|
+
[FIELD_FILTERS.OMIT]: getTypeInfoFromPickOmitFieldFilters,
|
|
473
|
+
[FIELD_FILTERS.EXCLUDE]: getTypeInfoFromExcludeFieldFilter
|
|
474
|
+
};
|
|
475
|
+
var getTypeInfoFromFieldFilter = (typeNameStr, typeRef, typeMap) => {
|
|
476
|
+
const processor = typeNameStr ? FIELD_FILTER_PROCESSORS[typeNameStr] : void 0;
|
|
477
|
+
return processor ? processor(typeNameStr, typeRef, typeMap) : defaultFieldFilterProcessor(typeNameStr, typeRef, typeMap);
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
// src/common/TypeParsing/ParsingUtils/getTypeInfoFromAliasType.ts
|
|
481
|
+
var getTypeInfoFromTypeLiteral = (type) => getTypeInfo(type);
|
|
482
|
+
var getTypeInfoFromUnionOrIntersectionType = (type, typeMap) => getUnionOrIntersectionTypeInfo(type, typeMap);
|
|
483
|
+
var getTypeInfoFromTypeReference = (type, typeMap) => {
|
|
484
|
+
const typeRef = type;
|
|
485
|
+
const { typeName } = typeRef;
|
|
486
|
+
const typeNameStr = typeName.getText();
|
|
487
|
+
return getTypeInfoFromFieldFilter(typeNameStr, typeRef, typeMap);
|
|
488
|
+
};
|
|
489
|
+
var ALIAS_TYPE_PROCESSORS = {
|
|
490
|
+
[SyntaxKind.TypeLiteral]: getTypeInfoFromTypeLiteral,
|
|
491
|
+
[SyntaxKind.UnionType]: getTypeInfoFromUnionOrIntersectionType,
|
|
492
|
+
[SyntaxKind.IntersectionType]: getTypeInfoFromUnionOrIntersectionType,
|
|
493
|
+
[SyntaxKind.TypeReference]: getTypeInfoFromTypeReference
|
|
494
|
+
};
|
|
495
|
+
var getTypeInfoFromAliasType = (type, typeMap) => {
|
|
496
|
+
const { kind } = type;
|
|
497
|
+
const processor = ALIAS_TYPE_PROCESSORS[kind];
|
|
498
|
+
const typeInfo = processor ? processor(type, typeMap) : void 0;
|
|
499
|
+
return typeInfo;
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
// src/common/TypeParsing/ParsingUtils/getTypeInfoFromTypeAlias.ts
|
|
503
|
+
var getTypeInfoFromTypeAlias = (typeAliasDec, typeMap) => {
|
|
504
|
+
const { type } = typeAliasDec;
|
|
505
|
+
const tags = extractCommentTags(typeAliasDec);
|
|
506
|
+
const typeInfo = getTypeInfoFromAliasType(type, typeMap);
|
|
507
|
+
return typeInfo ? {
|
|
508
|
+
...typeInfo,
|
|
509
|
+
tags: {
|
|
510
|
+
...tags,
|
|
511
|
+
...typeInfo.tags
|
|
512
|
+
}
|
|
513
|
+
} : void 0;
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
// src/common/TypeParsing/ParsingUtils/getPrimaryFieldForTypeInfo.ts
|
|
517
|
+
var getPrimaryFieldForTypeInfo = (typeInfo) => {
|
|
518
|
+
const { fields } = typeInfo;
|
|
519
|
+
let primaryField = void 0, primaryFieldReadDenied = false;
|
|
520
|
+
for (const fieldName in fields) {
|
|
521
|
+
const field = fields[fieldName];
|
|
522
|
+
const {
|
|
523
|
+
tags: {
|
|
524
|
+
primaryField: isPrimaryField = false,
|
|
525
|
+
deniedOperations: { READ: readDenied = false } = {}
|
|
526
|
+
} = {}
|
|
527
|
+
} = field;
|
|
528
|
+
if (isPrimaryField || !primaryField) {
|
|
529
|
+
primaryField = fieldName;
|
|
530
|
+
primaryFieldReadDenied = readDenied;
|
|
531
|
+
}
|
|
532
|
+
if (isPrimaryField) {
|
|
533
|
+
break;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
if (primaryFieldReadDenied) {
|
|
537
|
+
throw new Error(
|
|
538
|
+
"READ_DENIED_PRIMARY_FIELD_NOT_SUPPORTED" /* READ_DENIED_PRIMARY_FIELD_NOT_SUPPORTED */
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
return primaryField;
|
|
542
|
+
};
|
|
543
|
+
|
|
544
|
+
// src/build/TypeParsing.ts
|
|
545
|
+
var getTypeInfoMapFromTypeScript = (source) => {
|
|
546
|
+
const typeScriptNode = createSourceFile(
|
|
547
|
+
"x.ts",
|
|
548
|
+
source,
|
|
549
|
+
ScriptTarget.Latest,
|
|
550
|
+
true
|
|
551
|
+
);
|
|
552
|
+
const typeMap = convertASTToMap(typeScriptNode, {});
|
|
553
|
+
const typeInfoMap = {};
|
|
554
|
+
for (const key in typeMap) {
|
|
555
|
+
const typeAliasDec = typeMap[key];
|
|
556
|
+
const { modifiers } = typeAliasDec;
|
|
557
|
+
let outputTypeInfo = false;
|
|
558
|
+
if (modifiers) {
|
|
559
|
+
modifiers.forEach((modifier) => {
|
|
560
|
+
const { kind } = modifier;
|
|
561
|
+
if (kind === SyntaxKind.ExportKeyword) {
|
|
562
|
+
outputTypeInfo = true;
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
if (outputTypeInfo) {
|
|
567
|
+
const typeInfo = getTypeInfoFromTypeAlias(typeAliasDec, typeMap);
|
|
568
|
+
if (typeInfo) {
|
|
569
|
+
typeInfoMap[key] = {
|
|
570
|
+
...typeInfo,
|
|
571
|
+
primaryField: getPrimaryFieldForTypeInfo(typeInfo)
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
return typeInfoMap;
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
export { convertASTToMap, getTypeInfoMapFromTypeScript };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collect required environment variables or throw with a missing-name error.
|
|
3
|
+
*
|
|
4
|
+
* @typeParam VarName - Allowed environment variable names.
|
|
5
|
+
* @param varNames - List of required environment variable names.
|
|
6
|
+
* @returns Map of environment variable names to values.
|
|
7
|
+
* @throws Error when a required variable is missing or empty.
|
|
8
|
+
*/
|
|
9
|
+
export declare const collectRequiredEnvironmentVariables: <VarName extends string>(varNames: VarName[]) => Record<VarName, string>;
|
|
@@ -1,17 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Relationship info types used by ORM and relationship utilities.
|
|
3
|
+
*/
|
|
4
|
+
import type { ExpandComplexType } from "./HelperTypes";
|
|
2
5
|
/**
|
|
3
6
|
* The keys for item relationship info.
|
|
4
7
|
* */
|
|
5
8
|
export declare enum ItemRelationshipInfoKeys {
|
|
9
|
+
/**
|
|
10
|
+
* Relationship origin type name.
|
|
11
|
+
* */
|
|
6
12
|
fromTypeName = "fromTypeName",
|
|
13
|
+
/**
|
|
14
|
+
* Relationship origin field name.
|
|
15
|
+
* */
|
|
7
16
|
fromTypeFieldName = "fromTypeFieldName",
|
|
17
|
+
/**
|
|
18
|
+
* Relationship origin primary field value.
|
|
19
|
+
* */
|
|
8
20
|
fromTypePrimaryFieldValue = "fromTypePrimaryFieldValue",
|
|
21
|
+
/**
|
|
22
|
+
* Relationship destination primary field value.
|
|
23
|
+
* */
|
|
9
24
|
toTypePrimaryFieldValue = "toTypePrimaryFieldValue"
|
|
10
25
|
}
|
|
11
26
|
/**
|
|
12
27
|
* The identifying keys for item relationship info.
|
|
13
28
|
* */
|
|
14
29
|
export declare enum ItemRelationshipInfoIdentifyingKeys {
|
|
30
|
+
/**
|
|
31
|
+
* Identifier value for a relationship item.
|
|
32
|
+
* */
|
|
15
33
|
id = "id"
|
|
16
34
|
}
|
|
17
35
|
/**
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation helpers for relationship items.
|
|
3
|
+
*/
|
|
4
|
+
import { TypeInfoValidationResults } from "../TypeParsing/Validation";
|
|
5
|
+
import { ItemRelationshipInfoKeys, ItemRelationshipInfoType } from "../ItemRelationshipInfoTypes";
|
|
6
|
+
/**
|
|
7
|
+
* Error codes for relationship validation.
|
|
8
|
+
* */
|
|
9
|
+
export declare const TYPE_INFO_ORM_RELATIONSHIP_ERRORS: {
|
|
10
|
+
INVALID_RELATIONSHIP_ITEM: string;
|
|
11
|
+
INVALID_RELATIONSHIP_ITEM_FIELD: string;
|
|
12
|
+
MISSING_RELATIONSHIP_ITEM_FIELD: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Validates a relationship item.
|
|
16
|
+
*
|
|
17
|
+
* @param relationshipItem - Relationship item to validate.
|
|
18
|
+
* @param omitFields - Relationship keys to ignore during validation.
|
|
19
|
+
* @returns Validation results with errors and errorMap when invalid.
|
|
20
|
+
* */
|
|
21
|
+
export declare const validateRelationshipItem: (relationshipItem: ItemRelationshipInfoType, omitFields: ItemRelationshipInfoKeys[]) => TypeInfoValidationResults;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logging tags used by {@link logFunctionCall}.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum LOGGING_MESSAGES {
|
|
5
|
+
LOGGING_FUNCTION_CALL = "LOGGING_FUNCTION_CALL",
|
|
6
|
+
INPUT = "INPUT",
|
|
7
|
+
OUTPUT = "OUTPUT",
|
|
8
|
+
ERROR = "ERROR"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Make a function call and log input/output/errors when enabled.
|
|
12
|
+
*
|
|
13
|
+
* @param label - Label to include in logs.
|
|
14
|
+
* @param args - Arguments passed to the function.
|
|
15
|
+
* @param functionRef - Function to execute.
|
|
16
|
+
* @param enabled - Whether to emit logs.
|
|
17
|
+
* @returns The function result.
|
|
18
|
+
*/
|
|
19
|
+
export declare const logFunctionCall: (label: string, args: any[], functionRef: (...args: any[]) => Promise<any> | any, enabled: boolean) => Promise<any>;
|