New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@adobe/aio-lib-cloudmanager

Package Overview
Dependencies
Maintainers
18
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adobe/aio-lib-cloudmanager - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

7

CHANGELOG.md
# Changelog
## [0.3.4](https://github.com/adobe/aio-lib-cloudmanager/compare/0.3.3...0.3.4) (2021-04-30)
### Bug Fixes
* **logs:** correct usage of error codes in _download. fixes [#116](https://github.com/adobe/aio-lib-cloudmanager/issues/116) ([#118](https://github.com/adobe/aio-lib-cloudmanager/issues/118)) ([06a5fbd](https://github.com/adobe/aio-lib-cloudmanager/commit/06a5fbd1b24870d556c8a09cc0a5cb4ef6d1c59f))
## [0.3.3](https://github.com/adobe/aio-lib-cloudmanager/compare/0.3.2...0.3.3) (2021-04-30)

@@ -4,0 +11,0 @@

2

package.json
{
"name": "@adobe/aio-lib-cloudmanager",
"version": "0.3.3",
"version": "0.3.4",
"description": "Adobe I/O Cloud Manager Library",

@@ -5,0 +5,0 @@ "repository": {

@@ -647,3 +647,3 @@ /*

async _download (href, outputPath, resultObject) {
const res = await this._get(href, 'Could not obtain download link')
const res = await this._get(href, codes.ERROR_GET_LOG)

@@ -654,4 +654,3 @@ const downloadUrl = res.url

if (!json || !json.redirect) {
logger.debug(json)
throw new Error(`Could not retrieve redirect from ${res.url} (${res.status} ${res.statusText})`)
throw new codes.ERROR_NO_LOG_REDIRECT({ messageValues: [res.url, JSON.stringify(json)] })
}

@@ -658,0 +657,0 @@

@@ -342,5 +342,56 @@ /*

fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/1/logs?service=publish&name=aemerror&days=1', {
fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/1/logs/download?service=author&name=aemerror&date=2019-09-8', {
redirect: 'https://filestore/logs/author_aemerror_2019-09-8.log.gz',
})
fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/1/logs/download?service=author&name=aemerror&date=2019-09-7', {
redirect: 'https://filestore/logs/author_aemerror_2019-09-7.log.gz',
})
fetchMock.mock('https://filestore/logs/author_aemerror_2019-09-8.log.gz', () => {
return new nodeFetch.Response(fs.createReadStream(path.join(__dirname, 'data/file.log.gz')))
})
fetchMock.mock('https://filestore/logs/author_aemerror_2019-09-7.log.gz', () => {
return new nodeFetch.Response(fs.createReadStream(path.join(__dirname, 'data/file.log.gz')))
})
fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/1/logs?service=publish&name=empty&days=1', {
_links: {
self: {
href: '/api/program/4/environment/1/logs?service=publish&name=empty&days=1',
},
'http://ns.adobe.com/adobecloud/rel/program': {
href: '/api/program/4',
templated: false,
},
'http://ns.adobe.com/adobecloud/rel/environment': {
href: '/api/program/4/environment/1',
templated: false,
},
},
service: ['publish'],
name: ['empty'],
days: 1,
_embedded: {
downloads: [
{
_links: {
'http://ns.adobe.com/adobecloud/rel/logs/download': {
href: '/api/program/4/environment/2/logs/download?service=publish&name=empty&date=2019-09-7',
templated: false,
},
},
service: 'publish',
name: 'aemerror',
date: '2019-09-8',
programId: 4,
environmentId: 2,
},
],
},
})
fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/2/logs/download?service=publish&name=empty&date=2019-09-7', {})
fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/1/logs?service=publish&name=aemerror&days=2', {
_links: {
self: {
href: '/api/program/4/environment/1/logs?service=publish&type=aemerror&days=1',

@@ -375,2 +426,15 @@ },

},
{
_links: {
'http://ns.adobe.com/adobecloud/rel/logs/download': {
href: '/api/program/4/environment/2/logs/download?service=publish&name=aemerror&date=2019-09-6',
templated: false,
},
},
service: 'publish',
name: 'aemerror',
date: '2019-09-7',
programId: 4,
environmentId: 2,
},
],

@@ -380,15 +444,79 @@ },

fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/1/logs/download?service=author&name=aemerror&date=2019-09-8', {
redirect: 'https://filestore/logs/author_aemerror_2019-09-8.log.gz',
fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/1/logs?service=publish&name=404&days=1', {
_links: {
self: {
href: '/api/program/4/environment/1/logs?service=publish&name=404&days=1',
},
'http://ns.adobe.com/adobecloud/rel/program': {
href: '/api/program/4',
templated: false,
},
'http://ns.adobe.com/adobecloud/rel/environment': {
href: '/api/program/4/environment/1',
templated: false,
},
},
service: ['publish'],
name: ['404'],
days: 1,
_embedded: {
downloads: [
{
_links: {
'http://ns.adobe.com/adobecloud/rel/logs/download': {
href: '/api/program/4/environment/2/logs/download?service=publish&name=404&date=2019-09-7',
templated: false,
},
},
service: 'publish',
name: '404',
date: '2019-09-8',
programId: 4,
environmentId: 2,
},
],
},
})
fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/1/logs/download?service=author&name=aemerror&date=2019-09-7', {
redirect: 'https://filestore/logs/author_aemerror_2019-09-7.log.gz',
})
fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/2/logs/download?service=publish&name=404&date=2019-09-7', 404)
fetchMock.mock('https://filestore/logs/author_aemerror_2019-09-8.log.gz', () => {
return new nodeFetch.Response(fs.createReadStream(path.join(__dirname, 'data/file.log.gz')))
fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/1/logs?service=publish&name=redirect_fails&days=1', {
_links: {
self: {
href: '/api/program/4/environment/1/logs?service=publish&name=404&days=1',
},
'http://ns.adobe.com/adobecloud/rel/program': {
href: '/api/program/4',
templated: false,
},
'http://ns.adobe.com/adobecloud/rel/environment': {
href: '/api/program/4/environment/1',
templated: false,
},
},
service: ['publish'],
name: ['redirect_fails'],
days: 1,
_embedded: {
downloads: [
{
_links: {
'http://ns.adobe.com/adobecloud/rel/logs/download': {
href: '/api/program/4/environment/2/logs/download?service=publish&name=redirect_fails&date=2019-09-7',
templated: false,
},
},
service: 'publish',
name: '404',
date: '2019-09-8',
programId: 4,
environmentId: 2,
},
],
},
})
fetchMock.mock('https://filestore/logs/author_aemerror_2019-09-7.log.gz', () => {
return new nodeFetch.Response(fs.createReadStream(path.join(__dirname, 'data/file.log.gz')))
fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/2/logs/download?service=publish&name=redirect_fails&date=2019-09-7', {
redirect: 'https://filestore/logs/bad.log.gz',
})
fetchMock.mock('https://filestore/logs/bad.log.gz', 404)
fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/3/logs?service=author&name=aemerror&days=1', 404)

@@ -395,0 +523,0 @@ fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/1/variables', {

@@ -82,1 +82,37 @@

})
test('download-logs - failure - download url is empty object', async () => {
expect.assertions(2)
const sdkClient = await createSdkClient()
const result = sdkClient.downloadLogs('4', '1', 'publish', 'empty', '1', outputDirectory)
await expect(result instanceof Promise).toBeTruthy()
await expect(result).rejects.toEqual(
new codes.ERROR_NO_LOG_REDIRECT({ messageValues: ['https://cloudmanager.adobe.io/api/program/4/environment/2/logs/download?service=publish&name=empty&date=2019-09-7', '{}'] }),
)
})
test('download-logs - failure - download url return 404', async () => {
expect.assertions(2)
const sdkClient = await createSdkClient()
const result = sdkClient.downloadLogs('4', '1', 'publish', '404', '1', outputDirectory)
await expect(result instanceof Promise).toBeTruthy()
await expect(result).rejects.toEqual(
new codes.ERROR_GET_LOG({ messageValues: ['https://cloudmanager.adobe.io/api/program/4/environment/2/logs/download?service=publish&name=404&date=2019-09-7 (404 Not Found)'] }),
)
})
test('download-logs - failure - redirect url return 404', async () => {
expect.assertions(2)
const sdkClient = await createSdkClient()
const result = sdkClient.downloadLogs('4', '1', 'publish', 'redirect_fails', '1', outputDirectory)
await expect(result instanceof Promise).toBeTruthy()
await expect(result).rejects.toEqual(
new codes.ERROR_LOG_DOWNLOAD({ messageValues: ['https://filestore/logs/bad.log.gz', './log-output/1-publish-404-2019-09-8.log', '404', 'Not Found'] }),
)
})
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