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

apigee-templater-module

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apigee-templater-module - npm Package Compare versions

Comparing version 2.4.1 to 2.5.1

dist/lib/plugins/any.plugin.d.ts

14

dist/lib/interfaces.d.ts

@@ -44,5 +44,10 @@ /**

};
extensionSteps: any[];
extensionSteps: step[];
fileResults?: PlugInResult[];
}
export declare class step {
type: string;
name: string;
flowRunPoints: FlowRunPoint[];
}
/** Describes a proxy to be templated */

@@ -120,7 +125,8 @@ export declare class ApigeeTemplateInput {

name: string;
flowCondition: string;
stepCondition: string;
flowCondition?: string;
stepCondition?: string;
runPoints: RunPoint[];
}
export declare enum RunPoint {
none = "none",
preRequest = "preRequest",

@@ -145,3 +151,3 @@ postRequest = "postRequest",

condition: string;
constructor(name: string, condition: string);
constructor(name: string, condition: string | undefined);
}

@@ -148,0 +154,0 @@ /** Profile definition with plugins to be used for conversion */

@@ -147,2 +147,24 @@ /**

}
export class step {
constructor() {
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: ""
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: ""
});
Object.defineProperty(this, "flowRunPoints", {
enumerable: true,
configurable: true,
writable: true,
value: []
});
}
}
/** Describes a proxy to be templated */

@@ -368,2 +390,3 @@ export class ApigeeTemplateInput {

(function (RunPoint) {
RunPoint["none"] = "none";
RunPoint["preRequest"] = "preRequest";

@@ -417,3 +440,4 @@ RunPoint["postRequest"] = "postRequest";

this.name = name;
this.condition = condition;
if (condition)
this.condition = condition;
}

@@ -420,0 +444,0 @@ }

@@ -17,21 +17,3 @@ /**

import Handlebars from 'handlebars';
import { PlugInResult, RunPoint } from '../interfaces.js';
class Step {
constructor(name, condition) {
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: ""
});
Object.defineProperty(this, "condition", {
enumerable: true,
configurable: true,
writable: true,
value: ""
});
this.name = name;
this.condition = condition;
}
}
import { PlugInResult, RunPoint, FlowStep } from '../interfaces.js';
/**

@@ -118,9 +100,9 @@ * Creates shared flows for the template

if (point == RunPoint.preRequest)
preRequestPolicies.push(new Step(fileResult.policyConfig.name, policyRunPoint.stepCondition));
preRequestPolicies.push(new FlowStep(fileResult.policyConfig.name, policyRunPoint.stepCondition));
else if (point == RunPoint.postRequest)
postRequestPolicies.push(new Step(fileResult.policyConfig.name, policyRunPoint.stepCondition));
postRequestPolicies.push(new FlowStep(fileResult.policyConfig.name, policyRunPoint.stepCondition));
else if (point == RunPoint.preResponse)
preResponsePolicies.push(new Step(fileResult.policyConfig.name, policyRunPoint.stepCondition));
preResponsePolicies.push(new FlowStep(fileResult.policyConfig.name, policyRunPoint.stepCondition));
else if (point == RunPoint.postResponse)
postResponsePolicies.push(new Step(fileResult.policyConfig.name, policyRunPoint.stepCondition));
postResponsePolicies.push(new FlowStep(fileResult.policyConfig.name, policyRunPoint.stepCondition));
}

@@ -127,0 +109,0 @@ }

@@ -196,3 +196,3 @@ /**

postTargetPolicies: postTargetPolicies,
faultRules: faultRulePolicies
faultRulePolicies: faultRulePolicies
};

@@ -199,0 +199,0 @@ fileResult.files = [

@@ -35,2 +35,4 @@ /**

import { MessageLoggingPlugin } from './plugins/messagelogging.plugin.js';
import { AnyPlugin } from './plugins/any.plugin.js';
import { ResourceFilePlugin } from './plugins/resources.file.js';
/**

@@ -82,3 +84,5 @@ * ApigeeGenerator runs the complete templating operation with all injected plugins

"FlowCallout": new FlowCalloutPlugin(),
"MessageLogging": new MessageLoggingPlugin()
"MessageLogging": new MessageLoggingPlugin(),
"resourceFiles": new ResourceFilePlugin(),
"": new AnyPlugin()
},

@@ -100,3 +104,5 @@ finalizePlugins: [

"AssignMessage": new AssignMessagePlugin(),
"MessageLogging": new MessageLoggingPlugin()
"MessageLogging": new MessageLoggingPlugin(),
"resourceFiles": new ResourceFilePlugin(),
"": new AnyPlugin()
},

@@ -415,7 +421,12 @@ finalizePlugins: [

for (const step of endpoint.extensionSteps) {
let stepDefinition = step;
if (this.profiles[genInput.profile].extensionPlugins[stepDefinition.type]) {
// Set the generic Any plugin that converts JSON to XML for any plugin where type is not set (default)
if (step.type == undefined)
step.type = "";
if (this.profiles[genInput.profile].extensionPlugins[step.type]) {
// We have a plugin
promises.push(this.profiles[genInput.profile].extensionPlugins[stepDefinition.type].applyTemplate(endpoint, step));
promises.push(this.profiles[genInput.profile].extensionPlugins[step.type].applyTemplate(endpoint, step));
}
else {
console.error(`Plugin ${step.type} not found in profile ${genInput.profile}`);
}
}

@@ -422,0 +433,0 @@ }

{
"name": "apigee-templater-module",
"version": "2.4.1",
"version": "2.5.1",
"description": "This library provides templating services for Apigee X proxies.",

@@ -30,6 +30,8 @@ "homepage": "https://github.com/tyayers/apigee-templater",

"archiver": "^5.3.0",
"fs": "0.0.1-security",
"fs": "^0.0.1-security",
"handlebars": "^4.7.7",
"js-yaml": "^4.1.0",
"performance": "^1.4.0"
"performance": "^1.4.0",
"sync-request": "^6.1.0",
"xml-js": "^1.6.11"
},

@@ -36,0 +38,0 @@ "devDependencies": {

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