Skip to content
Merged
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
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]`

Expand Down Expand Up @@ -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]`

Expand Down Expand Up @@ -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]`

Expand Down Expand Up @@ -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]`

Expand Down Expand Up @@ -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]`

Expand Down Expand Up @@ -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]`

Expand Down Expand Up @@ -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]`

Expand All @@ -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]`

Expand Down Expand Up @@ -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)_
<!-- commandsstop -->
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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",
Expand Down
17 changes: 14 additions & 3 deletions src/commands/scan.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -305,7 +316,7 @@ export default class Scan extends Command {
isRunning: storageRunning,
engine: storageEngine,
},
providerData: allProviderData
providerData: allProviderData,
})
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down