diff --git a/CHANGELOG.md b/CHANGELOG.md index 529e547..0531774 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +# [0.25.0-beta.1](https://github.com/cloudgraphdev/cli/compare/0.24.0...0.25.0-beta.1) (2022-12-08) + + +### Features + +* **cli:** convert ASTNode to string since now providers return raw schemas instead of strings ([55e6468](https://github.com/cloudgraphdev/cli/commit/55e646870e222c90a6218e2701d53ffe864a5c99)) +* **cli:** handle provider schema type ([074b03e](https://github.com/cloudgraphdev/cli/commit/074b03ef1d1d7e23ccb01c234050741311aee9d6)) +* **cli:** Updated sdk version ([1f02b6c](https://github.com/cloudgraphdev/cli/commit/1f02b6c743bca6cbbdba982c5980b174ca2624be)) + +# [0.25.0-alpha.1](https://github.com/cloudgraphdev/cli/compare/0.24.0...0.25.0-alpha.1) (2022-12-08) + + +### Features + +* **cli:** convert ASTNode to string since now providers return raw schemas instead of strings ([55e6468](https://github.com/cloudgraphdev/cli/commit/55e646870e222c90a6218e2701d53ffe864a5c99)) +* **cli:** handle provider schema type ([074b03e](https://github.com/cloudgraphdev/cli/commit/074b03ef1d1d7e23ccb01c234050741311aee9d6)) +* **cli:** Updated sdk version ([1f02b6c](https://github.com/cloudgraphdev/cli/commit/1f02b6c743bca6cbbdba982c5980b174ca2624be)) + # [0.24.0](https://github.com/cloudgraphdev/cli/compare/0.23.1...0.24.0) (2022-08-05) diff --git a/README.md b/README.md index aff91ec..6e2ded1 100644 --- a/README.md +++ b/README.md @@ -1450,7 +1450,7 @@ EXAMPLES $ cg init aws -r [Specify resources to crawl] ``` -_See code: [src/commands/init.ts](https://github.com/cloudgraphdev/cli/blob/v0.24.0/src/commands/init.ts)_ +_See code: [src/commands/init.ts](https://github.com/cloudgraphdev/cli/blob/v0.25.0-beta.1/src/commands/init.ts)_ ## `cg launch [PROVIDER]` @@ -1482,7 +1482,7 @@ EXAMPLES $ cg launch ``` -_See code: [src/commands/launch.ts](https://github.com/cloudgraphdev/cli/blob/v0.24.0/src/commands/launch.ts)_ +_See code: [src/commands/launch.ts](https://github.com/cloudgraphdev/cli/blob/v0.25.0-beta.1/src/commands/launch.ts)_ ## `cg load [PROVIDER]` @@ -1516,7 +1516,7 @@ EXAMPLES $ cg load aws [Load data for AWS] ``` -_See code: [src/commands/load.ts](https://github.com/cloudgraphdev/cli/blob/v0.24.0/src/commands/load.ts)_ +_See code: [src/commands/load.ts](https://github.com/cloudgraphdev/cli/blob/v0.25.0-beta.1/src/commands/load.ts)_ ## `cg policy [PROVIDER]` @@ -1545,7 +1545,7 @@ DESCRIPTION Commands to manage policy pack modules, run $ cg policy for more info. ``` -_See code: [src/commands/policy/index.ts](https://github.com/cloudgraphdev/cli/blob/v0.24.0/src/commands/policy/index.ts)_ +_See code: [src/commands/policy/index.ts](https://github.com/cloudgraphdev/cli/blob/v0.25.0-beta.1/src/commands/policy/index.ts)_ ## `cg policy add [PROVIDER]` @@ -1758,7 +1758,7 @@ DESCRIPTION Commands to manage provider modules, run $ cg provider for more info. ``` -_See code: [src/commands/provider/index.ts](https://github.com/cloudgraphdev/cli/blob/v0.24.0/src/commands/provider/index.ts)_ +_See code: [src/commands/provider/index.ts](https://github.com/cloudgraphdev/cli/blob/v0.25.0-beta.1/src/commands/provider/index.ts)_ ## `cg provider add [PROVIDER]` @@ -1980,7 +1980,7 @@ EXAMPLES $ cg scan aws --no-serve [Do not start the query engine] ``` -_See code: [src/commands/scan.ts](https://github.com/cloudgraphdev/cli/blob/v0.24.0/src/commands/scan.ts)_ +_See code: [src/commands/scan.ts](https://github.com/cloudgraphdev/cli/blob/v0.25.0-beta.1/src/commands/scan.ts)_ ## `cg serve [PROVIDER]` @@ -2012,7 +2012,7 @@ EXAMPLES $ cg serve ``` -_See code: [src/commands/serve.ts](https://github.com/cloudgraphdev/cli/blob/v0.24.0/src/commands/serve.ts)_ +_See code: [src/commands/serve.ts](https://github.com/cloudgraphdev/cli/blob/v0.25.0-beta.1/src/commands/serve.ts)_ ## `cg teardown [PROVIDER]` @@ -2034,7 +2034,7 @@ EXAMPLES $ cg teardown --delete-image ``` -_See code: [src/commands/teardown.ts](https://github.com/cloudgraphdev/cli/blob/v0.24.0/src/commands/teardown.ts)_ +_See code: [src/commands/teardown.ts](https://github.com/cloudgraphdev/cli/blob/v0.25.0-beta.1/src/commands/teardown.ts)_ ## `cg update [PROVIDER]` @@ -2070,5 +2070,5 @@ EXAMPLES $ cg update ``` -_See code: [src/commands/update.ts](https://github.com/cloudgraphdev/cli/blob/v0.24.0/src/commands/update.ts)_ +_See code: [src/commands/update.ts](https://github.com/cloudgraphdev/cli/blob/v0.25.0-beta.1/src/commands/update.ts)_ diff --git a/package.json b/package.json index 3ec55b3..2dc9ef0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@cloudgraph/cli", "description": "Scan your cloud infrastructure data and query it with GraphQL", - "version": "0.24.0", + "version": "0.25.0-beta.1", "author": "AutoCloud", "license": "MPL-2.0", "publishConfig": { @@ -15,7 +15,7 @@ }, "bugs": "https://github.com/cloudgraphdev/cli/issues", "dependencies": { - "@cloudgraph/sdk": "^0.21.1", + "@cloudgraph/sdk": "^0.22.0", "@graphql-tools/load-files": "^6.3.2", "@graphql-tools/merge": "^8.2.0", "@oclif/core": "1.6.1", diff --git a/src/commands/scan.ts b/src/commands/scan.ts index 2812b4c..bc73701 100644 --- a/src/commands/scan.ts +++ b/src/commands/scan.ts @@ -1,8 +1,15 @@ import chalk from 'chalk' import fs from 'fs' import path from 'path' -import { Opts, pluginMap, PluginType, ProviderData, StorageEngine } from '@cloudgraph/sdk' +import { + Opts, + pluginMap, + PluginType, + ProviderData, + StorageEngine, +} from '@cloudgraph/sdk' import { range } from 'lodash' +import { print } from 'graphql' import Command from './base' import { fileUtils } from '../utils' @@ -217,7 +224,11 @@ export default class Scan extends Command { provider )}` ) - const providerSchema: string = providerClient.getSchema() + + const rawSchema = providerClient.getSchema() + const providerSchema: string = + typeof rawSchema === 'object' ? print(rawSchema) : rawSchema + if (!providerSchema) { this.logger.warn(`No schema found for ${provider}, moving on`) continue // eslint-disable-line no-continue @@ -305,7 +316,7 @@ export default class Scan extends Command { isRunning: storageRunning, engine: storageEngine, }, - providerData: allProviderData + providerData: allProviderData, }) } diff --git a/yarn.lock b/yarn.lock index 4a5d3a2..eda6de3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -379,10 +379,10 @@ resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@cloudgraph/sdk@^0.21.1": - version "0.21.1" - resolved "https://registry.yarnpkg.com/@cloudgraph/sdk/-/sdk-0.21.1.tgz#bb4c0243d73bbc98c4bd0c7d04379e0fac309b2d" - integrity sha512-CHNIwkcfuNXify4nAp3wFYTW7sRGhzTu1haolQmihx+19mEc7WJuGV9wtZBlCIL+bctm8FoIVWDPShKuLHseWA== +"@cloudgraph/sdk@^0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@cloudgraph/sdk/-/sdk-0.22.0.tgz#c2a4e817a70ae9b123e0fcd401d55f79e24386ab" + integrity sha512-EJ7vLgrMRh52tOH14TKHgOI62BYy9ZH4WuEhcVr8S8RDnLxBO1XsXOKKjIsE+SmawMBzck8qxiEKttppalhJ8g== dependencies: "@graphql-tools/load-files" "^6.5.3" "@graphql-tools/merge" "^8.2.1"