@adobe/aio-lib-cloudmanager
Advanced tools
Comparing version 0.3.2 to 0.3.3
# Changelog | ||
## [0.3.3](https://github.com/adobe/aio-lib-cloudmanager/compare/0.3.2...0.3.3) (2021-04-30) | ||
### Bug Fixes | ||
* **logs:** correct error handling in _getLogs. fixes [#114](https://github.com/adobe/aio-lib-cloudmanager/issues/114) ([#115](https://github.com/adobe/aio-lib-cloudmanager/issues/115)) ([5ad7712](https://github.com/adobe/aio-lib-cloudmanager/commit/5ad77127de0d2c457f8b7e3eaa8cfcb286c52cce)) | ||
## [0.3.2](https://github.com/adobe/aio-lib-cloudmanager/compare/0.3.1...0.3.2) (2021-04-01) | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "@adobe/aio-lib-cloudmanager", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "Adobe I/O Cloud Manager Library", | ||
@@ -39,4 +39,4 @@ "repository": { | ||
"@adobe/eslint-config-aio-lib-config": "1.2.1", | ||
"@commitlint/cli": "12.0.1", | ||
"@commitlint/config-conventional": "12.0.1", | ||
"@commitlint/cli": "12.1.1", | ||
"@commitlint/config-conventional": "12.1.1", | ||
"@semantic-release/changelog": "5.0.1", | ||
@@ -48,15 +48,15 @@ "@semantic-release/git": "9.0.0", | ||
"eol": "0.9.1", | ||
"eslint": "7.23.0", | ||
"eslint": "7.25.0", | ||
"eslint-config-standard": "16.0.2", | ||
"eslint-plugin-import": "2.22.1", | ||
"eslint-plugin-jest": "24.3.2", | ||
"eslint-plugin-jsdoc": "32.3.0", | ||
"eslint-plugin-jest": "24.3.6", | ||
"eslint-plugin-jsdoc": "33.0.0", | ||
"eslint-plugin-node": "11.1.0", | ||
"eslint-plugin-promise": "4.3.1", | ||
"eslint-plugin-promise": "5.1.0", | ||
"eslint-plugin-standard": "4.1.0", | ||
"fetch-mock": "9.10.1", | ||
"fetch-mock": "9.11.0", | ||
"husky": "5.2.0", | ||
"jest": "26.6.3", | ||
"jest-junit": "12.0.0", | ||
"js-yaml": "4.0.0", | ||
"js-yaml": "4.1.0", | ||
"jscpd": "3.3.25", | ||
@@ -63,0 +63,0 @@ "jsdoc": "3.6.6", |
@@ -800,4 +800,5 @@ <!-- | ||
| name | <code>string</code> | Name of the variable. Of a-z, A-Z, _ and 0-9 Cannot begin with a number. | | ||
| value | <code>string</code> | Value of the variable. Read-Write for non-secrets, write-only for secrets. | | ||
| value | <code>string</code> | Value of the variable. Read-Write for non-secrets, write-only for secrets. The length of `secretString` values must be less than 500 characters. | | ||
| type | <code>string</code> | Type of the variable. Default `string` if missing. `secretString` variables are encrypted at rest. The type of a variable be changed after creation; the variable must be deleted and recreated. | | ||
| service | <code>string</code> | Service of the variable. When not provided, the variable applies to all services. Currently only the values 'author' and 'publish' are supported. Note - this value is case-sensitive. | | ||
@@ -804,0 +805,0 @@ <a name="LogOptionRepresentation"></a> |
@@ -634,3 +634,3 @@ /* | ||
if (!environment.link(rels.logs)) { | ||
throw new Error(`Could not find logs link for environment ${environment.id} for program ${environment.programId}`) | ||
throw new codes.ERROR_FIND_LOGS_LINK_ENVIRONMENT({ messageValues: [environment.id, environment.programId] }) | ||
} | ||
@@ -640,5 +640,6 @@ const logsTemplate = UriTemplate.parse(environment.link(rels.logs).href) | ||
return this._get(logsLink).then((res) => { | ||
if (res.ok) return res.json() | ||
else throw new Error(`Cannot get logs: ${res.url} (${res.status} ${res.statusText})`) | ||
return this._get(logsLink, codes.ERROR_GET_LOGS).then(res => { | ||
return res.json() | ||
}, e => { | ||
throw e | ||
}) | ||
@@ -645,0 +646,0 @@ } |
@@ -84,2 +84,4 @@ /* | ||
E('ERROR_FIND_LOGS', 'No logs available in %s for program %s') | ||
E('ERROR_FIND_LOGS_LINK_ENVIRONMENT', 'Could not find logs link for environment %s for program %s.') | ||
E('ERROR_GET_LOGS', 'Cannot get logs: %s.') | ||
E('ERROR_NO_BUILD_PHASE', 'Pipeline %s does not appear to have a build phase.') | ||
@@ -86,0 +88,0 @@ E('ERROR_NO_DEVELOPER_CONSOLE', 'Environment %s does not appear to support Developer Console.') |
@@ -138,4 +138,5 @@ /* | ||
* @property {string} name - Name of the variable. Of a-z, A-Z, _ and 0-9 Cannot begin with a number. | ||
* @property {string} value - Value of the variable. Read-Write for non-secrets, write-only for secrets. | ||
* @property {string} value - Value of the variable. Read-Write for non-secrets, write-only for secrets. The length of `secretString` values must be less than 500 characters. | ||
* @property {string} type - Type of the variable. Default `string` if missing. `secretString` variables are encrypted at rest. The type of a variable be changed after creation; the variable must be deleted and recreated. | ||
* @property {string} service - Service of the variable. When not provided, the variable applies to all services. Currently only the values 'author' and 'publish' are supported. Note - this value is case-sensitive. | ||
*/ | ||
@@ -142,0 +143,0 @@ |
@@ -228,2 +228,6 @@ /* | ||
}, | ||
'http://ns.adobe.com/adobecloud/rel/logs': { | ||
href: '/api/program/4/environment/3/logs?service={service}&name={name}&days={days}', | ||
templated: true, | ||
}, | ||
}, | ||
@@ -388,2 +392,3 @@ id: '3', | ||
}) | ||
fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/3/logs?service=author&name=aemerror&days=1', 404) | ||
fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/environment/1/variables', { | ||
@@ -390,0 +395,0 @@ _links: { |
@@ -31,3 +31,3 @@ | ||
test('download-logs - failure', async () => { | ||
test('download-logs - failure -- no environment', async () => { | ||
expect.assertions(2) | ||
@@ -44,2 +44,26 @@ | ||
test('download-logs - failure -- no link', async () => { | ||
expect.assertions(2) | ||
const sdkClient = await createSdkClient() | ||
const result = sdkClient.downloadLogs('4', '2', 'author', 'aemerror') | ||
await expect(result instanceof Promise).toBeTruthy() | ||
await expect(result).rejects.toEqual( | ||
new codes.ERROR_FIND_LOGS_LINK_ENVIRONMENT({ messageValues: ['2', '4'] }), | ||
) | ||
}) | ||
test('download-logs - failure -- logs link 404', async () => { | ||
expect.assertions(2) | ||
const sdkClient = await createSdkClient() | ||
const result = sdkClient.downloadLogs('4', '3', 'author', 'aemerror', '1') | ||
await expect(result instanceof Promise).toBeTruthy() | ||
await expect(result).rejects.toEqual( | ||
new codes.ERROR_GET_LOGS({ messageValues: ['https://cloudmanager.adobe.io/api/program/4/environment/3/logs?service=author&name=aemerror&days=1 (404 Not Found)'] }), | ||
) | ||
}) | ||
test('download-logs - success', async () => { | ||
@@ -46,0 +70,0 @@ expect.assertions(3) |
@@ -440,4 +440,5 @@ /** | ||
* @property name - Name of the variable. Of a-z, A-Z, _ and 0-9 Cannot begin with a number. | ||
* @property value - Value of the variable. Read-Write for non-secrets, write-only for secrets. | ||
* @property value - Value of the variable. Read-Write for non-secrets, write-only for secrets. The length of `secretString` values must be less than 500 characters. | ||
* @property type - Type of the variable. Default `string` if missing. `secretString` variables are encrypted at rest. The type of a variable be changed after creation; the variable must be deleted and recreated. | ||
* @property service - Service of the variable. When not provided, the variable applies to all services. Currently only the values 'author' and 'publish' are supported. Note - this value is case-sensitive. | ||
*/ | ||
@@ -448,2 +449,3 @@ declare type Variable = { | ||
type: string; | ||
service: string; | ||
}; | ||
@@ -450,0 +452,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1703581
6844
898