apigee-templater-module
Advanced tools
Comparing version 2.4.1 to 2.5.1
@@ -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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
167188
43
4624
7
12
+ Addedsync-request@^6.1.0
+ Addedxml-js@^1.6.11
+ Added@types/concat-stream@1.6.1(transitive)
+ Added@types/form-data@0.0.33(transitive)
+ Added@types/node@10.17.608.10.66(transitive)
+ Added@types/qs@6.9.17(transitive)
+ Addedasap@2.0.6(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedform-data@2.5.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedget-port@3.2.0(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhttp-basic@8.1.3(transitive)
+ Addedhttp-response-object@3.0.2(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedparse-cache-control@1.0.1(transitive)
+ Addedpromise@8.3.0(transitive)
+ Addedqs@6.13.1(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsax@1.4.1(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedsync-request@6.1.0(transitive)
+ Addedsync-rpc@1.3.6(transitive)
+ Addedthen-request@6.0.2(transitive)
+ Addedtypedarray@0.0.6(transitive)
+ Addedxml-js@1.6.11(transitive)
Updatedfs@^0.0.1-security