@apistudio/apim-cli
Version:
CLI for API Management Products
96 lines • 3.74 kB
TypeScript
import { StudioAsset, WrappedAsset } from '@apic/smith-transformer';
/**
* LWGW post-transformer
* Organizes assets into execute, catch, and finally sections
*/
export declare class LwgwPostTransformer {
/**
* Organize assets into the assembly structure based on policy sequence
* @param assets Array of transformed assets
* @param allAssets Assets belonging to the api
* @returns Assembly structure with execute, catch, and finally sections
*/
organizeAssets(assets: WrappedAsset[], allAssets?: StudioAsset[]): any;
/**
* Process a single asset to handle $ref properties at any level
* @param asset The asset to process
* @param allAssets All available wrapped assets
* @param refTracker Set to track references and prevent circular dependencies
* @returns Processed asset
*/
private processAssetWithRef;
/**
* Process deep reference structures in an object
* @param obj The object to process
* @param allAssets All available wrapped assets
* @param refTracker Set to track references and prevent circular dependencies
*/
private processDeepRefStructures;
/**
* Traverse an object and replace any $ref properties with the actual referenced assets
* @param obj The object to traverse
* @param allAssets All available wrapped assets
* @param refTracker Set to track references and prevent circular dependencies
*/
private traverseAndReplaceRefs;
/**
* Find the policy sequence reference in the API asset
* @param apiAsset The API asset
* @returns The policy sequence reference or undefined
*/
private findPolicySequenceRef;
/**
* Find a reference to an asset of a specific kind in an object
* @param obj The object to search in
* @param kind The kind to look for
* @returns The reference or undefined
*/
private findRefByKind;
/**
* Find an asset by reference from StudioAssets
* @param ref Reference string in format "namespace:name:version" or "kind:name:version"
* @param assets All available StudioAssets
* @returns The matching asset or undefined
*/
private findAssetByRefFromStudioAssets;
/**
* Find an asset by reference from WrappedAssets
* @param ref Reference string in format "namespace:name:version" or "kind:name:version"
* @param assets All available WrappedAssets
* @returns The matching asset or undefined
*/
private findAssetByRef;
/**
* Get ordered policy references from the main section of a policy sequence
* @param policySequenceAsset The policy sequence asset
* @returns Array of policy references in order
*/
private getMainPolicyRefs;
/**
* Get ordered policy references from the finally section of a policy sequence
* @param policySequenceAsset The policy sequence asset
* @returns Array of policy references in order
*/
private getFinallyPolicyRefs;
/**
* Get error sections from a policy sequence
* @param policySequenceAsset The policy sequence asset
* @returns Array of error sections
*/
private getErrorSections;
/**
* Process error sections into catch blocks
* @param errorSections Array of error sections
* @param assets All available assets
* @returns Array of catch blocks
*/
private processCatchSections;
/**
* Order assets according to policy references
* @param policyRefs Array of policy references in order
* @param assets All available assets
* @returns Array of ordered output assets
*/
private orderAssetsByPolicyRefs;
}
//# sourceMappingURL=lwgw-post-transformer.impl.d.ts.map