Socket
Socket
Sign inDemoInstall

@prismatic-io/spectral

Package Overview
Dependencies
Maintainers
6
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prismatic-io/spectral - npm Package Compare versions

Comparing version 7.7.0 to 7.8.0-preview2

dist/types/TriggerEventFunction.d.ts

8

dist/clients/http/inputs.js

@@ -91,3 +91,3 @@ "use strict";

required: false,
comments: "The maximum number of retries to attempt.",
comments: "The maximum number of retries to attempt. Specify 0 for no retries.",
default: "0",

@@ -101,3 +101,3 @@ clean: (value) => __1.util.types.toNumber(value),

required: false,
comments: "The delay in milliseconds between retries.",
comments: "The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled.",
default: "0",

@@ -111,3 +111,3 @@ clean: (value) => __1.util.types.toNumber(value, 0),

required: false,
comments: "Specifies whether to use a pre-defined exponential backoff strategy for retries.",
comments: "Specifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored.",
clean: (value) => __1.util.types.toBool(value),

@@ -120,3 +120,3 @@ });

required: false,
comments: "If true, retries on all erroneous responses regardless of type.",
comments: "If true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors.",
clean: (value) => __1.util.types.toBool(value),

@@ -123,0 +123,0 @@ });

@@ -35,9 +35,22 @@ "use strict";

const convertTrigger = (triggerKey, _a, hooks) => {
var { inputs = {}, perform } = _a, trigger = __rest(_a, ["inputs", "perform"]);
var { inputs = {}, perform, onInstanceDeploy, onInstanceDelete } = _a, trigger = __rest(_a, ["inputs", "perform", "onInstanceDeploy", "onInstanceDelete"]);
const convertedInputs = Object.entries(inputs).map(([key, value]) => convertInput(key, value));
const inputCleaners = Object.entries(inputs).reduce((result, [key, { clean }]) => (Object.assign(Object.assign({}, result), { [key]: clean })), {});
return Object.assign(Object.assign({}, trigger), { key: triggerKey, inputs: convertedInputs, perform: (0, perform_1.createPerform)(perform, {
const result = Object.assign(Object.assign({}, trigger), { key: triggerKey, inputs: convertedInputs, perform: (0, perform_1.createPerform)(perform, {
inputCleaners,
errorHandler: hooks === null || hooks === void 0 ? void 0 : hooks.error,
}) });
if (onInstanceDeploy) {
result.onInstanceDeploy = (0, perform_1.createPerform)(onInstanceDeploy, {
inputCleaners,
errorHandler: hooks === null || hooks === void 0 ? void 0 : hooks.error,
});
}
if (onInstanceDelete) {
result.onInstanceDelete = (0, perform_1.createPerform)(onInstanceDelete, {
inputCleaners,
errorHandler: hooks === null || hooks === void 0 ? void 0 : hooks.error,
});
}
return result;
};

@@ -44,0 +57,0 @@ const convertDataSource = (dataSourceKey, _a, hooks) => {

@@ -105,2 +105,9 @@ /// <reference types="node" />

export declare type TriggerPerformFunction = (context: ActionContext, payload: TriggerPayload, params: Record<string, unknown>) => Promise<TriggerResult>;
export interface TriggerEventFunctionContext {
logger: ActionLogger;
customer: Customer;
instance: Instance;
user: User;
}
export declare type TriggerEventFunction = (context: TriggerEventFunctionContext, params: Record<string, unknown>) => Promise<void>;
export interface Trigger {

@@ -119,2 +126,4 @@ key: string;

perform: TriggerPerformFunction;
onInstanceDeploy?: TriggerEventFunction;
onInstanceDelete?: TriggerEventFunction;
scheduleSupport: TriggerOptionChoice;

@@ -121,0 +130,0 @@ synchronousResponseSupport: TriggerOptionChoice;

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

export * from "./conditional-logic";
export * from "./TriggerEventFunction";
export * from "./TriggerResult";

@@ -18,0 +19,0 @@ export * from "./TriggerPerformFunction";

@@ -45,2 +45,3 @@ "use strict";

__exportStar(require("./conditional-logic"), exports);
__exportStar(require("./TriggerEventFunction"), exports);
__exportStar(require("./TriggerResult"), exports);

@@ -47,0 +48,0 @@ __exportStar(require("./TriggerPerformFunction"), exports);

@@ -1,2 +0,2 @@

import { ActionDisplayDefinition, TriggerPerformFunction, Inputs, TriggerResult } from ".";
import { ActionDisplayDefinition, TriggerPerformFunction, TriggerEventFunction, Inputs, TriggerResult } from ".";
declare const optionChoices: readonly ["invalid", "valid", "required"];

@@ -14,2 +14,6 @@ export declare type TriggerOptionChoice = typeof optionChoices[number];

perform: TriggerPerformFunction<TInputs, TAllowsBranching, TResult>;
/** Function to execute when an Instance of an Integration with a Flow that uses this Trigger is deployed. */
onInstanceDeploy?: TriggerEventFunction<TInputs>;
/** Function to execute when an Instance of an Integration with a Flow that uses this Trigger is deleted. */
onInstanceDelete?: TriggerEventFunction<TInputs>;
/** InputFields to present in the Prismatic interface for configuration of this Trigger. */

@@ -16,0 +20,0 @@ inputs: TInputs;

{
"name": "@prismatic-io/spectral",
"version": "7.7.0",
"version": "7.8.0-preview2",
"description": "Utility library for building Prismatic components",

@@ -46,8 +46,8 @@ "keywords": [

"jest-mock": "27.0.3",
"safe-stable-stringify": "2.3.1",
"serialize-error": "8.1.0",
"soap": "1.0.0",
"url-join": "5.0.0",
"uuid": "8.3.2",
"valid-url": "1.0.9",
"url-join": "5.0.0",
"safe-stable-stringify": "2.3.1",
"serialize-error": "8.1.0"
"valid-url": "1.0.9"
},

@@ -58,4 +58,4 @@ "devDependencies": {

"@types/sax": "1.2.4",
"@types/url-join": "4.0.1",
"@types/uuid": "8.3.4",
"@types/url-join": "4.0.1",
"@types/valid-url": "1.0.3",

@@ -72,7 +72,7 @@ "@typescript-eslint/eslint-plugin": "5.18.0",

"ts-jest": "27.0.3",
"tsd": "0.20.0",
"typedoc": "0.17.7",
"typedoc-plugin-markdown": "2.4.2",
"typedoc-plugin-remove-references": "0.0.5",
"typescript": "4.6.3",
"tsd": "0.20.0"
"typescript": "4.6.3"
},

@@ -79,0 +79,0 @@ "tsd": {

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