Skip to content

Commit

Permalink
Merge pull request #1164 from aws-amplify/main
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
alharris-at authored Jan 12, 2023
2 parents f00506d + 1dd4b8f commit 1900916
Show file tree
Hide file tree
Showing 35 changed files with 34 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const PIPELINE_AWAITER_ZIP = 'custom-resource-pipeline-awaiter.zip';

export enum DEPLOYMENT_MECHANISM {
/**
* on every amplify push
* on every amplify push.
*/
FULLY_MANAGED = 'FULLY_MANAGED',
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-dynamodb-simulator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const log = require('logdown')('dynamodb-emulator');
const execa = require('execa');
const { pathManager } = require('amplify-cli-core');

// random port I chose in the ephemeral range.
// random port I chose in the ephemeral range
const basePort = 62224;

const defaultOptions = {
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-e2e-core/src/cli-test-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const run = async (globalConfig, config, environment, runtime, testPath)
// This prevents the jest process from exiting without being forced.
// Exiting here as a workaround, only on windows.
// A timeout is used to give Jest time to render the list of passed/failed tests.
// See https://github.com/microsoft/node-pty/issues/437
// See https://github.com/microsoft/node-pty/issues/437.
process.exit(result.numFailingTests !== 0);
}
}, 1000);
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-e2e-tests/src/aws-exports/awsExports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function getAWSExportsPath(projRoot: string): string {
export function getAWSExports(projectRoot: string) {
const awsExportsPath = getAWSExportsPath(projectRoot);
// From Jest 25, ESM modules can only be loaded with mjs extension and Jest takes over
// require, that's why we need to copy the file.
// require, that's why we need to copy the file
const awsExportsMJSPath = awsExportsPath.replace('.js', '.mjs');
fs.copySync(awsExportsPath, awsExportsMJSPath, { overwrite: true });
const localRequire = require('esm')(module);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ import { showDefaultIdentityClaimWarning, showOwnerCanReassignWarning, showOwner
/**
* util to get allowed roles for field
* if we have a rule like cognito private we can remove all other related roles from the field since it has top level
* access by the provider
* access by the provider.
*/
const getReadRolesForField = (acm: AccessControlMatrix, readRoles: Array<string>, fieldName: string): Array<string> => {
const hasCognitoPrivateRole = readRoles.some((r) => r === 'userPools:private')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const validateDate = (date: string): boolean => {
}

// Verify the correct number of days for
// the month contained in the date-string.
// the month contained in the date-string
const year = Number(date.slice(0, 4));
const month = Number(date.slice(5, 2));
const day = Number(date.slice(8, 2));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class FunctionTransformer extends TransformerPluginBase {
requestTemplate.push(obj({}));

if (resolver === undefined) {
// TODO: update function to use resolver manager
// TODO: update function to use resolver manager.
const resolverStack = context.stackManager.getStackFor(resolverId, FUNCTION_DIRECTIVE_STACK);
resolver = context.api.host.addResolver(
config.resolverTypeName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class HttpTransformer extends TransformerPluginBase {
params = params.map(p => p.replace(':', ''));

// If there are URL parameters, remove them from the array used to
// create the query and body types.
// create the query and body types
args.queryAndBodyArgs = args.queryAndBodyArgs.filter(arg => {
return isScalar(arg.type) && !(params as string[]).includes(arg.name.value);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const API_KEY = 'API Key Authorization';
* replaceDdbPrimaryKey
*/
export function replaceDdbPrimaryKey(config: PrimaryKeyDirectiveConfiguration, ctx: TransformerContextProvider): void {
// Replace the table's primary key with the value from @primaryKey.
// Replace the table's primary key with the value from @primaryKey
const { field, object } = config;
const table = getTable(ctx, object) as any;
const cfnTable = table.table;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class MapsToTransformer extends TransformerPluginBase {
}

/**
* During the AST tree walking, the mapsTo transformer registers any renamed models with the ctx.resourceHelper
* During the AST tree walking, the mapsTo transformer registers any renamed models with the ctx.resourceHelper.
*/
object = (definition: ObjectTypeDefinitionNode, directive: DirectiveNode, ctx: TransformerSchemaVisitStepContextProvider) => {
updateTypeMapping(definition, directive, ctx.inputDocument, ctx.resourceHelper.setModelNameMapping);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TestEntry } from './test-case-types';

/*
REGISTER TEST CASES HERE
REGISTER TEST CASES HERE!
*/
export const getTestCaseRegistry = (): TestEntry[] => [
['bi-di connection', biDiConnectionSchema],
Expand All @@ -26,7 +26,7 @@ export const getTestCaseRegistry = (): TestEntry[] => [
];

/*
DEFINE TEST SCHEMAS BELOW
DEFINE TEST SCHEMAS BELOW!
*/

const biDiConnectionSchema = /* GraphQL */ `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export enum SubscriptionLevel {
}

/**
* ModelDirectiveConfiguration
* ModelDirectiveConfiguration.
*/
export type ModelDirectiveConfiguration = {
queries?: Partial<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class PredictionsTransformer extends TransformerPluginBase {
}
});

// Generate the input type based on operation name.
// Generate the input type based on operation name
context.output.addInput(makeActionInputObject(directive.resolverFieldName, actionInputObjectFields));

// Add arguments into operation.
Expand Down
3 changes: 0 additions & 3 deletions packages/amplify-graphql-relational-transformer/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ import {
} from './types';
import { getConnectionAttributeName, getObjectPrimaryKey, getSortKeyConnectionAttributeName } from './utils';

/**
* extendTypeWithConnection
*/
export const extendTypeWithConnection = (config: HasManyDirectiveConfiguration, ctx: TransformerContextProvider): void => {
const { field, object } = config;

Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-graphql-schema-test-library/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// as (TransformerPlatform.js | TransformerPlatform.ios). Similarly, if a schema is supported
// on all platforms but Flutter with DataStore enabled, the flags can be set like this:
// (TransformerPlatform.all & ~TransformerPlatform.flutterDataStore). Ideally, we should be
// working toward a state where TransformerPlatform.all is the only value needed.
// working toward a state where TransformerPlatform.all is the only value needed

export const enum TransformerVersion {
v1 = 1 << 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const getCurrentCloudBackendStackFiles = (apiName: string): any[] => {
};

/**
* Given a Stack file, determine whether or not NodeToNodeEncryption is defined in a search domain.
* Given a Stack file, determine whether or not NodeToNodeEncryption is defined in a search domain
* @param stackDefinition the stack to inspect
* @returns whether or not NodeToNodeEncryption was found, else false
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-graphql-transformer-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export {
} from './transformation/transformer-plugin-base';
export { TransformerResolver, StackManager } from './transformer-context';
/**
* Returns the extra set of directives that are supported by AppSync service
* Returns the extra set of directives that are supported by AppSync service.
*/
export const getAppSyncServiceExtraDirectives = (): string => {
return print(EXTRA_DIRECTIVES_DOCUMENT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
import { Grant, IGrantable, IRole } from '@aws-cdk/aws-iam';
import { TransformHostProvider } from './transform-host-provider';

// Auth Config
// Auth Config Modes
export type AppSyncAuthMode = 'API_KEY' | 'AMAZON_COGNITO_USER_POOLS' | 'AWS_IAM' | 'OPENID_CONNECT' | 'AWS_LAMBDA';
export type AppSyncAuthConfiguration = {
defaultAuthentication: AppSyncAuthConfigurationEntry;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { parseValue } from 'graphql';
import { defaultProviderMap } from '../auth';

/**
* Create a graphql name node given a name value
*/
export function createNameNode(name: any) {
return {
kind: 'Name',
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-migration-tests/src/configure_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { amplifyConfigure as configure, isCI, installAmplifyCLI, injectSessionTo
*/

async function setupAmplify(version: string = 'latest') {
// install CLI to be used for migration test initial project
// install CLI to be used for migration test initial project.
await installAmplifyCLI(version);

console.log("INSTALLED CLI:", version);
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-util-mock/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function start(context) {
testApi.start(context);
} catch (e) {
console.log(e);
// Sending term signal so we clean up after ourself
// Sending term signal so we clean up after ourselves
process.kill(process.pid, 'SIGTERM');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { ModelDirectiveConfiguration, ModelDirectiveOperationType, ModelSubscrip
import { OWNER_AUTH_STRATEGY, GROUPS_AUTH_STRATEGY, DEFAULT_OWNER_FIELD, AUTH_NON_MODEL_TYPES } from './constants';

/**
* Implements the ModelAuthTransformer.
* Implements the ModelAuthTransformer
*
* Owner Auth Usage:
*
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-connection-transformer/src/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class ResourceFactory {
}

/**
* Creates the barebones template for an application.
* Creates the barebones template for an application
*/
public initTemplate(): Template {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export interface DynamoDBModelTransformerOptions {

// Transform config version constants
// We have constants instead of magic number all around, later these should be moved to feature
// flags and transformers should be feature and not version dependent.
// flags and transformers should be feature and not version dependent

// To support generation of conditions and new naming, version 5 was introduced
export const CONDITIONS_MINIMUM_VERSION = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { MappingParameters } from 'graphql-transformer-core';
*/
export class ResourceFactory {
/**
* makeParams
* Generate CFN Parameters section
*/
public makeParams() {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const FUNCTION_DIRECTIVE_STACK = 'FunctionDirectiveStack';

export class FunctionTransformer extends Transformer {
constructor() {
// TODO remove once prettier is upgraded
// prettier-ignore
super(
'FunctionTransformer',
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-http-transformer/src/HttpTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface HttpDirectiveArgs {
}

/**
* The @http transform.
* The @http transform
*
* This transform attaches http resolvers to any fields with the @http directive.
* Works with GET, POST, PUT, DELETE requests.
Expand Down
1 change: 0 additions & 1 deletion packages/graphql-key-transformer/src/KeyTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ interface KeyArguments {

export class KeyTransformer extends Transformer {
constructor() {
// TODO remove once prettier is upgraded
// prettier-ignore
super(
'KeyTransformer',
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-mapping-template/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export class HttpMappingTemplate {
static RESOLVER_VERSION_ID = '2018-05-29';

/**
* Create a mapping template for HTTP GET requests.
* Create a mapping template for HTTP GET requests
*/
public static getRequest({ resourcePath, params }: { resourcePath: string; params: ObjectNode }): ObjectNode {
return obj({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class PredictionsTransformer extends Transformer {
}

public field = (parent: ObjectTypeDefinitionNode, definition: FieldDefinitionNode, directive: DirectiveNode, ctx: TransformerContext) => {
// validate @predictions is defined on a field under a query object
// validate @predictions is defined on a field under a query object.
if (parent.name.value !== ctx.getQueryTypeName()) {
throw new InvalidDirectiveError('@predictions directive only works under Query operations.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { toUpper } from 'graphql-transformer-common';

/**
* A class to manage interactions with a Aurora Serverless MySQL Relational Databse
* using the Aurora Data API
* using the Aurora Data API.
*/
export class AuroraServerlessMySQLDatabaseReader implements IRelationalDBReader {
auroraClient: AuroraDataAPIClient;
Expand Down
2 changes: 0 additions & 2 deletions packages/graphql-transformer-common/src/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import {
DirectiveNode,
EnumTypeDefinitionNode,
ValueNode,
ListValueNode,
ObjectValueNode,
InputObjectTypeDefinitionNode,
UnionTypeDefinitionNode,
DocumentNode,
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-transformer-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export * from './util';
export { getTableNameForModel } from './tableNameMap';

/**
* Returns the extra set of directives that are supported by AppSync service
* Returns the set of directives that are supported by AppSync service
*/
export function getAppSyncServiceExtraDirectives(): string {
return print(EXTRA_DIRECTIVES_DOCUMENT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DeploymentResources } from 'graphql-transformer-core';

/**
* Used with SearchableModelTransformer Tests
* Changes userItems list to stringsets in dynamo so the lambda function can support it
* Changes userItems list to stringsets in dynamo so the lambda function can support them
*/

const createStringSetVTL = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class VersionedModelTransformer extends Transformer {
};

/**
* Set the "version" to 1.
* Set the "version" to 1
* @param ctx
* @param versionField
* @param versionInput
Expand Down

0 comments on commit 1900916

Please sign in to comment.