npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@os1-platform/platform-coreos-execution-engine-sdk

v1.0.17

Published

New workflow execution engine sdk for mobile apps

Downloads

158

Readme

platform-coreos-execution-engine-sdk

OS1 workflow execution engine sdk for mobile apps. It works with both Android and iOS. With the help of exposed functions, the user and query the next execution task that needs to be executed for an objective. Based on the app's flow, appropriate screen may be rendered to display a given execution task. Optionally, it may be offloaded to the Dispatch SDK (https://github.com/foxtrotplatform/dispatch-sdk) which offers ET screens out-of-the-box. As the app user interacts with the ET screen, the required output is captured and passed to the sdk to save its progress. Internally it manages the objective's state as well as it progress seamlessly. One can also listen to event callback by registering the callback function at the time of sdk initialization.

Installation

npm install @os1-platform/platform-coreos-execution-engine-sdk@latest

Usage

import {
  DispatchExecutor as dispatchExecutor,
  IDispatch,
  IDispatchExecutor,
} from '@os1-platform/platform-coreos-execution-engine-sdk';

/**
 * Init is a one time call to bind the DispatchExecutor to the App via callbacks.
 *
**/
await dispatchExecutor.init({
  // Callback functions
  storeMultipleKeysCallback: async (args: { key: string; value: string}[]): Promise<void> => {
    // App code
  },
  readMultipleKeysCallback: async (keys: string[]): Promise<(string | null)[][]> => {
    // App code
  },
  deleteMultipleKeysCallback: async (keys: string[]): Promise<void> => {
    // App code
  },
  eventBulkSyncCallback: async (input: {
    syncType: any;
    dispatchId: string;
    data: string;
    meta?: any;
  }) => {
    // App code to react to the generated events
  }
},
'debug' // log level - 'debug', 'info', 'warn', 'error'
);

await dispatchExecutor.start('<Dispatch ID>', [
  {
    // A Dispatch job
  }
],
{}, // raw workflow json - workflow ID: data
// optional configuration
{
  maxTaskReattempt: 50,
  eventSyncBatchSize: 10,
}
);

/**
 * Get the list of Objective tasks to be executed at the moment
 * filter by the task status
 * */
await dispatchExecutor.getObjectiveTaskList([
          IDispatchExecutor.ExecutionStatus.READY,
          IDispatchExecutor.ExecutionStatus.IN_PROGRESS,
          IDispatchExecutor.ExecutionStatus.READY,
        ]);

/**
 * Get get ET for an objective task which are either ready or in-progress
 * */
const nextExecutableETs = await dispatchExecutor.getNextTask(moId, [
        IDispatchExecutor.ExecutionStatus.IN_PROGRESS,
        IDispatchExecutor.ExecutionStatus.READY,
      ]);

/**
 * Save the ET's output post execution
 * */
await dispatchExecutor.saveTaskOutput(
        [<List of Objective Task IDs>],
        taskName,
        taskId,
        {
          input, // ET's input data
          output // ET's output data
        }
      );

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Contact

Authors: