Skip to content

Commit e50e8ad

Browse files
committed
#5817 [SDK] Add @module and @overview JSDoc Tag for TypeDoc Documentation Generation - Part I
1 parent b71868d commit e50e8ad

File tree

31 files changed

+975
-45
lines changed

31 files changed

+975
-45
lines changed

components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules/src/bpm/deployer.ts

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,36 @@
11
/**
2-
* API Deployer
3-
* * Provides methods for managing the lifecycle of Business Process Model and Notation (BPMN) definitions,
4-
* including deployment, undeployment, and deletion.
2+
* @module bpm/deployer
3+
* @overview
4+
* This module provides functionalities for managing Business Process Model and Notation (BPMN) definitions,
5+
* including deployment, undeployment, and deletion of process definitions.
6+
*
7+
* ### Key Features
8+
* - Deploy BPMN process definitions from specified locations (e.g., file paths).
9+
* - Undeploy previously deployed process definitions based on their deployment location.
10+
* - Permanently delete process definitions by their ID, with a reason for deletion.
11+
*
12+
* ### Use Cases
13+
* - Managing the lifecycle of BPMN process definitions in a workflow engine.
14+
* - Automating deployment and cleanup of process definitions in development and production environments.
15+
* - Integrating BPMN management into larger application workflows or administrative tools.
16+
*
17+
* ### Example Usage
18+
* ```ts
19+
* import { Deployer } from "@aerokit/sdk/bpm";
20+
*
21+
* // Deploy a new process definition
22+
* const deploymentId = Deployer.deployProcess("/path/to/process.bpmn");
23+
* console.log(`Deployed process with ID: ${deploymentId}`);
24+
*
25+
* // Undeploy the process definition
26+
* Deployer.undeployProcess("/path/to/process.bpmn");
27+
* console.log("Undeployed process from location: /path/to/process.bpmn");
28+
*
29+
* // Delete a deployed process definition by ID
30+
* Deployer.deleteProcess(deploymentId, "Obsolete");
31+
* console.log(`Deleted process with ID: ${deploymentId} for reason: Obsolete`);
32+
* ```
33+
*
534
*/
635

736
const BpmFacade = Java.type("org.eclipse.dirigible.components.api.bpm.BpmFacade");

components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules/src/bpm/process.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
11
/**
2-
* API Process
3-
* * Provides methods for interacting with process instances,
4-
* including starting, updating metadata, and managing variables.
2+
* @module bpm/process
3+
* @overview
4+
*
5+
* This module provides functionalities for managing and interacting with BPMN process instances, including starting processes, updating metadata, and handling process variables.
6+
*
7+
* ### Key Features
8+
* - Start new process instances with optional business keys and parameters
9+
* - Update process instance metadata such as name, business key, and business status
10+
* - Manage process variables with support for local and global scopes, as well as transient variables
11+
*
12+
* ### Use Cases
13+
* - Initiating new process instances from application code
14+
* - Dynamically updating process instance information during execution
15+
* - Managing process variables for data storage and retrieval within process executions
16+
*
17+
* ### Example Usage
18+
* ```ts
19+
* import { Process } from "@aerokit/sdk/bpm";
20+
* // Start a new process instance
21+
* const processInstanceId = Process.start("myProcessDefinitionKey", "myBusinessKey", { myVariable: "value" });
22+
* console.log(`Started process instance with ID: ${processInstanceId}`);
23+
* // Update process instance name
24+
* Process.setProcessInstanceName(processInstanceId, "My Process Instance");
25+
* // Set a process variable
26+
* Process.setVariable(processInstanceId, "myVariable", "newValue");
27+
* ```
528
*/
629

730
import { Values } from "@aerokit/sdk/bpm/values";

components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules/src/bpm/tasks.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
/**
2-
* API Tasks
2+
* @module bpm/tasks
3+
* @overview
4+
*
5+
* This module provides functionalities for managing User Tasks within a Business Process Model and Notation (BPMN) context. It allows users to list tasks, manage task variables, complete tasks, and access task-related services.
6+
*
7+
* ### Key Features
8+
* - List all user tasks in the system
9+
* - Get and set task variables, both globally and locally to the task
10+
* - Complete tasks with optional variables and user information
11+
* - Access the Task Service for advanced task management operations
12+
*
13+
* ### Use Cases
14+
* - Managing user tasks in a workflow engine
15+
* - Automating task completion and variable management in development and production environments
16+
* - Integrating task management into larger application workflows or administrative tools
17+
*
18+
* ### Example Usage
19+
* ```ts
20+
* import { Tasks } from "@aerokit/sdk/bpm";
21+
* // List all tasks
22+
* const tasks = Tasks.list();
23+
* console.log(tasks);
24+
* // Get a task variable
25+
* const variableValue = Tasks.getVariable("taskId", "variableName");
26+
* console.log(variableValue);
27+
* // Set a task variable
28+
* Tasks.setVariable("taskId", "variableName", "newValue");
29+
* // Complete a task with variables
30+
* Tasks.complete("taskId", { "result": "approved" });
31+
* ```
332
*/
433

534
import { Streams } from "@aerokit/sdk/io";

components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules/src/bpm/tracer.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1+
/**
2+
* @module bpm/tracer
3+
* @overview
4+
*
5+
* This module provides a `Tracer` class for logging and tracing the execution of BPMN processes within the Dirigible environment. The `Tracer` class allows developers to log informational messages, warnings, and errors, as well as to track the duration of process execution from start to completion or failure.
6+
*
7+
* ### Key Features
8+
* - Context-aware logging: Automatically includes process definition ID, instance ID, business key, and activity ID in log messages.
9+
* - Execution timing: Tracks the duration of process execution and logs it upon completion or failure.
10+
* - Flexible logging levels: Supports informational, warning, and error logging.
11+
*
12+
* ### Use Cases
13+
* - Debugging and monitoring BPMN process execution in development and production environments.
14+
* - Providing insights into process performance and identifying bottlenecks or issues.
15+
* - Enhancing observability of BPMN processes for better maintenance and support.
16+
*
17+
* ### Example Usage
18+
* ```ts
19+
* import { Tracer } from "@aerokit/sdk/bpm";
20+
*
21+
* const tracer = new Tracer();
22+
* try {
23+
* // Perform some operations related to the BPMN process
24+
* tracer.log("Performing step 1");
25+
* // ...
26+
* tracer.log("Performing step 2");
27+
* // ...
28+
* tracer.complete("Process completed successfully");
29+
* } catch (error) {
30+
* tracer.fail(`Process failed with error: ${error.message}`);
31+
* }
32+
* ```
33+
*/
34+
135
import { Process } from '@aerokit/sdk/bpm';
236
import { Logging, Logger } from "@aerokit/sdk/log";
337

components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules/src/bpm/values.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
/**
2-
* Values
3-
* * Utility class for serializing (stringify) and deserializing (parse) complex variable values (like objects and arrays)
4-
* to and from JSON strings for storage or transfer across the API boundary.
2+
* @module bpm/values
3+
* @overview
4+
*
5+
* The `Values` class provides utility methods for serializing and deserializing complex variable values (such as objects and arrays) to and from JSON strings. This is particularly useful for handling process variables in BPMN processes, where variables may need to be stored or transferred across API boundaries in a consistent format.
6+
*
7+
* ### Key Features
8+
* - **parseValue**: Safely attempts to parse a string value as JSON, returning the original value if parsing fails.
9+
* - **parseValuesMap**: Applies JSON parsing to all values in a Map, allowing for bulk deserialization of process variables.
10+
* - **stringifyValue**: Converts objects and arrays into their JSON string representations, while leaving primitive types unchanged. Arrays are also converted into Java Lists for compatibility with Java APIs.
11+
* - **stringifyValuesMap**: Applies JSON stringification to all values in a Map, enabling bulk serialization of process variables before API calls.
12+
*
13+
* ### Use Cases
14+
* - Managing complex process variables in BPMN processes, including objects and arrays.
15+
* - Ensuring consistent serialization and deserialization of variables when interacting with APIs that expect string values.
16+
* - Facilitating the transfer of structured data across API boundaries in a format that can be easily parsed and utilized.
517
*/
18+
619
export class Values {
720

821
/**

components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules/src/cache/cache.ts

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,40 @@
11
/**
2-
* Cache
3-
* * Provides a static utility for interacting with a server-side cache facade, enabling
4-
* simple key-value storage, retrieval, and invalidation operations.
2+
* @module cache/cache
3+
* @overview
4+
*
5+
* This module provides a `Cache` class that serves as a static utility for interacting with a server-side cache facade. The `Cache` class allows developers to perform simple key-value storage, retrieval, and invalidation operations on the cache, enabling efficient data management and performance optimization within the Dirigible environment.
6+
*
7+
* ### Key Features
8+
* - Simple key-value storage: Store any serializable data in the cache using a unique key.
9+
* - Efficient retrieval: Quickly retrieve cached values using their associated keys.
10+
* - Cache invalidation: Remove specific entries or clear the entire cache when needed.
11+
* - Server-side management: The cache is managed on the server, allowing for centralized control over caching behavior and policies.
12+
*
13+
* ### Use Cases
14+
* - Caching frequently accessed data to improve performance and reduce latency.
15+
* - Storing intermediate results of expensive computations or API calls for reuse.
16+
* - Managing session data or user-specific information in a scalable manner.
17+
* - Implementing application-level caching strategies to optimize resource usage and response times.
18+
*
19+
* ### Example Usage
20+
* ```ts
21+
* import { Cache } from "@aerokit/sdk/cache";
22+
*
23+
* // Store a value in the cache
24+
* Cache.set("user_123", { name: "Alice", age: 30 });
25+
* // Retrieve a value from the cache
26+
* const userData = Cache.get("user_123");
27+
* console.log(userData); // Output: { name: "Alice", age: 30 }
28+
* // Check if a key exists in the cache
29+
* const exists = Cache.contains("user_123");
30+
* console.log(exists); // Output: true
31+
* // Delete a specific key from the cache
32+
* Cache.delete("user_123");
33+
* // Clear the entire cache
34+
* Cache.clear();
35+
* ```
536
*/
37+
638
const CacheFacade = Java.type("org.eclipse.dirigible.components.api.cache.CacheFacade");
739

840
export class Cache {

components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules/src/cms/cmis.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
11
/**
2-
* API CMIS
3-
* * Note: This module is supported only with the Mozilla Rhino engine
4-
* * Provides static access to the CMIS (Content Management Interoperability Services) repository session and utility constants.
2+
* @module cms/cmis
3+
* @overview
4+
*
5+
* This module provides a set of classes and constants for interacting with a CMIS (Content Management Interoperability Services) repository within the Dirigible environment. It allows developers to establish sessions with the repository, navigate and manipulate folders and documents, and manage content streams. The module also defines standard CMIS properties and versioning states for consistent interaction with CMIS-compliant repositories.
6+
*
7+
* ### Key Features
8+
* - Establishing sessions with CMIS repositories
9+
* - Navigating folder structures and managing documents
10+
* - Handling content streams for document creation and retrieval
11+
* - Defining standard CMIS properties and versioning states for consistent API usage
12+
*
13+
* ### Use Cases
14+
* - Integrating with enterprise content management systems that support CMIS
15+
* - Building applications that require document management capabilities, such as file storage, versioning, and metadata handling
16+
* - Automating content management tasks within a CMIS repository, such as bulk uploads, organization, and cleanup
17+
*
18+
* ### Example Usage
19+
* ```ts
20+
* import { Cmis } from "@aerokit/sdk/cms";
21+
* const session = Cmis.getSession();
22+
* const rootFolder = session.getRootFolder();
23+
* const newFolder = rootFolder.createFolder({ "cmis:name": "New Folder" });
24+
* const contentStream = session.getObjectFactory().createContentStream("example.txt", 11, "text/plain", new streams.ByteArrayInputStream("Hello World".getBytes()));
25+
* const newDocument = newFolder.createDocument({ "cmis:name": "Example Document" }, contentStream, Cmis.VERSIONING_STATE_MAJOR);
26+
* console.log(`Created document with ID: ${newDocument.getId()} and name: ${newDocument.getName()}`);
27+
* ```
528
*/
629

730
import * as streams from "@aerokit/sdk/io/streams";

components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules/src/component/decorators.ts

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,37 @@
11
/**
2-
* API DI (Dependency Injection) Decorators
3-
* * Provides a hybrid implementation of decorators for Dependency Injection (DI)
4-
* that supports both legacy JavaScript environments (like Mozilla Rhino or older GraalJS)
5-
* using the `(target, propertyKey)` signature, and modern JavaScript environments
6-
* using the decorator metadata and `context.addInitializer`.
2+
* @module component/decorators
3+
* @overview
4+
*
5+
* This module provides a set of decorators for defining and managing Dependency Injection (DI) components within the Dirigible environment. The decorators are designed to be compatible with both legacy JavaScript environments (like Mozilla Rhino or older GraalJS) and modern JavaScript environments that support the latest decorator specifications.
6+
*
7+
* ### Key Features
8+
* - **Component Decorator**: Marks a class as a DI component, allowing it to be registered and managed by the DI container.
9+
* - **Injected Decorator**: An alias for the Component decorator, used for semantic clarity when a class is intended to be injected as a dependency rather than being a primary component.
10+
* - **Inject Decorator**: Marks a class property as an injection point, specifying that a dependency should be injected at runtime based on the property name or an optional custom name.
11+
* - **Hybrid Decorator Support**: The decorators are implemented to work seamlessly in both legacy and modern JavaScript environments, ensuring broad compatibility across different runtime contexts.
12+
*
13+
* ### Use Cases
14+
* - Defining services, repositories, controllers, or any other components that require dependency injection in a Dirigible application.
15+
* - Managing dependencies and promoting loose coupling between components for better maintainability and testability.
16+
* - Leveraging the DI container to automatically resolve and inject dependencies based on component registration and metadata.
17+
*
18+
* ### Example Usage
19+
* ```ts
20+
* import { Component, Inject } from "@aerokit/sdk/component";
21+
*
22+
* @Component('MyService')
23+
* class MyService {
24+
* // Service implementation
25+
* }
26+
*
27+
* @Component
28+
* class MyController {
29+
* @Inject('MyService')
30+
* private myService!: MyService;
31+
*
32+
* // Controller implementation that uses myService
33+
* }
34+
* ```
735
*/
836

937
const ComponentMetadataRegistry = Java.type(

components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules/src/core/context.ts

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
11
/**
2-
* API Context
3-
* * Provides a static interface for accessing and manipulating key-value pairs in a global, application-wide context.
2+
* @module core/context
3+
* @overview
4+
*
5+
* The Context API provides a simple, static interface for storing and retrieving key-value pairs in a global application context. It allows components and modules to share data across the entire application without needing to pass values through function parameters or component props. The Context API is designed to be lightweight and easy to use, making it ideal for managing global state, configuration settings, or any other data that needs to be accessible throughout the application.
6+
*
7+
* ### Key Features
8+
* - **Global Accessibility**: Values stored in the context can be accessed from anywhere in the application, facilitating data sharing across components and modules.
9+
* - **Simple API**: The Context API provides straightforward `get` and `set` methods for managing context values, making it easy to use without complex setup.
10+
* - **Dynamic Storage**: The context can store any type of value, including primitives, objects, arrays, and even functions, allowing for flexible data management.
11+
* - **Overwriting Values**: Setting a value with an existing name will overwrite the previous value, enabling dynamic updates to the context as needed.
12+
*
13+
* ### Use Cases
14+
* - Managing global configuration settings that need to be accessed by multiple components or modules.
15+
* - Sharing state or data across different parts of the application without prop drilling or complex state management solutions.
16+
* - Storing references to services, utilities, or other shared resources that need to be accessible throughout the application.
17+
* - Facilitating communication between components that do not have a direct parent-child relationship by using the context as a shared data store.
18+
*
19+
* ### Example Usage
20+
* ```ts
21+
* import { Context } from "@aerokit/sdk/core";
22+
*
23+
* // Set a value in the context
24+
* Context.set("apiEndpoint", "https://api.example.com");
25+
*
26+
* // Get a value from the context
27+
* const apiEndpoint = Context.get("apiEndpoint");
28+
* console.log(apiEndpoint); // Output: "https://api.example.com"
29+
*
30+
* // Overwrite an existing value in the context
31+
* Context.set("apiEndpoint", "https://api.newexample.com");
32+
* const newApiEndpoint = Context.get("apiEndpoint");
33+
* console.log(newApiEndpoint); // Output: "https://api.newexample.com"
34+
* ```
435
*/
536

637
const ContextFacade = Java.type("org.eclipse.dirigible.components.api.core.ContextFacade");

components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules/src/core/env.ts

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
/**
2-
* API Env
3-
* * Provides a static interface for accessing and listing environment variables exposed to the runtime.
2+
* @module core/env
3+
* @description
4+
*
5+
* The `Env` module provides a static interface for accessing environment variables exposed to the runtime. It allows you to retrieve individual environment variable values by name, as well as list all available environment variables in a structured format.
6+
*
7+
* ### Key Features
8+
* - **Simple Access**: Retrieve environment variable values using a straightforward `get` method.
9+
* - **Comprehensive Listing**: Obtain a complete map of all environment variables using the `list` method, which returns an object with key-value pairs.
10+
* - **Type Safety**: The `get` method returns `undefined` if an environment variable is not set, allowing for safe handling of missing variables.
11+
*
12+
* ### Use Cases
13+
* - Accessing configuration settings that are provided through environment variables, such as API keys, database connection strings, or feature flags.
14+
* - Listing all available environment variables for debugging purposes or to dynamically adjust application behavior based on the runtime environment.
15+
* - Integrating with external services that require environment variable configuration, ensuring that sensitive information is not hardcoded in the application code.
16+
*
17+
* ### Example Usage
18+
* ```ts
19+
* import { Env } from "@aerokit/sdk/core";
20+
*
21+
* // Get a specific environment variable
22+
* const apiKey = Env.get("API_KEY");
23+
* console.log(apiKey); // Output: "your-api-key" or undefined if not set
24+
*
25+
* // List all environment variables
26+
* const envVars = Env.list();
27+
* console.log(envVars); // Output: { API_KEY: "your-api-key", NODE_ENV: "production", ... }
28+
* ```
429
*/
530

631
const EnvFacade = Java.type("org.eclipse.dirigible.components.api.core.EnvFacade");

0 commit comments

Comments
 (0)