Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(services): rename tables and properties to fix postgres long nam… #99

Open
wants to merge 4 commits into
base: alpha
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@
"terraform:cleanup": "rimraf ./tests/terraform/{.terraform,.terraform.lock.hcl,tfplan} ./tests/terraform/*.{tfstate,tfplan,backup}"
},
"dependencies": {
"@cloudgraph/sdk": "0.20.0",
"@cloudgraph/sdk": "0.22.0",
"@fast-csv/parse": "^4.3.6",
"@graphql-tools/load-files": "6.3.2",
"@graphql-tools/merge": "8.0.1",
"@graphql-tools/load-files": "^6.5.3",
"@graphql-tools/merge": "^8.2.3",
"aws-sdk": "^2.1084.0",
"chalk": "4.1.2",
"cuid": "2.1.8",
"dotenv": "10.0.0",
"graphql": "^15.7.2",
"graphql": "^16.2.0",
"lodash": "4.17.21",
"typescript": "4.3.5"
},
"devDependencies": {
"@autocloud/eslint-config": "^0.1.0",
"@graphql-codegen/cli": "^2.4.0",
"@graphql-codegen/typescript": "1.23.0",
"@graphql-codegen/cli": "^2.5.0",
"@graphql-codegen/typescript": "^2.4.3",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^8.0.1",
Expand Down
16 changes: 8 additions & 8 deletions src/services/dynamodb/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ import {
AwsDynamoDbTable,
AwsDynamoDbTableAttributes,
AwsDynamoDbTableBillingSummary,
AwsDynamoDbTableGlobalSecondaryIndexDescription,
AwsDynamoDbTableGlobalSecondaryIndex,
AwsDynamoDbTableIndexKeySchema,
AwsDynamoDbTableIndexProjection,
AwsDynamoDbTableLocalSecondaryIndexDescription,
AwsDynamoDbTableProvisionedThroughputDescription,
AwsDynamoDbTableLocalSecondaryIndex,
AwsDynamoDbTableProvisionedThroughput,
AwsDynamoDbTableReplicaDescription,
AwsDynamoDbTableRestoreSummary,
AwsDynamoDbTableSseDescription,
AwsDynamoDbTableStreamSpecification,
AwsDynamoDbTableAutoScalingSettingsDescription,
AwsDynamoDbTableAutoScalingSettings,
} from '../../types/generated'

const formatKeySchema = (
Expand All @@ -39,7 +39,7 @@ const formatKeySchema = (

const formatProvisionedThroughput = (
provisionedThroughput: ProvisionedThroughputDescription = {}
): AwsDynamoDbTableProvisionedThroughputDescription => {
): AwsDynamoDbTableProvisionedThroughput => {
const {
LastIncreaseDateTime: lastIncreaseDateTime,
LastDecreaseDateTime: lastDecreaseDateTime,
Expand Down Expand Up @@ -77,7 +77,7 @@ const formatProjection = (

const formatAutoScalingSettingsDescription = (
setting: AutoScalingSettingsDescription = {}
): AwsDynamoDbTableAutoScalingSettingsDescription => {
): AwsDynamoDbTableAutoScalingSettings => {
if (isEmpty(setting)) {
return {}
}
Expand Down Expand Up @@ -190,7 +190,7 @@ export default ({
: {}),
}

const globalIndexes: AwsDynamoDbTableGlobalSecondaryIndexDescription[] =
const globalIndexes: AwsDynamoDbTableGlobalSecondaryIndex[] =
GlobalSecondaryIndexes.map(
({
IndexName,
Expand Down Expand Up @@ -227,7 +227,7 @@ export default ({
})
)

const localIndexes: AwsDynamoDbTableLocalSecondaryIndexDescription[] =
const localIndexes: AwsDynamoDbTableLocalSecondaryIndex[] =
LocalSecondaryIndexes.map(
({
IndexName,
Expand Down
28 changes: 14 additions & 14 deletions src/services/dynamodb/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type awsDynamoDbTableIndexKeySchema
keyType: String @search(by: [hash, regexp])
}

type awsDynamoDbTableLocalSecondaryIndexDescription
type awsDynamoDbTableLocalSecondaryIndex
@generate(
query: { get: false, query: true, aggregate: false }
mutation: { add: false, delete: false }
Expand All @@ -45,7 +45,7 @@ type awsDynamoDbTableLocalSecondaryIndexDescription
sizeInBytes: Int64 @search
}

type awsDynamoDbTableProvisionedThroughputDescription
type awsDynamoDbTableProvisionedThroughput
@generate(
query: { get: false, query: true, aggregate: false }
mutation: { add: false, delete: false }
Expand All @@ -58,7 +58,7 @@ type awsDynamoDbTableProvisionedThroughputDescription
writeCapacityUnits: Int @search
}

type awsDynamoDbTableGlobalSecondaryIndexDescription
type awsDynamoDbTableGlobalSecondaryIndex
@generate(
query: { get: false, query: true, aggregate: false }
mutation: { add: false, delete: false }
Expand All @@ -73,7 +73,7 @@ type awsDynamoDbTableGlobalSecondaryIndexDescription
sizeInBytes: Int64 @search
status: String @search(by: [hash, regexp])
backfilling: Boolean @search
provisionedThroughput: awsDynamoDbTableProvisionedThroughputDescription
provisionedThroughput: awsDynamoDbTableProvisionedThroughput
}

type awsDynamoDbTableStreamSpecification
Expand All @@ -96,7 +96,7 @@ type awsDynamoDbTableBillingSummary
lastUpdateToPayPerRequestDateTime: String @search(by: [hash, regexp])
}

type awsDynamoDbTableReplicaGlobalSecondaryIndexDescription
type awsDynamoDbTableReplicaGlobalSecondaryIndex
@generate(
query: { get: false, query: true, aggregate: false }
mutation: { add: false, delete: false }
Expand All @@ -107,7 +107,7 @@ type awsDynamoDbTableReplicaGlobalSecondaryIndexDescription
readCapacityUnits: Int @search
}

type awsDynamoDbTableAutoScalingPolicyDescription
type awsDynamoDbTableAutoScalingPolicy
@generate(
query: { get: false, query: true, aggregate: false }
mutation: { add: false, delete: false }
Expand All @@ -121,7 +121,7 @@ type awsDynamoDbTableAutoScalingPolicyDescription
targetValue: Int @search
}

type awsDynamoDbTableAutoScalingSettingsDescription
type awsDynamoDbTableAutoScalingSettings
@generate(
query: { get: false, query: true, aggregate: false }
mutation: { add: false, delete: false }
Expand All @@ -131,7 +131,7 @@ type awsDynamoDbTableAutoScalingSettingsDescription
maximumUnits: Int @search
autoScalingDisabled: Boolean @search
autoScalingRoleArn: String @search(by: [hash, regexp])
scalingPolicies: [awsDynamoDbTableAutoScalingPolicyDescription]
scalingPolicies: [awsDynamoDbTableAutoScalingPolicy]
}

type awsDynamoDbTableReplicaDescription
Expand All @@ -147,10 +147,10 @@ type awsDynamoDbTableReplicaDescription
statusPercentProgress: String @search(by: [hash, regexp])
kmsMasterKeyId: String @search(by: [hash, regexp])
readCapacityUnits: Int @search
globalSecondaryIndexes: [awsDynamoDbTableReplicaGlobalSecondaryIndexDescription]
globalSecondaryIndexes: [awsDynamoDbTableReplicaGlobalSecondaryIndex]
replicaInaccessibleDateTime: String @search(by: [hash, regexp])
provisionedReadCapacityAutoScalingSettings: awsDynamoDbTableAutoScalingSettingsDescription
provisionedWriteCapacityAutoScalingSettings: awsDynamoDbTableAutoScalingSettingsDescription
provisionedReadCapacityAutoScalingSettings: awsDynamoDbTableAutoScalingSettings
provisionedWriteCapacityAutoScalingSettings: awsDynamoDbTableAutoScalingSettings
}

type awsDynamoDbTableRestoreSummary
Expand Down Expand Up @@ -181,16 +181,16 @@ type awsDynamoDbTable implements awsBaseService @key(fields: "arn") {
attributes: [awsDynamoDbTableAttributes]
billingModeSummary: awsDynamoDbTableBillingSummary
creationDate: String! @search(by: [hash, regexp])
globalIndexes: [awsDynamoDbTableGlobalSecondaryIndexDescription]
globalIndexes: [awsDynamoDbTableGlobalSecondaryIndex]
globalTableVersion: String @search(by: [hash, regexp])
itemCount: Int @search
keySchema: [awsDynamoDbTableIndexKeySchema]
latestStreamArn: String @search(by: [hash, regexp])
latestStreamLabel: String @search(by: [hash, regexp])
localIndexes: [awsDynamoDbTableLocalSecondaryIndexDescription]
localIndexes: [awsDynamoDbTableLocalSecondaryIndex]
name: String @search(by: [hash, regexp])
pointInTimeRecoveryEnabled: Boolean
provisionedThroughput: awsDynamoDbTableProvisionedThroughputDescription
provisionedThroughput: awsDynamoDbTableProvisionedThroughput
replicas: [awsDynamoDbTableReplicaDescription]
restoreSummary: awsDynamoDbTableRestoreSummary
sizeInBytes: Int64 @search
Expand Down
2 changes: 1 addition & 1 deletion src/services/elastiCacheCluster/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default ({
engineVersion: pendingModifiedValues?.EngineVersion,
cacheNodeType: pendingModifiedValues?.CacheNodeType,
authTokenStatus: pendingModifiedValues?.AuthTokenStatus,
logDeliveryConfigurations:
logDeliveryConfigs:
pendingModifiedValues?.LogDeliveryConfigurations?.map(config => ({
id: generateUniqueId({
arn,
Expand Down
2 changes: 1 addition & 1 deletion src/services/elastiCacheCluster/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type awsElastiCachePendingModifiedValues
engineVersion: String @search(by: [hash, regexp])
cacheNodeType: String @search(by: [hash, regexp])
authTokenStatus: String @search(by: [hash, regexp])
logDeliveryConfigurations: [awsElastiCachePendingLogDeliveryConfiguration]
logDeliveryConfigs: [awsElastiCachePendingLogDeliveryConfig]
}

type awsElastiCacheNotificationConfiguration
Expand Down
8 changes: 4 additions & 4 deletions src/services/elastiCacheReplicationGroup/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type awsElastiCacheReplicationGroup implements awsBaseService
description: String @search(by: [hash, regexp])
globalReplicationGroupInfo: awsElastiCacheGlobalReplicationGroupInfo
status: String @search(by: [hash, regexp])
pendingModifiedValues: awsElastiCacheReplicationGroupPendingModifiedValues
pendingModifiedValues: awsElastiCachePendingModValues
memberClusters: [String] @search(by: [hash])
nodeGroups: [awsElastiCacheNodeGroup]
snapshottingClusterId: String @search(by: [hash])
Expand Down Expand Up @@ -37,7 +37,7 @@ type awsElastiCacheGlobalReplicationGroupInfo
globalReplicationGroupMemberRole: String @search(by: [hash, regexp])
}

type awsElastiCacheReplicationGroupPendingModifiedValues
type awsElastiCachePendingModValues
@generate(
query: { get: false, query: true, aggregate: false }
mutation: { add: false, delete: false }
Expand All @@ -48,7 +48,7 @@ type awsElastiCacheReplicationGroupPendingModifiedValues
resharding: awsElastiCacheReshardingStatus
authTokenStatus: String @search(by: [hash, regexp])
userGroups: awsElastiCacheUserGroupsUpdateStatus
logDeliveryConfigurations: [awsElastiCachePendingLogDeliveryConfiguration]
logDeliveryConfigurations: [awsElastiCachePendingLogDeliveryConfig]
}

type awsElastiCacheReshardingStatus
Expand Down Expand Up @@ -79,7 +79,7 @@ type awsElastiCacheUserGroupsUpdateStatus
userGroupIdsToRemove: [String] @search(by: [hash])
}

type awsElastiCachePendingLogDeliveryConfiguration
type awsElastiCachePendingLogDeliveryConfig
@generate(
query: { get: false, query: true, aggregate: false }
mutation: { add: false, delete: false }
Expand Down
6 changes: 3 additions & 3 deletions src/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { loadFilesSync } from '@graphql-tools/load-files'
import { mergeTypeDefs } from '@graphql-tools/merge'
import AWS, { Config } from 'aws-sdk'
import chalk from 'chalk'
import { print } from 'graphql'
import { DocumentNode } from 'graphql'
import STS from 'aws-sdk/clients/sts'
import { isEmpty, merge } from 'lodash'
import path from 'path'
Expand Down Expand Up @@ -438,12 +438,12 @@ export default class Provider extends CloudGraph.Client {
* getSchema is used to get the schema for provider
* @returns A string of graphql sub schemas
*/
getSchema(): string {
getSchema(): DocumentNode {
const typesArray = loadFilesSync(path.join(__dirname), {
recursive: true,
extensions: ['graphql'],
})
return print(mergeTypeDefs(typesArray))
return mergeTypeDefs(typesArray)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/services/systemsManagerInstance/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default ({
computerName,
associationOverview: {
detailedStatus,
instanceAssociationStatusAggregatedCount:
ssmAssociationAggCount:
mappedInstanceAssociationStatusAggregatedCount,
},
complianceItems: mappedComplianceItems,
Expand Down
6 changes: 3 additions & 3 deletions src/services/systemsManagerInstance/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ type awsSystemsManagerInstance implements awsBaseService @key(fields: "arn") {
lastSuccessfulAssociationExecutionDate: DateTime @search(by: [day])
ipAddress: String @search(by: [hash, regexp])
computerName: String @search(by: [hash, regexp])
associationOverview: systemsManagerInstanceAssociationOverview
associationOverview: systemsManagerInstanceAssociation
complianceItems: [systemsManagerInstanceComplianceItem]
sourceId: String @search(by: [hash, regexp])
sourceType: String @search(by: [hash, regexp])
iamRole: [awsIamRole] @hasInverse(field: systemsManagerInstances)
ec2Instance: [awsEc2] @hasInverse(field: systemsManagerInstance)
}

type systemsManagerInstanceAssociationOverview {
type systemsManagerInstanceAssociation {
detailedStatus: String @search(by: [hash, regexp])
instanceAssociationStatusAggregatedCount: [ssmAssociationOverviewAggregatedCount]
ssmAssociationAggCount: [ssmAssociationOverviewAggregatedCount]
}

type ssmAssociationOverviewAggregatedCount {
Expand Down
4 changes: 2 additions & 2 deletions src/services/wafV2WebAcl/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type awsWafV2Statement {
geoMatchStatement: awsWafV2StatementGeoMatchStatement
ruleGroupReferenceStatement: awsWafV2StatementRuleGroupReferenceStatement
iPSetReferenceStatement: awsWafV2StatementIpSetReferenceStatement
regexPatternSetReferenceStatement: awsWafV2StatementRegrexPatternSetReferenceStatement
regexPatternSetReferenceStatement: awsWafV2StatementRegrexPattern
rateBasedStatement: awsWafV2StatementRateBasedStatement
andStatement: awsWafV2StatementAndStatement
orStatement: awsWafV2StatementOrStatement
Expand Down Expand Up @@ -144,7 +144,7 @@ type awsWafV2StatementIpSetReferenceStatement {
iPSetForwardedIPConfig: awsWafV2IPSetForwardedIPConfig
}

type awsWafV2StatementRegrexPatternSetReferenceStatement {
type awsWafV2StatementRegrexPattern {
arn: String @search(by: [hash, regexp])
fieldToMatch: awsWafV2FieldToMatch
textTransformations: [awsWafV2TextTransformation]
Expand Down
Loading