Options
All
  • Public
  • Public/Protected
  • All
Menu

SAP Cloud SDK for JavaScript Logo

@sap-cloud-sdk/generator

Generate your own service module using a service specification (.edmx file).

Installation

$ npm install @sap-cloud-sdk/generator

Usage (CLI)

The generator is primarily meant to be used on the command line:

generate-odata-client --inputDir path/to/your/service-specification(s) --outputDir path/where/the/modules/are/stored

Run generate-odata-client --help for further options.

Usage (programatically)

You can also use the generator programmatically. You will have to provide the options anyways.

import { generateProject } from '@sap-cloud-sdk/generator';

// initialize generator options based on what you want to do
const options: GeneratorOptions = initializeOptions();

// creates a Project datastructure with all sourcefiles based on your options
const project = generateProject(options);

// here you can modify you project if you need to

// save the files at the specified location
project.save();

// alternatively you can generate and save the project in one step with: generate(options)

Documentation

Getting started guide API documentation

Helpful Links

Index

Variables

Const defaultValueProcessesJsGeneration

defaultValueProcessesJsGeneration: 16 = 16

Functions

generate

  • generate(options: GeneratorOptions): Promise<void>
  • Parameters

    • options: GeneratorOptions

    Returns Promise<void>

generateProject

  • generateProject(options: GeneratorOptions): Promise<Project | undefined>
  • Parameters

    • options: GeneratorOptions

    Returns Promise<Project | undefined>

generateSourcesForService

  • generateSourcesForService(service: VdmServiceMetadata, project: Project, options: GeneratorOptions): Promise<void>
  • Parameters

    • service: VdmServiceMetadata
    • project: Project
    • options: GeneratorOptions

    Returns Promise<void>

transpileDirectories

  • transpileDirectories(directories: Directory[]): Promise<void[]>
  • Parameters

    • directories: Directory[]

    Returns Promise<void[]>

transpileDirectory

  • transpileDirectory(dir: Directory): Promise<void>
  • Parameters

    • dir: Directory

    Returns Promise<void>