Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

Dev Guide
Dev GuideUser GuidesLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

OCP App SDK / Runtime

Runtime

Index

Constructors

Accessors

Methods

Constructors

constructor()

Signature

new Runtime(): Runtime;

Returns

Runtime

Accessors

baseDir

Signature

baseDir(): string;

Returns

string

Defined in: src/app/Runtime.ts:55

Defined in: src/app/Runtime.ts:55

manifest

Signature

manifest(): Readonly<AppManifest>;

Returns

Readonly<AppManifest>

Defined in: src/app/Runtime.ts:51

Defined in: src/app/Runtime.ts:51

Methods

getChannelClass()

Signature

getChannelClass<T>(): Promise<() => T>;

Type parameters

Returns

Promise<() => T>

Defined in: src/app/Runtime.ts:74

getFunctionClass()

Signature

getFunctionClass<T>(name: string): Promise<(request: Request) => T>;

Type parameters

Parameters

NameType
namestring

Returns

Promise<(request: Request) => T>

Defined in: src/app/Runtime.ts:60

getJobClass()

Signature

getJobClass<T>(name: string): Promise<(invocation: JobInvocation) => T>;

Type parameters

  • T extends Job<T>

Parameters

NameType
namestring

Returns

Promise<(invocation: JobInvocation) => T>

Defined in: src/app/Runtime.ts:78

getLifecycleClass()

Signature

getLifecycleClass<T>(): Promise<() => T>;

Type parameters

Returns

Promise<() => T>

Defined in: src/app/Runtime.ts:70

getLiquidExtensionClass()

Signature

getLiquidExtensionClass<T>(name: string): Promise<() => T>;

Type parameters

Parameters

NameType
namestring

Returns

Promise<() => T>

Defined in: src/app/Runtime.ts:88

getSchemaObjects()

Signature

getSchemaObjects(): SchemaObjects;

Returns

SchemaObjects

Defined in: src/app/Runtime.ts:98

toJson()

Signature

toJson(): string;

Returns

string

Defined in: src/app/Runtime.ts:109

fromJson()

Initializes from a pre-validated JSON definition. Used during task execution.

Signature

Static fromJson(serializedRuntime: string): Runtime;

Parameters

NameTypeDescription
serializedRuntimestringJSON-serialized runtime definition

Returns

Runtime

Defined in: src/app/Runtime.ts:41

initialize()

Initializes from a directory. Used during startup.

Signature

Static initialize(dirName: string, skipJsonValidation: boolean = false): Promise<Runtime>;

Parameters

NameTypeDefault valueDescription
dirNamestringundefinedthe base directory of the app
skipJsonValidationbooleanfalsefor internal use, allows json-schema errors to be captured by the validation process

Returns

Promise<Runtime>

Defined in: src/app/Runtime.ts:31