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 🙏

© 2026 – Pkg Stats / Ryan Hefner

jsegd-fluig-types

v1.0.30

Published

Definições de tipos TypeScript para desenvolvimento na plataforma Fluig - Inclui APIs, SDK, datasets, workflows e webservices

Readme

jsegd-fluig-types

Version License

Definições de tipos TypeScript (.d.ts) para desenvolvimento na plataforma Fluig, cobrindo APIs frontend, eventos de workflow, datasets, SDK Java, webservices e classes Java básicas usadas no runtime Rhino.

🎯 Objetivo

Disponibilizar tipagem global para todos os identificadores expostos pelo Fluig em scripts de:

  • Frontend (widgets, formulários, eventos): FLUIGC, WCMAPI, Datatable, Modal, Toast, Autocomplete, formMode, etc.
  • Backend / Workflow (Rhino + Java): hAPI, log, globalVars, getValue, ServiceManager, JSONUtil, FormController, customHTML.
  • Datasets: DatasetFactory, DatasetBuilder, DefaultDataset, AddColumn, setKey, addIndex, defineStructure, onSync, onMobileSync, createDataset, ConstraintType, DatasetFieldType.
  • SDK Java do Fluig: namespaces com.fluig.sdk.* (services, VOs, OAuth).
  • Webservice ECM: com.totvs.technology.ecm.workflow.ws.ECMWorkflowEngineServiceService e DTOs relacionados.
  • Java: java.util.*, java.lang.*, java.sql.*, javax.naming.*, javax.sql.*.

Todos os símbolos são declarados em declare global { ... }, ficando disponíveis sem import em qualquer arquivo .ts do projeto consumidor.

📦 Instalação

npm install -D jsegd-fluig-types

ou com yarn:

yarn add -D jsegd-fluig-types

ou com pnpm:

pnpm add -D jsegd-fluig-types

🚀 Uso

Carregamento global

Adicione uma única referência num arquivo de bootstrap (ex.: src/types/global.d.ts):

import 'jsegd-fluig-types'

Ou inclua nos types do tsconfig.json:

{
    "compilerOptions": {
        "types": ["jsegd-fluig-types"]
    }
}

Subpath imports (opcional)

O pacote expõe entradas individuais em package.json#exports para uso seletivo:

| Subpath | Conteúdo | | ------------------------------ | ----------------------------------------------------------------------------------------- | | jsegd-fluig-types | Reexporta todos os módulos abaixo (recomendado). | | jsegd-fluig-types/frontend | Tipos de widgets/portal: FLUIGC, WCMAPI, Datatable, Toast, formMode. | | jsegd-fluig-types/backend | Tipos de Rhino/workflow: hAPI, log, getValue, globalVars, ServiceManager. | | jsegd-fluig-types/dataset | Tipos de dataset: DatasetFactory, DefaultDataset, ConstraintType, AddColumn, etc. | | jsegd-fluig-types/sdk | Namespaces com.fluig.sdk.* (FluigAPI e services). | | jsegd-fluig-types/webservice | ECMWorkflowEngineServiceService e DTOs de workflow. | | jsegd-fluig-types/api | Parâmetros das APIs REST do Fluig (SearchDatasetValuesParams). | | jsegd-fluig-types/java | Tipos java.* e javax.* necessários no Rhino. |

import 'jsegd-fluig-types/backend'
import 'jsegd-fluig-types/dataset'

🧩 Conteúdo

Frontend (widget/portal)

const opts: ModalSettings = {
    title: 'Confirmação',
    content: '<p>Deseja continuar?</p>',
    id: 'modal-confirm',
    showHeader: true,
    showFooter: true,
    actions: [],
    headerActions: [],
    headerContent: '',
    size: 'small',
    formModal: false,
}

FLUIGC.modal(opts)

if (formMode === FormMod.ADD) {
    // formulário em modo de inclusão
}

DatasetFactory.getDataset('colleague', ['colleagueId', 'colleagueName'], [], ['colleagueName'], {
    success: function (result) {
        // result: DatasetWcmResult<unknown>
        console.log(result.columns, result.values)
    },
})

Backend (Rhino / workflow)

function beforeTaskSave(colleagueId: string, nextSequenceId: number, userTaskVO: unknown): void {
    const numProc = getValue('WKNumProces')
    const card = hAPI.getCardData(parseInt(numProc))
    log.info('Salvando tarefa de ' + colleagueId + ' no processo ' + numProc)
    globalVars.put('ultimoUsuario', new java.lang.String(colleagueId))
}

Dataset

function defineStructure(): void {
    AddColumn(new java.lang.String('NOME'), DatasetFieldType.STRING)
    AddColumn(new java.lang.String('IDADE'), DatasetFieldType.NUMBER)
    setKey([new java.lang.String('NOME')])
    addIndex([new java.lang.String('IDADE')])
}

function createDataset(fields: string[], constraints: SearchConstraint[], sortFields: string[]): DefaultDataset {
    const ds = DatasetBuilder.newDataset()
    ds.addColumn(new java.lang.String('NOME'))
    ds.addRow([new java.lang.String('Maria')] as any)
    return ds
}

SDK e webservice

const fluig = new com.fluig.sdk.api.FluigAPI()
const userService = fluig.getUserService()

const wsService = ServiceManager.getService('ECMWorkflowEngineService')
const port = wsService.getBean().instantiate('com.totvs.technology.ecm.workflow.ws.ECMWorkflowEngineServiceService').getWorkflowEngineServicePort()

const cardData = new java.util.HashMap<java.lang.String, java.lang.String>()
const choosedUsers = new java.util.ArrayList<string>()
choosedUsers.add('admin')
port.startProcess('admin', 'secret', 1, 'ProcExemplo', 2, choosedUsers, 'ok', true, cardData, false)

🗂️ Estrutura

types/
├── index.d.ts                    # reexporta todos os módulos
├── fluig/
│   ├── fluig.api.d.ts            # parâmetros das APIs REST do Fluig
│   ├── fluig.backend.d.ts        # workflow, hAPI, log, ServiceManager, FormController
│   ├── fluig.dataset.d.ts        # DatasetFactory, DefaultDataset, constraints
│   ├── fluig.frontend.d.ts       # FLUIGC, WCMAPI, Datatable, Modal, Toast
│   ├── fluig.sdk.d.ts            # com.fluig.sdk.* (FluigAPI, services, VOs)
│   └── fluig.webservice.d.ts     # ECMWorkflowEngineServiceService e DTOs
└── java/
    └── java.d.ts                 # java.util, java.lang, java.sql, javax.*

🔗 Integração com jsegd-fluig-lint

O plugin jsegd-fluig-lint extrai automaticamente os globais declarados aqui em tempo de carga, evitando duplicação de listas de identificadores. Mantenha as duas dependências sincronizadas:

npm install -D jsegd-fluig-lint jsegd-fluig-types eslint

📋 Requisitos

  • TypeScript 3.0+ (testado em 5.9 com strict: true).
  • Ambiente Fluig em runtime (não há código emitido — somente tipagens).

📄 Licença

Distribuído sob CC-BY-NC-ND-4.0. Consulte os termos antes de uso comercial ou redistribuição modificada.


Desenvolvido com ❤️ pela EGD Tecnologia