@squaredup/plugin-common
v2.2.0
Published
Common functions that can be used by any plugin
Downloads
5,385
Keywords
Readme
Plugin-Common
This is a module that contains common functions that can be used by all SquaredUp Plugins.
Important to note the no future change can be allowed to break any existing functionality, versioning must be properly maintained in package.json.
Functions
collectSuccessfulResponses: Takes in a list of promises (usually API responses) and returns only the ones that were successful (deprecated)flattenObjectArrayProps: Flattens single-item array properties in an array of objects to a single non-array valuecategorizeObjectArrayByProp: Categorizes an array of objects into separate properties of an object based on a property on each objectcollectResponses: Takes in a list of promises (usually API responses) and returns information about successful and failed responsesprocessStandardDataStreamMessages: a helper routine to report errors returned by collectResponses() in a standard formatdeGremlin: a helper function to extract individual property values from a 'vertex', useflattenObjectArrayPropsfor full verticesgetBase64Auth: a helper function for encoding usernames and passwords to base64 for Authorization headerspageAPI: a helper function that generates functions that can be used to managepagingContextin import operationsisValidEdge: a helper function that validates whether an edge is in an appropriate format or notisValidVertex: a helper function that validates whether a vertex is in an appropriate format or notwarningTracker: a helper function that generates functions that can be used to track warnings sent to usersgeneratePkcePair: a helper function that generates a challenge code and verifier for use with PKCEgenerateAxiosRequestLogInterceptors: a helper function that generates interceptors for axios that log requests consistently- note that this does not prevent you from adding more interceptors to do something less generic later.
generateAxiosResponeLogInterceptors: a helper function that generates interceptors for axios that log responses consistently- note that this does not prevent you from adding more interceptors to do something less generic later.
