Skip to content

Commit

Permalink
Merge pull request #399 from aws-solutions/create-sdk
Browse files Browse the repository at this point in the history
add JavaScript sdk
  • Loading branch information
svozza authored Mar 29, 2023
2 parents e00e59e + 991836b commit 7762d13
Show file tree
Hide file tree
Showing 18 changed files with 10,457 additions and 15 deletions.
6 changes: 6 additions & 0 deletions deployment/run-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ echo "--------------------------------------------------------------------------
cd $source_dir/backend/functions/settings
npm run test:ci

echo "------------------------------------------------------------------------------"
echo "[Test] JavaScript SDK"
echo "------------------------------------------------------------------------------"
cd $source_dir/sdk/js
npm run test:ci

echo "------------------------------------------------------------------------------"
echo "[Test] UI"
echo "------------------------------------------------------------------------------"
Expand Down
30 changes: 15 additions & 15 deletions source/backend/graphql/schema/perspective-api.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -114,30 +114,30 @@ type UnprocessedResources @aws_iam {
unprocessedResources: [String]
}

type ResourceCount {
type ResourceCount @aws_cognito_user_pools @aws_iam {
count: Int
type: String
}

type ResourceRegionCount {
type ResourceRegionCount @aws_cognito_user_pools @aws_iam {
count: Int
name: String
resourceTypes: [ResourceCount]
}

type ResourcesMetadata {
type ResourcesMetadata @aws_cognito_user_pools @aws_iam {
count: Int
accounts: [Account]
resourceTypes: [ResourceCount]
}

type ResourcesAccountMetadata {
type ResourcesAccountMetadata @aws_cognito_user_pools @aws_iam {
accountId: String
count: Int
resourceTypes: [ResourceCount]
}

type ResourcesRegionMetadata {
type ResourcesRegionMetadata @aws_cognito_user_pools @aws_iam {
accountId: String
count: Int
regions: [ResourceRegionCount]
Expand Down Expand Up @@ -220,22 +220,22 @@ type Query {
# support default parameters yet.
getRelationships(pagination: Pagination): [Relationship] @aws_iam
# Gets a list of related nodes and a list of the edges between them from the supplied ids
getResourceGraph(ids: [String]!, pagination: Pagination): getResourceGraphResponse
getResourceGraph(ids: [String]!, pagination: Pagination): getResourceGraphResponse @aws_cognito_user_pools @aws_iam
# Gets the children of the node with the supplied id
getLinkedNodesHierarchy(id: String!): Hierarchy
# For each supplied id, gets the children of the node with that id
batchGetLinkedNodesHierarchy(ids: [String]!): BatchHierarchyResponse
# Get resource counts broken down by resource type and a list of all accounts and
# associated regions.
getResourcesMetadata: ResourcesMetadata
getResourcesMetadata: ResourcesMetadata @aws_cognito_user_pools @aws_iam
# Get resource counts broken down by account. If accounts is absent then all
# accounts will be returned
getResourcesAccountMetadata(accounts: [AccountInput]): [ResourcesAccountMetadata]
getResourcesAccountMetadata(accounts: [AccountInput]): [ResourcesAccountMetadata] @aws_cognito_user_pools @aws_iam
# Get resource counts broken down by account and region. If accounts is absent then
# all accounts will be returned
getResourcesRegionMetadata(accounts: [AccountInput]): [ResourcesRegionMetadata]
getResourcesRegionMetadata(accounts: [AccountInput]): [ResourcesRegionMetadata] @aws_cognito_user_pools @aws_iam
# Gets a single account and the regions that are being scanned
getAccount(accountId: String!): Account
getAccount(accountId: String!): Account @aws_cognito_user_pools @aws_iam
# Gets each account and its associated regions that are being scanned
getAccounts: [Account] @aws_cognito_user_pools @aws_iam
# Read another set of results from the S3 Athena results
Expand All @@ -257,14 +257,14 @@ type Query {
costForResourceQueryByDay: CostForResourceQueryByDay
): Cost @aws_cognito_user_pools @aws_iam
# Gets global template for account importing
getGlobalTemplate: String
getGlobalTemplate: String @aws_cognito_user_pools @aws_iam
# Gets regional template for account importing
getRegionalTemplate: String
getRegionalTemplate: String @aws_cognito_user_pools @aws_iam
# Gets resources based on string search text
searchResources(text: String!
pagination: Pagination
resourceTypes: [String]
accounts: [AccountInput]): ResourcesResponse
accounts: [AccountInput]): ResourcesResponse @aws_cognito_user_pools @aws_iam
# Export a diagram to draw.io
exportToDrawIo(nodes: [drawIoNodeInput], edges: [drawIoEdgeInput]) : String
}
Expand All @@ -274,7 +274,7 @@ type ResourcesResponse @aws_cognito_user_pools @aws_iam {
resources: [Resource]
}

type getResourceGraphResponse {
type getResourceGraphResponse @aws_cognito_user_pools @aws_iam {
nodes: [Resource]!
edges: [Relationship]!
}
Expand Down Expand Up @@ -361,7 +361,7 @@ input Pagination {
end: Int!
}

type PaginationType {
type PaginationType @aws_cognito_user_pools @aws_iam {
# The item number to start from in the Athena query results CSV
start: Int!
# The item number to end on in the Athena query results CSV
Expand Down
8 changes: 8 additions & 0 deletions source/cfn/templates/main.template
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,14 @@ Resources:

Outputs:

AppSyncArn:
Value: !GetAtt AppSyncApiStack.Outputs.AppSyncApiArn
Description: AppSync API ARN

AppSyncApiUrl:
Value: !GetAtt AppSyncApiStack.Outputs.AppSyncApiUrl
Description: AppSync API URL

WebUiUrl:
Value: !GetAtt WebUiStack.Outputs.WebUiUrl
Description: WebUI URL
Loading

0 comments on commit 7762d13

Please sign in to comment.