or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.mdparsing.mdrequests.mdservices.md
tile.json

tessl/npm-elyra--application

JupyterLab utilities for API communication and metadata management in Elyra extensions

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@elyra/application@1.5.x

To install, run

npx @tessl/cli install tessl/npm-elyra--application@1.5.0

index.mddocs/

@elyra/application

@elyra/application provides essential utility classes and services for the Elyra JupyterLab extension ecosystem, focusing on API communication, metadata management, and notebook parsing capabilities. It serves as a foundational dependency for other Elyra packages that need to communicate with backend services, manage configuration metadata, or handle user interactions in the JupyterLab environment.

Package Information

  • Package Name: @elyra/application
  • Package Type: npm
  • Language: TypeScript
  • Installation: npm install @elyra/application

Core Imports

import { NotebookParser, FrontendServices, RequestHandler, IDictionary } from "@elyra/application";

For CommonJS:

const { NotebookParser, FrontendServices, RequestHandler, IDictionary } = require("@elyra/application");

Note: This package requires JupyterLab dependencies. In a JupyterLab extension context, you'll also need:

import { Dialog } from '@jupyterlab/apputils';
import { ServerConnection } from '@jupyterlab/services';

Basic Usage

import { RequestHandler, FrontendServices, NotebookParser } from "@elyra/application";

// Make HTTP requests to Jupyter Lab server
const response = await RequestHandler.makeGetRequest('elyra/schema/code-snippets', false);

// Get metadata from Elyra API
const metadata = await FrontendServices.getMetadata('code-snippets');

// Parse notebook for environment variables
const envVars = NotebookParser.getEnvVars(notebookJsonString);

Architecture

@elyra/application is built around three core components:

  • Request Handler: Low-level HTTP request abstraction with built-in error handling and user feedback dialogs
  • Frontend Services: High-level service methods for interacting with Elyra's schema and metadata APIs, including caching
  • Notebook Parser: Utilities for analyzing Jupyter notebook content and extracting metadata like environment variables
  • Type Definitions: TypeScript interfaces for type safety across the Elyra ecosystem

Capabilities

HTTP Request Handling

Low-level HTTP request abstraction for communicating with the Jupyter Lab server. Provides GET, POST, PUT, and DELETE methods with built-in error handling and user feedback dialogs.

class RequestHandler {
  static makeGetRequest(requestPath: string, longRequest: boolean): Promise<any>;
  static makePostRequest(requestPath: string, requestBody: any, longRequest: boolean): Promise<any>;
  static makePutRequest(requestPath: string, requestBody: any, longRequest: boolean): Promise<any>;
  static makeDeleteRequest(requestPath: string, longRequest: boolean): Promise<any>;
  static makeServerRequest(requestPath: string, requestInit: RequestInit, longRequest: boolean): Promise<any>;
}

HTTP Request Handling

Elyra API Services

High-level service methods for interacting with Elyra's schema and metadata APIs. Provides CRUD operations for metadata management and schema retrieval with caching.

class FrontendServices {
  static noMetadataError(namespace: string): Promise<Dialog.IResult<any>>;
  static getMetadata(namespace: string): Promise<any>;
  static postMetadata(namespace: string, requestBody: any): Promise<any>;
  static putMetadata(namespace: string, name: string, requestBody: any): Promise<any>;
  static deleteMetadata(namespace: string, name: string): Promise<any>;
  static getSchema(namespace: string): Promise<any>;
  static getAllSchema(): Promise<any>;
}

Elyra API Services

Notebook Parsing

Utilities for analyzing Jupyter notebook content and extracting metadata like environment variables used in notebook cells.

class NotebookParser {
  static getEnvVars(notebookStr: string): string[];
  static findInCode(code: string, regex: RegExp): string[][];
}

interface IDictionary<T> {
  [key: string]: T;
}

Notebook Parsing

Types

interface IDictionary<T> {
  [key: string]: T;
}