vlocode-project - v1.40.0-beta-4
    Preparing search index...

    Class FlexCardLwcCompiler

    Compiler that transforms activated OmniScripts into LWC components that can easily be deployed or written to the disk.

    Index

    Constructors

    Properties

    logger: Logger
    namespaceService: VlocityNamespaceService
    salesforceService: SalesforceService

    Methods

    • Compiles a FlexCard definition into LWC files and returns the component name and compiled resources.

      Initializes the LWC generator using namespace and runtime settings derived from internal services and the provided options, determines the component name (either from options.lwcName or derived from the card), and invokes the generator to produce LWC files for the card. Only generated files whose filepath contains a '/' are returned as compiled resources.

      Parameters

      • card: FlexCardDefinition

        The FlexCardDefinition to compile.

      • Optionaloptions: FlexCardCompileOptions

        Optional compilation settings:

        • lwcName: explicit LWC component name to use instead of deriving one from the card.
        • useStandardRuntime: when true, use the standard LWC runtime.
        • apiVersion: API version to use for generator initialization (coerced to a Number); if omitted the service default is used.

      Returns Promise<{ name: string; resources: CompiledResource[] }>

      A promise that resolves to an object with:

      • name: the LWC component name used for generation.
      • resources: an array of CompiledResource objects ({ name: string; source: string }) produced from generated files whose filepaths include a '/'.
      • The LWC generator is initialized with:
        • nsPrefix: current namespace from namespaceService.getNamespace()
        • isInsidePackge: true when a namespace is present
        • isStdRuntime: boolean derived from options.useStandardRuntime
        • apiVersion: Number(options?.apiVersion ?? salesforceService.getApiVersion())
      • The method delegates actual file generation to the generator's generateLWCFiles method and maps its output to the returned resources.
      • Filepaths are returned as provided by the generator; only those containing '/' are considered resources here.

      Will reject the returned promise if generator initialization or file generation fails, or if required services are unavailable.

    • Compile an OmniScript into a deployable Salesforce Tooling record

      Parameters

      Returns Promise<
          {
              FullName: string;
              Metadata: {
                  apiVersion: any;
                  capabilities: { capability: never[] };
                  description: any;
                  isExposed: any;
                  lwcResources: { lwcResource: { filePath: string; source: string }[] };
                  masterLabel: string;
                  runtimeNamespace: any;
                  targetConfigs: null | string;
                  targets: any;
              };
          },
      >