0.3.3 • Published 3 years ago

@coopersystem-fsd/workflow-sdk v0.3.3

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Coopersystem Workflow SDK

A SDK written in Typescript for execute some Coopersystem's workflow actions like:

  • Checkin
  • Checkout
  • Create time entry
  • Update issue status
  • Check worked hours on the current day
  • Get last issue in execution

Installation

yarn add @coopersystem-fsd/workflow-sdk

or

npm i @coopersystem-fsd/workflow-sdk

Usage

Create a Coopersystem Workflow instance for an specific type of user using the CoopersystemWorkflowFactory:

Remarks: LDAP Credentials are required to Projects and Allocation managers (Redmine and Edesenv)

import { CoopersystemWorkflowFactory } from '@coopersystem-fsd/workflow-sdk';

const coWorkerWorkflow = CoopersystemWorkflowFactory.coWorker({
  username: 'samuel.martins',
  password: 'secret',
});

const internWorkflow = CoopersystemWorkflowFactory.intern({
  username: 'gabriel.huerta',
  password: 'secret',
});

Allocation

// It'll use Edesenv integration to do it
coWorkerWorkflow.checkin();
coWorkerWorkflow.checkout();

// For interns a local manager will be used
internWorkflow.checkin();
internWorkflow.checkout();

coWorkerWorkflow.getCheckPointEntriesToday();

Projects (Redmine)

const issue = 123;
const hours = 2;
const comments = 'Add login page';

coWorkerWorkflow.createTimeEntry(issue, hours, comments);

const newStatus = IssueStatus.FINISHED;

coWorkerWorkflow.updateIssueStatus(newStatus);

coWorkerWorkflow.getLastIssueInExecution();

coWorkerWorkflow.getLastIssueInExecutionWorkedHours();