Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-amplify/graphql-searchable-transformer

Package Overview
Dependencies
Maintainers
7
Versions
443
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-amplify/graphql-searchable-transformer - npm Package Compare versions

Comparing version 0.6.1-headless-s3-not-for-production.0 to 0.6.1

3

CHANGELOG.md

@@ -6,3 +6,3 @@ # Change Log

## [0.6.1-headless-s3-not-for-production.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/graphql-searchable-transformer@0.6.0...@aws-amplify/graphql-searchable-transformer@0.6.1-headless-s3-not-for-production.0) (2021-09-22)
## [0.6.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/graphql-searchable-transformer@0.6.0...@aws-amplify/graphql-searchable-transformer@0.6.1) (2021-09-27)

@@ -13,2 +13,3 @@

* **graphql-model-transformer:** [@model](https://github.com/model) conflict resolution ([#8035](https://github.com/aws-amplify/amplify-cli/issues/8035)) ([f3bdc4a](https://github.com/aws-amplify/amplify-cli/commit/f3bdc4ac1fcf596f634d9d2e968785e76f7b138c))
* **graphql-model-transformer:** iam role name does not exceed 64 characters ([#8244](https://github.com/aws-amplify/amplify-cli/issues/8244)) ([812a671](https://github.com/aws-amplify/amplify-cli/commit/812a67163d6dd33160bf7ace9afd538c83a7af1a))

@@ -15,0 +16,0 @@

@@ -0,1 +1,2 @@

import { TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
import { Domain } from '@aws-cdk/aws-elasticsearch';

@@ -5,3 +6,3 @@ import { IRole } from '@aws-cdk/aws-iam';

export declare const createSearchableDomain: (stack: Construct, parameterMap: Map<string, CfnParameter>, apiId: string) => Domain;
export declare const createSearchableDomainRole: (stack: Construct, parameterMap: Map<string, CfnParameter>, apiId: string, envParam: CfnParameter) => IRole;
export declare const createSearchableDomainRole: (context: TransformerContextProvider, stack: Construct, parameterMap: Map<string, CfnParameter>) => IRole;
//# sourceMappingURL=create-searchable-domain.d.ts.map

@@ -33,9 +33,8 @@ "use strict";

exports.createSearchableDomain = createSearchableDomain;
const createSearchableDomainRole = (stack, parameterMap, apiId, envParam) => {
const createSearchableDomainRole = (context, stack, parameterMap) => {
const { OpenSearchAccessIAMRoleLogicalID } = graphql_transformer_common_1.ResourceConstants.RESOURCES;
const { OpenSearchAccessIAMRoleName } = graphql_transformer_common_1.ResourceConstants.PARAMETERS;
const { HasEnvironmentParameter } = graphql_transformer_common_1.ResourceConstants.CONDITIONS;
return new aws_iam_1.Role(stack, OpenSearchAccessIAMRoleLogicalID, {
assumedBy: new aws_iam_1.ServicePrincipal('appsync.amazonaws.com'),
roleName: core_1.Fn.conditionIf(HasEnvironmentParameter, core_1.Fn.join('-', [parameterMap.get(OpenSearchAccessIAMRoleName).valueAsString, apiId, envParam.valueAsString]), core_1.Fn.join('-', [parameterMap.get(OpenSearchAccessIAMRoleName).valueAsString, apiId, envParam.valueAsString])).toString(),
roleName: context.resourceHelper.generateIAMRoleName(parameterMap.get(OpenSearchAccessIAMRoleName).valueAsString),
});

@@ -42,0 +41,0 @@ };

@@ -1,2 +0,2 @@

import { GraphQLAPIProvider } from '@aws-amplify/graphql-transformer-interfaces';
import { GraphQLAPIProvider, TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
import { EventSourceMapping, IFunction } from '@aws-cdk/aws-lambda';

@@ -6,4 +6,4 @@ import { CfnParameter, Construct, Stack } from '@aws-cdk/core';

export declare const createLambda: (stack: Stack, apiGraphql: GraphQLAPIProvider, parameterMap: Map<string, CfnParameter>, lambdaRole: IRole, endpoint: string, isProjectUsingDataStore: boolean, region?: string | undefined) => IFunction;
export declare const createLambdaRole: (stack: Construct, parameterMap: Map<string, CfnParameter>) => IRole;
export declare const createLambdaRole: (context: TransformerContextProvider, stack: Construct, parameterMap: Map<string, CfnParameter>) => IRole;
export declare const createEventSourceMapping: (stack: Construct, type: string, target: IFunction, parameterMap: Map<string, CfnParameter>, tableStreamArn?: string | undefined) => EventSourceMapping;
//# sourceMappingURL=create-streaming-lambda.d.ts.map

@@ -47,4 +47,4 @@ "use strict";

exports.createLambda = createLambda;
const createLambdaRole = (stack, parameterMap) => {
var _a;
const createLambdaRole = (context, stack, parameterMap) => {
var _a, _b;
const { OpenSearchStreamingLambdaIAMRoleLogicalID } = graphql_transformer_common_1.ResourceConstants.RESOURCES;

@@ -54,3 +54,3 @@ const { OpenSearchStreamingIAMRoleName } = graphql_transformer_common_1.ResourceConstants.PARAMETERS;

assumedBy: new aws_iam_1.ServicePrincipal('lambda.amazonaws.com'),
roleName: (_a = parameterMap.get(OpenSearchStreamingIAMRoleName)) === null || _a === void 0 ? void 0 : _a.valueAsString,
roleName: context.resourceHelper.generateIAMRoleName((_b = (_a = parameterMap.get(OpenSearchStreamingIAMRoleName)) === null || _a === void 0 ? void 0 : _a.valueAsString) !== null && _b !== void 0 ? _b : ''),
});

@@ -57,0 +57,0 @@ role.attachInlinePolicy(new aws_iam_1.Policy(stack, 'CloudwatchLogsAccess', {

@@ -44,6 +44,6 @@ "use strict";

const domain = create_searchable_domain_1.createSearchableDomain(stack, parameterMap, context.api.apiId);
const openSearchRole = create_searchable_domain_1.createSearchableDomainRole(stack, parameterMap, context.api.apiId, envParam);
const openSearchRole = create_searchable_domain_1.createSearchableDomainRole(context, stack, parameterMap);
domain.grantReadWrite(openSearchRole);
const datasource = create_searchable_datasource_1.createSearchableDataSource(stack, context.api, domain.domainEndpoint, openSearchRole, stack.parseArn(domain.domainArn).region);
const lambdaRole = create_streaming_lambda_1.createLambdaRole(stack, parameterMap);
const lambdaRole = create_streaming_lambda_1.createLambdaRole(context, stack, parameterMap);
domain.grantWrite(lambdaRole);

@@ -50,0 +50,0 @@ const lambda = create_streaming_lambda_1.createLambda(stack, context.api, parameterMap, lambdaRole, domain.domainEndpoint, isProjectUsingDataStore, stack.parseArn(domain.domainArn).region);

{
"name": "@aws-amplify/graphql-searchable-transformer",
"version": "0.6.1-headless-s3-not-for-production.0",
"version": "0.6.1",
"description": "Amplfy GraphQL @searchable transformer",

@@ -30,17 +30,17 @@ "repository": {

"dependencies": {
"@aws-amplify/graphql-transformer-core": "0.9.1-headless-s3-not-for-production.0",
"@aws-amplify/graphql-transformer-interfaces": "1.9.1-headless-s3-not-for-production.0",
"@aws-cdk/aws-appsync": "~1.119.0",
"@aws-cdk/aws-dynamodb": "~1.119.0",
"@aws-cdk/aws-ec2": "~1.119.0",
"@aws-cdk/aws-elasticsearch": "~1.119.0",
"@aws-cdk/aws-iam": "~1.119.0",
"@aws-cdk/aws-lambda": "~1.119.0",
"@aws-cdk/core": "~1.119.0",
"@aws-amplify/graphql-transformer-core": "0.9.1",
"@aws-amplify/graphql-transformer-interfaces": "1.9.1",
"@aws-cdk/aws-appsync": "~1.124.0",
"@aws-cdk/aws-dynamodb": "~1.124.0",
"@aws-cdk/aws-ec2": "~1.124.0",
"@aws-cdk/aws-elasticsearch": "~1.124.0",
"@aws-cdk/aws-iam": "~1.124.0",
"@aws-cdk/aws-lambda": "~1.124.0",
"@aws-cdk/core": "~1.124.0",
"graphql": "^14.5.8",
"graphql-mapping-template": "4.18.3",
"graphql-transformer-common": "4.19.9"
"graphql-transformer-common": "4.19.10"
},
"devDependencies": {
"@aws-cdk/assert": "~1.119.0",
"@aws-cdk/assert": "~1.124.0",
"@types/fs-extra": "^8.0.1",

@@ -65,3 +65,3 @@ "@types/node": "^10.17.13"

},
"gitHead": "633fe35382bff0520a342b58bef3647ab07ee8f2"
"gitHead": "d3896f04442fb541397380a113b68e32ee79789c"
}

@@ -0,1 +1,2 @@

import { TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
import { EbsDeviceVolumeType } from '@aws-cdk/aws-ec2';

@@ -34,18 +35,12 @@ import { CfnDomain, Domain, ElasticsearchVersion } from '@aws-cdk/aws-elasticsearch';

export const createSearchableDomainRole = (
context: TransformerContextProvider,
stack: Construct,
parameterMap: Map<string, CfnParameter>,
apiId: string,
envParam: CfnParameter,
): IRole => {
const { OpenSearchAccessIAMRoleLogicalID } = ResourceConstants.RESOURCES;
const { OpenSearchAccessIAMRoleName } = ResourceConstants.PARAMETERS;
const { HasEnvironmentParameter } = ResourceConstants.CONDITIONS;
return new Role(stack, OpenSearchAccessIAMRoleLogicalID, {
assumedBy: new ServicePrincipal('appsync.amazonaws.com'),
roleName: Fn.conditionIf(
HasEnvironmentParameter,
Fn.join('-', [parameterMap.get(OpenSearchAccessIAMRoleName)!.valueAsString, apiId, envParam.valueAsString]),
Fn.join('-', [parameterMap.get(OpenSearchAccessIAMRoleName)!.valueAsString, apiId, envParam.valueAsString]),
).toString(),
roleName: context.resourceHelper.generateIAMRoleName(parameterMap.get(OpenSearchAccessIAMRoleName)!.valueAsString),
});
};

@@ -1,2 +0,2 @@

import { GraphQLAPIProvider } from '@aws-amplify/graphql-transformer-interfaces';
import { GraphQLAPIProvider, TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
import { EventSourceMapping, IFunction, LayerVersion, Runtime, StartingPosition } from '@aws-cdk/aws-lambda';

@@ -48,3 +48,3 @@ import { CfnParameter, Construct, Fn, Stack, Duration } from '@aws-cdk/core';

export const createLambdaRole = (stack: Construct, parameterMap: Map<string, CfnParameter>): IRole => {
export const createLambdaRole = (context: TransformerContextProvider, stack: Construct, parameterMap: Map<string, CfnParameter>): IRole => {
const { OpenSearchStreamingLambdaIAMRoleLogicalID } = ResourceConstants.RESOURCES;

@@ -54,3 +54,3 @@ const { OpenSearchStreamingIAMRoleName } = ResourceConstants.PARAMETERS;

assumedBy: new ServicePrincipal('lambda.amazonaws.com'),
roleName: parameterMap.get(OpenSearchStreamingIAMRoleName)?.valueAsString,
roleName: context.resourceHelper.generateIAMRoleName(parameterMap.get(OpenSearchStreamingIAMRoleName)?.valueAsString ?? ''),
});

@@ -57,0 +57,0 @@ role.attachInlinePolicy(

@@ -89,3 +89,3 @@ import { TransformerPluginBase, InvalidDirectiveError, MappingTemplate, DirectiveWrapper } from '@aws-amplify/graphql-transformer-core';

const openSearchRole = createSearchableDomainRole(stack, parameterMap, context.api.apiId, envParam);
const openSearchRole = createSearchableDomainRole(context, stack, parameterMap);

@@ -103,3 +103,3 @@ domain.grantReadWrite(openSearchRole);

// streaming lambda role
const lambdaRole = createLambdaRole(stack, parameterMap);
const lambdaRole = createLambdaRole(context, stack, parameterMap);
domain.grantWrite(lambdaRole);

@@ -106,0 +106,0 @@

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc