graphql-transformer-core
Advanced tools
Comparing version 8.1.10 to 8.2.0-rds-1.0
@@ -268,3 +268,3 @@ ## API Report File for "graphql-transformer-core" | ||
// @public (undocumented) | ||
function loadProject(projectDirectory: string, opts?: ProjectOptions): Promise<ProjectConfiguration>; | ||
const loadProject: (projectDirectory: string, opts?: ProjectOptions) => Promise<ProjectConfiguration>; | ||
export { loadProject } | ||
@@ -271,0 +271,0 @@ export { loadProject as readProjectConfiguration } |
@@ -9,4 +9,4 @@ import './polyfills/Object.assign'; | ||
import { stripDirectives } from './stripDirectives'; | ||
import { buildProject as buildAPIProject, uploadDeployment as uploadAPIProject, migrateAPIProject, revertAPIMigration, CLOUDFORMATION_FILE_NAME, PARAMETERS_FILE_NAME, getSanityCheckRules } from './util/amplifyUtils'; | ||
import { readSchema as readProjectSchema, loadProject as readProjectConfiguration, loadConfig as readTransformerConfiguration, writeConfig as writeTransformerConfiguration, TRANSFORM_CONFIG_FILE_NAME, TRANSFORM_BASE_VERSION, TRANSFORM_CURRENT_VERSION, TransformConfig, ConflictHandlerType, ConflictDetectionType, ResolverConfig, SyncConfig } from './util/transformConfig'; | ||
import { buildProject as buildAPIProject, uploadDeployment as uploadAPIProject, migrateAPIProject, revertAPIMigration, CLOUDFORMATION_FILE_NAME, PARAMETERS_FILE_NAME } from './util/amplifyUtils'; | ||
import { readSchema as readProjectSchema, loadProject as readProjectConfiguration, loadConfig as readTransformerConfiguration, writeConfig as writeTransformerConfiguration } from './util/transformConfig'; | ||
export * from './errors'; | ||
@@ -17,3 +17,3 @@ export * from './util'; | ||
export { FeatureFlagProvider } from './FeatureFlags'; | ||
export { GraphQLTransform, TransformConfig, TransformerContext, MappingParameters, Transformer, ITransformer, collectDirectiveNames, collectDirectivesByType, collectDirectivesByTypeNames, stripDirectives, buildAPIProject, migrateAPIProject, uploadAPIProject, readProjectSchema, readProjectConfiguration, readTransformerConfiguration, writeTransformerConfiguration, revertAPIMigration, TRANSFORM_CONFIG_FILE_NAME, TRANSFORM_BASE_VERSION, TRANSFORM_CURRENT_VERSION, ConflictHandlerType, ConflictDetectionType, ResolverConfig, SyncConfig, DeploymentResources, CLOUDFORMATION_FILE_NAME, PARAMETERS_FILE_NAME, getSanityCheckRules, }; | ||
export { GraphQLTransform, TransformerContext, MappingParameters, Transformer, ITransformer, collectDirectiveNames, collectDirectivesByType, collectDirectivesByTypeNames, stripDirectives, buildAPIProject, migrateAPIProject, uploadAPIProject, readProjectSchema, readProjectConfiguration, readTransformerConfiguration, writeTransformerConfiguration, revertAPIMigration, DeploymentResources, CLOUDFORMATION_FILE_NAME, PARAMETERS_FILE_NAME, }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -17,3 +17,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getSanityCheckRules = exports.PARAMETERS_FILE_NAME = exports.CLOUDFORMATION_FILE_NAME = exports.ConflictHandlerType = exports.TRANSFORM_CURRENT_VERSION = exports.TRANSFORM_BASE_VERSION = exports.TRANSFORM_CONFIG_FILE_NAME = exports.revertAPIMigration = exports.writeTransformerConfiguration = exports.readTransformerConfiguration = exports.readProjectConfiguration = exports.readProjectSchema = exports.uploadAPIProject = exports.migrateAPIProject = exports.buildAPIProject = exports.stripDirectives = exports.collectDirectivesByTypeNames = exports.collectDirectivesByType = exports.collectDirectiveNames = exports.Transformer = exports.TransformerContext = exports.GraphQLTransform = exports.getAppSyncServiceExtraDirectives = exports.getTableNameForModel = void 0; | ||
exports.PARAMETERS_FILE_NAME = exports.CLOUDFORMATION_FILE_NAME = exports.revertAPIMigration = exports.writeTransformerConfiguration = exports.readTransformerConfiguration = exports.readProjectConfiguration = exports.readProjectSchema = exports.uploadAPIProject = exports.migrateAPIProject = exports.buildAPIProject = exports.stripDirectives = exports.collectDirectivesByTypeNames = exports.collectDirectivesByType = exports.collectDirectiveNames = exports.Transformer = exports.TransformerContext = exports.GraphQLTransform = exports.getAppSyncServiceExtraDirectives = exports.getTableNameForModel = void 0; | ||
require("./polyfills/Object.assign"); | ||
@@ -40,3 +40,2 @@ const graphql_1 = require("graphql"); | ||
Object.defineProperty(exports, "PARAMETERS_FILE_NAME", { enumerable: true, get: function () { return amplifyUtils_1.PARAMETERS_FILE_NAME; } }); | ||
Object.defineProperty(exports, "getSanityCheckRules", { enumerable: true, get: function () { return amplifyUtils_1.getSanityCheckRules; } }); | ||
const transformConfig_1 = require("./util/transformConfig"); | ||
@@ -47,6 +46,2 @@ Object.defineProperty(exports, "readProjectSchema", { enumerable: true, get: function () { return transformConfig_1.readSchema; } }); | ||
Object.defineProperty(exports, "writeTransformerConfiguration", { enumerable: true, get: function () { return transformConfig_1.writeConfig; } }); | ||
Object.defineProperty(exports, "TRANSFORM_CONFIG_FILE_NAME", { enumerable: true, get: function () { return transformConfig_1.TRANSFORM_CONFIG_FILE_NAME; } }); | ||
Object.defineProperty(exports, "TRANSFORM_BASE_VERSION", { enumerable: true, get: function () { return transformConfig_1.TRANSFORM_BASE_VERSION; } }); | ||
Object.defineProperty(exports, "TRANSFORM_CURRENT_VERSION", { enumerable: true, get: function () { return transformConfig_1.TRANSFORM_CURRENT_VERSION; } }); | ||
Object.defineProperty(exports, "ConflictHandlerType", { enumerable: true, get: function () { return transformConfig_1.ConflictHandlerType; } }); | ||
const validation_1 = require("./validation"); | ||
@@ -53,0 +48,0 @@ __exportStar(require("./errors"), exports); |
@@ -81,4 +81,5 @@ import { Template } from 'cloudform-types'; | ||
modelToDatasourceMap: Map<string, DatasourceType>; | ||
customQueries: Map<string, string>; | ||
} | ||
export declare function loadProject(projectDirectory: string, opts?: ProjectOptions): Promise<ProjectConfiguration>; | ||
export declare const loadProject: (projectDirectory: string, opts?: ProjectOptions) => Promise<ProjectConfiguration>; | ||
export declare const readSchema: (projectDirectory: string) => Promise<{ | ||
@@ -85,0 +86,0 @@ schema: string; |
@@ -76,3 +76,3 @@ "use strict"; | ||
exports.isDataStoreEnabled = isDataStoreEnabled; | ||
async function loadProject(projectDirectory, opts) { | ||
const loadProject = async (projectDirectory, opts) => { | ||
const { schema, modelToDatasourceMap } = await (0, exports.readSchema)(projectDirectory); | ||
@@ -109,2 +109,17 @@ const functions = {}; | ||
} | ||
const customQueries = new Map(); | ||
const customQueriesDirectoryName = 'sql-statements'; | ||
const customQueriesDirectory = path.join(projectDirectory, customQueriesDirectoryName); | ||
const customQueriesDirExists = await fs.exists(customQueriesDirectory); | ||
if (customQueriesDirExists) { | ||
const queryFiles = await fs.readdir(customQueriesDirectory); | ||
for (const queryFile of queryFiles) { | ||
if (!queryFile.endsWith('.sql')) { | ||
continue; | ||
} | ||
const queryFileName = path.parse(queryFile).name; | ||
const queryFilePath = path.join(customQueriesDirectory, queryFile); | ||
customQueries.set(queryFileName, await fs.readFile(queryFilePath, 'utf8')); | ||
} | ||
} | ||
const resolvers = {}; | ||
@@ -154,4 +169,5 @@ if (!(opts && opts.disableResolverOverrides === true)) { | ||
modelToDatasourceMap, | ||
customQueries, | ||
}; | ||
} | ||
}; | ||
exports.loadProject = loadProject; | ||
@@ -158,0 +174,0 @@ const readSchema = async (projectDirectory) => { |
{ | ||
"name": "graphql-transformer-core", | ||
"version": "8.1.10", | ||
"version": "8.2.0-rds-1.0", | ||
"description": "A framework to transform from GraphQL SDL to AWS cloudFormation.", | ||
@@ -32,7 +32,7 @@ "repository": { | ||
"graphql": "^15.5.0", | ||
"graphql-transformer-common": "4.25.0", | ||
"graphql-transformer-common": "4.26.0-rds-1.0", | ||
"lodash": "^4.17.21" | ||
}, | ||
"devDependencies": { | ||
"@aws-amplify/amplify-cli-core": "4.2.4-rc.43f73ab268.0", | ||
"@aws-amplify/amplify-cli-core": "4.2.4-aug-transformer-mv-bump.0", | ||
"@types/fs-extra": "^8.0.1", | ||
@@ -64,3 +64,3 @@ "@types/node": "^12.12.6" | ||
}, | ||
"gitHead": "de6751fd91228eecae518326515833f72509afa0" | ||
"gitHead": "223cc16f30e64ab18ac1eda6a31c68db7606c8b8" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
487904
4356
2
+ Addedgraphql-transformer-common@4.26.0-rds-1.0(transitive)
- Removedgraphql-transformer-common@4.25.0(transitive)