Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dynatrace-sdk/app-utils

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dynatrace-sdk/app-utils - npm Package Compare versions

Comparing version 0.4.3 to 0.5.0

6

CHANGELOG.md

@@ -5,2 +5,8 @@ # App Utils

## 0.5.0
### Minor Changes
- Use cause property to return whole Response when error occurs.
## 0.4.3

@@ -7,0 +13,0 @@

15

cjs/index.js

@@ -44,2 +44,11 @@ /**

var functions = {
/**
* A convenience layer for the user to communicate with an app function.
* @param functionName
* @param options Optional options
* @param options.data An Payload of the call
* @param options.abortSignal An AbortSignal to set request's signal
* @throws a common Error object with a CAUSE property that contains the whole response object
* @returns Response of a fetch call
*/
async call(functionName, options) {

@@ -51,5 +60,5 @@ const method = options?.data ? "POST" : "GET";

if (!response.ok) {
throw new Error(
`Function ${functionName} failed with error-code: ${response.status} ${response.statusText}`
);
throw new Error(`Function ${functionName} has failed`, {
cause: response
});
}

@@ -56,0 +65,0 @@ return response;

2

docs/DOCS.md

@@ -13,3 +13,3 @@

<div class="col" style={{textAlign: 'right'}}>
<a href="https://www.npmjs.com/package/@dynatrace-sdk/app-utils/v/0.4.3" target="_blank" rel="noopener noreferrer">v0.4.3</a>
<a href="https://www.npmjs.com/package/@dynatrace-sdk/app-utils/v/0.5.0" target="_blank" rel="noopener noreferrer">v0.5.0</a>
</div>

@@ -16,0 +16,0 @@ </div>

@@ -19,2 +19,11 @@ /**

var functions = {
/**
* A convenience layer for the user to communicate with an app function.
* @param functionName
* @param options Optional options
* @param options.data An Payload of the call
* @param options.abortSignal An AbortSignal to set request's signal
* @throws a common Error object with a CAUSE property that contains the whole response object
* @returns Response of a fetch call
*/
async call(functionName, options) {

@@ -26,5 +35,5 @@ const method = options?.data ? "POST" : "GET";

if (!response.ok) {
throw new Error(
`Function ${functionName} failed with error-code: ${response.status} ${response.statusText}`
);
throw new Error(`Function ${functionName} has failed`, {
cause: response
});
}

@@ -31,0 +40,0 @@ return response;

{
"name": "@dynatrace-sdk/app-utils",
"version": "0.4.3",
"version": "0.5.0",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "description": "Utilities for app function executions.",

@@ -11,2 +11,3 @@ /**

* @param options.abortSignal An AbortSignal to set request's signal
* @throws a common Error object with a CAUSE property that contains the whole response object
* @returns Response of a fetch call

@@ -13,0 +14,0 @@ */

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