jsegd-fluig-types 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,29 +1,153 @@
1
1
  # jsegd-fluig-types
2
2
 
3
- Pacote de tipos TypeScript para integração com o Fluig.
3
+ ![Version](https://img.shields.io/badge/version-1.0.12-blue.svg)
4
+ ![License](https://img.shields.io/badge/license-CC--BY--NC--ND--4.0-green.svg)
4
5
 
5
- ## Instalação
6
+ Pacote de tipos TypeScript para desenvolvimento com a plataforma Fluig. Este pacote fornece tipagens completas para APIs do Fluig, facilitando o desenvolvimento tanto no frontend quanto no backend.
6
7
 
7
- ```sh
8
+ ## 📦 Instalação
9
+
10
+ ```bash
8
11
  npm install jsegd-fluig-types
9
12
  ```
10
13
 
11
- ## Uso
14
+ ## 🚀 Uso
15
+
16
+ ### Importação Global
17
+
18
+ ```typescript
19
+ // Importa todos os tipos disponíveis
20
+ import "jsegd-fluig-types";
21
+ ```
22
+
23
+ ### Uso em Projetos Fluig
24
+
25
+ #### Frontend (Widget/Portal)
26
+ ```typescript
27
+ // Os tipos estarão disponíveis globalmente
28
+ // Exemplo: usando tipos de formulário
29
+ const mode: FormMod = FormMod.ADD;
30
+
31
+ // Exemplo: usando componentes de autocomplete
32
+ const autocompleteConfig: AutocompleteOptions = {
33
+ type: AutocompleteTypes.tag,
34
+ // ... outras configurações
35
+ };
36
+ ```
37
+
38
+ #### Backend (Dataset/Evento de Workflow)
39
+ ```typescript
40
+ // Tipos para datasets
41
+ function createDataset(fields: string[], constraints: Constraint[]): DatasetBuilder {
42
+ // Implementação do dataset
43
+ }
44
+
45
+ // Tipos para eventos de workflow
46
+ function beforeTaskSave(colleagueId: string, nextSequenceId: number, userTaskVO: UserTaskVO): void {
47
+ // Implementação do evento
48
+ }
49
+ ```
50
+
51
+ #### SDK do Fluig
52
+ ```typescript
53
+ // Acesso às APIs do Fluig com tipagem completa
54
+ const fluigAPI = new com.fluig.sdk.api.FluigAPI();
55
+ const documentService = fluigAPI.getDocumentService();
56
+ const userService = fluigAPI.getUserService();
57
+ ```
58
+
59
+ ## 📁 Estrutura do Pacote
60
+
61
+ | Arquivo | Descrição |
62
+ |---------|-----------|
63
+ | **`fluig.sdk.d.ts`** | Tipos para SDK do Fluig - APIs Java disponíveis no servidor |
64
+ | **`java.d.ts`** | Tipos para classes Java básicas (List, ArrayList, HashMap, etc.) |
65
+ | **`fluig.frontend.d.ts`** | Tipos para desenvolvimento frontend (widgets, portais) |
66
+ | **`fluig.backend.d.ts`** | Tipos para desenvolvimento backend (datasets, eventos) |
67
+ | **`index.d.ts`** | Arquivo principal que exporta todos os tipos |
68
+
69
+ ## 🎯 Funcionalidades
70
+
71
+ ### ✅ Frontend
72
+ - Tipos para componentes de formulário
73
+ - Enums para modos de formulário (`FormMod`)
74
+ - Tipos para autocomplete e widgets
75
+ - Interfaces para eventos frontend
76
+
77
+ ### ✅ Backend
78
+ - Tipos para datasets e constrangimentos
79
+ - Interfaces para eventos de workflow
80
+ - Tipos para respostas de APIs
81
+ - Enums para status e tipos de dados
12
82
 
13
- Importe os tipos conforme necessário:
83
+ ### SDK
84
+ - Tipagem completa para todas as APIs do Fluig
85
+ - Serviços de documentos, usuários, workflow, etc.
86
+ - Classes e interfaces para integração Java
87
+
88
+ ## 💡 Exemplos Práticos
89
+
90
+ ### Criando um Dataset
91
+ ```typescript
92
+ function createDataset(fields: string[], constraints: Constraint[]): DatasetBuilder {
93
+ const dataset = DatasetBuilder.newDataset();
94
+
95
+ // Adicionar colunas
96
+ fields.forEach(field => {
97
+ dataset.addColumn(field);
98
+ });
99
+
100
+ // Aplicar constraints
101
+ constraints.forEach(constraint => {
102
+ // Processar constraint com tipagem
103
+ });
104
+
105
+ return dataset;
106
+ }
107
+ ```
14
108
 
109
+ ### Evento de Workflow
15
110
  ```typescript
16
- import { /* tipos */ } from 'jsegd-fluig-types';
111
+ function beforeTaskSave(
112
+ colleagueId: string,
113
+ nextSequenceId: number,
114
+ userTaskVO: UserTaskVO
115
+ ): void {
116
+ // Lógica do evento com tipos seguros
117
+ if (userTaskVO.getColleagueId() === colleagueId) {
118
+ // Processar tarefa
119
+ }
120
+ }
17
121
  ```
18
122
 
19
- ## Conteúdo
20
- - `fluig.sdk.d.ts`: Tipos para SDK do Fluig
21
- - `java.d.ts`: Tipos para integração Java
22
- - `types.d.ts`: Tipos utilitários
23
- - `index.d.ts`: Exporta todos os tipos
123
+ ## 📋 Requisitos
24
124
 
25
- ## Licença
26
- Este pacote está sob a licença CC-BY-NC-ND-4.0. Uso permitido apenas para fins não comerciais e sem modificações.
125
+ - TypeScript 3.0+
126
+ - Ambiente Fluig (para execução)
27
127
 
28
- ## Empresa
128
+ ## 📄 Licença
129
+
130
+ Este projeto está licenciado sob **CC-BY-NC-ND-4.0**.
131
+
132
+ **Termos de Uso:**
133
+ - ✅ Uso permitido para fins **não comerciais**
134
+ - ✅ Atribuição obrigatória ao autor
135
+ - ❌ Modificações não permitidas
136
+ - ❌ Uso comercial não permitido
137
+
138
+ ## 👨‍💻 Autor
139
+
140
+ **Elemar Deckmann**
29
141
  [EGD Tecnologia](https://www.egd.tec.br/)
142
+
143
+ ## 🤝 Contribuições
144
+
145
+ Este projeto segue a licença CC-BY-NC-ND-4.0, que não permite modificações. Para sugestões ou melhorias, entre em contato através do site da EGD Tecnologia.
146
+
147
+ ---
148
+
149
+ <div align="center">
150
+
151
+ **[EGD Tecnologia](https://www.egd.tec.br/)** - Especialistas em Fluig
152
+
153
+ </div>
@@ -0,0 +1,467 @@
1
+ declare enum FormMod {
2
+ "ADD" = "ADD",
3
+ "MOD" = "MOD",
4
+ "VIEW" = "VIEW",
5
+ "NONE" = "NONE",
6
+ }
7
+ declare enum DatasetFieldType {
8
+ NUMBER = "NUMBER",
9
+ DATE = "DATE",
10
+ BOOLEAN = "BOOLEAN",
11
+ STRING = "STRING",
12
+ TEXT = "TEXT",
13
+ }
14
+
15
+ declare enum Status {
16
+ SUCCESS = "success",
17
+ ERROR = "error",
18
+ WARNING = "warning",
19
+ FAIL = "fail",
20
+ }
21
+
22
+ declare type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
23
+
24
+ declare global {
25
+ interface ErrorDetail {
26
+ code: string;
27
+ message: string;
28
+ field?: string;
29
+ }
30
+ interface DatasetResponse {
31
+ status: Status;
32
+ code: number;
33
+ message: string;
34
+ data?: unknown;
35
+ errors?: ErrorDetail[];
36
+ }
37
+
38
+ interface WKValues {
39
+ WKDef: string;
40
+ WKVersDef: string;
41
+ WKNumProces: string;
42
+ WKNumState: string;
43
+ WKCompany: string;
44
+ WKUser: string;
45
+ WKUserComment: string;
46
+ WKCompletTask: boolean;
47
+ WKNextState: string;
48
+ WKCardId: string;
49
+ WKFormId: string;
50
+ WKIdentityCompany: string;
51
+ WKMobile: string;
52
+ WKIsService: string;
53
+ WKUserLocale: string;
54
+ WKManagerMode: string;
55
+ WKReplacement: string;
56
+ WKIsTransfer: string;
57
+ WKCurrentMovto: string;
58
+ WKActualThread: string;
59
+ }
60
+
61
+ interface DatasetRequest {
62
+ wkValues: WKValues;
63
+ cardData: { [key: string]: string };
64
+ }
65
+
66
+ // Classe que representa um Dataset padrão do Fluig
67
+ class DefaultDataset {
68
+ // Implementação para adicionar uma coluna ao Dataset
69
+ addColumn(colName: keyof DatasetResponse): void;
70
+ addColumn(colName: java.lang.String): void;
71
+
72
+ // Implementação para adicionar uma linha ao Dataset
73
+ addRow(values: DatasetResponse): void;
74
+ addRow(values: java.lang.Object[]): void;
75
+
76
+ // Implementação para atualizar uma linha do Dataset
77
+ updateRow(values: java.lang.Object[]): void;
78
+
79
+ // Implementação para adicionar ou atualizar uma linha do Dataset
80
+ addOrUpdateRow(values: java.lang.Object[]): void;
81
+
82
+ // Implementação para remover uma linha do Dataset
83
+ deleteRow(values: java.lang.Object[]): void;
84
+
85
+ // Implementação para retornar o nome de uma coluna do Dataset
86
+ getColumnName(colNum: number): java.lang.String;
87
+
88
+ // Implementação para retornar os nomes das colunas do Dataset
89
+ getColumnsName(): java.lang.String[];
90
+
91
+ // Implementação para retornar a quantidade de colunas de um Dataset
92
+ getColumnsCount(): number;
93
+
94
+ // Implementação para retornar os valores do Dataset na forma de uma lista contendo mapas
95
+ getMap(): java.util.ArrayList<
96
+ java.util.HashMap<java.lang.String, java.lang.Object>
97
+ >;
98
+
99
+ // Implementação para retornar a quantidade de linhas disponíveis no Dataset
100
+ getRowsCount(): number;
101
+
102
+ // Implementação para retornar um subconjunto dos dados do Dataset, na forma de um novo Dataset
103
+ getSubDataset(
104
+ field: java.lang.String,
105
+ value: java.lang.Object
106
+ ): DefaultDataset;
107
+
108
+ // Implementação para retornar o valor armazenado no Dataset, na linha e coluna passadas por parâmetro
109
+ getValue(row: number, col: number): java.lang.Object;
110
+
111
+ // Implementação para retornar o valor armazenado no Dataset, na linha passada e campo passados por parâmetro
112
+ getValue(row: number, colName: java.lang.String): java.lang.Object;
113
+
114
+ // Implementação para retornar todos os valores de um Dataset, na forma de um array bidimensional
115
+ getValues(): java.lang.Object[][];
116
+
117
+ // Implementação para retornar um ResultSet contendo os dados do Dataset.
118
+ toResultSet(): java.sql.ResultSet;
119
+ }
120
+
121
+ // Cria uma nova instância do DatasetBuilder
122
+ class DatasetBuilder {
123
+ // Cria um novo Dataset
124
+ static newDataset(): DefaultDataset;
125
+ }
126
+
127
+ enum ConstraintType {
128
+ MUST = 1,
129
+ SHOULD = 2,
130
+ MUST_NOT = 3,
131
+ }
132
+
133
+ class DatasetFactory {
134
+ // Cria uma nova constraint para a seleção de registros do Dataset.
135
+ static createConstraint(
136
+ field: java.lang.String,
137
+ initialValue: java.lang.String,
138
+ finalValue: java.lang.String,
139
+ type: ConstraintType
140
+ ): SearchConstraint;
141
+
142
+ // Retorna uma lista de todos os Datasets disponíveis no sistema.
143
+ static getAvailableDatasets(): java.util.List<java.lang.String>;
144
+
145
+ // Carrega os dados de um Dataset.
146
+ static getDataset(
147
+ name: java.lang.String,
148
+ fields: java.lang.String[],
149
+ constraints: SearchConstraint[],
150
+ order: java.lang.String[]
151
+ ): DefaultDataset;
152
+ }
153
+
154
+ class SearchConstraint {
155
+ fieldName: string;
156
+ initialValue: string;
157
+ finalValue: string;
158
+ constraintType: ConstraintType;
159
+ likeSearch: boolean;
160
+
161
+ getFieldName(): string;
162
+ getInitialValue(): string;
163
+ getFinalValue(): string;
164
+ setLikeSearch(likeSearch: boolean): void;
165
+ }
166
+
167
+ // Cria um campo na tabela com o nome e tipo informados. O nome sempre deve ser informado em caracteres maiúsculos. O tipo de campo pode ser omitido e neste caso o campo será criado com o tipo String
168
+ function AddColumn(field: java.lang.String, type: DatasetFieldType): void;
169
+
170
+ // Determina quais são os campos chaves para o dataset. No banco de dados será criado um índice utilizando os campos informados neste método. Esses campos serão utilizados na localização dos registros para atualização ou remoção das linhas através dos métodos updateRow e deleteRow. Importante informar apenas campos que foram previamente definidos com a função addColumn. Devem ser informados em caracteres maiúsculos.
171
+ function setKey(fields: java.lang.String[]): void;
172
+
173
+ // Permite adicionar mais índices para obtenção de maior performance nas consultas do dataset. Devem ser informados em caracteres maiúsculos.
174
+ function addIndex(fields: java.lang.String[]): void;
175
+
176
+ /**
177
+ * Define a estrutura do dataset.
178
+ * @example
179
+ * function defineStructure(): void{
180
+ * AddColumn("NOME", DatasetFieldType.STRING);
181
+ * AddColumn("IDADE", DatasetFieldType.NUMBER);
182
+ * setKey(["NOME"]);
183
+ * addIndex(["IDADE"]);
184
+ * };
185
+ */
186
+ function defineStructure(): void;
187
+ function onSync(lastSyncDate: Date): DefaultDataset;
188
+ function createDataset(
189
+ fields: string[],
190
+ constraints: SearchConstraint[],
191
+ sortFields: string[]
192
+ ): DefaultDataset;
193
+ function onMobileSync(user: string): void;
194
+
195
+ /**
196
+ * GlobalVars
197
+ *
198
+ * Objeto que armazena variáveis globais do workflow, permitindo o acesso e manipulação de informações compartilhadas entre diferentes partes do sistema.
199
+ * @example
200
+ * // Definindo uma variável global
201
+ * globalVars.put("varName", "varValue");
202
+ *
203
+ * // Acessando uma variável global
204
+ * const processo = globalVars.get("varName");
205
+ */
206
+ const globalVars: java.util.HashMap<java.lang.String, java.lang.String>;
207
+
208
+ /**
209
+ * Obtém o valor de uma variável global do workflow
210
+ * @param key - Chave da variável global do workflow:
211
+ * - WKDef: Código do processo
212
+ * - WKVersDef: Versão do processo
213
+ * - WKNumProces: Número da solicitação de processo
214
+ * - WKNumState: Número da atividade
215
+ * - WKCompany: Número da empresa
216
+ * - WKUser: Código do usuário corrente
217
+ * - WKUserComment: Comentário do usuário
218
+ * - WKCompletTask: Se a tarefa foi completada
219
+ * - WKNextState: Número da próxima atividade (destino)
220
+ * - WKCardId: Código do registro de formulário do processo
221
+ * - WKFormId: Código do formulário do processo
222
+ * - WKIdentityCompany: Identificador da empresa selecionada para Experiências de uso TOTVS
223
+ * - WKMobile: Identifica se a ação foi realizada através de um dispositivo mobile
224
+ * - WKIsService: Identifica se a solicitação de cancelamento foi realizada através de um serviço
225
+ * - WKUserLocale: Identifica o idioma corrente do usuário
226
+ * - WKManagerMode: Identifica se o processo está sendo movimentado pela visão do gestor
227
+ * - WKReplacement: Código do usuário substituto
228
+ * - WKIsTransfer: Permite verificar se o usuário está ou não transferindo uma tarefa
229
+ * - WKCurrentMovto: Permite a movimentação do processo
230
+ * - WKActualThread: Retorna a Thread atual do processo
231
+ * @returns Valor da variável global do workflow
232
+ */
233
+ function getValue(key: "WKDef"): string;
234
+ function getValue(key: "WKVersDef"): string;
235
+ function getValue(key: "WKNumProces"): string;
236
+ function getValue(key: "WKNumState"): string;
237
+ function getValue(key: "WKCompany"): string;
238
+ function getValue(key: "WKUser"): string;
239
+ function getValue(key: "WKUserComment"): string;
240
+ function getValue(key: "WKCompletTask"): boolean;
241
+ function getValue(key: "WKNextState"): string;
242
+ function getValue(key: "WKCardId"): string;
243
+ function getValue(key: "WKFormId"): string;
244
+ function getValue(key: "WKIdentityCompany"): string;
245
+ function getValue(key: "WKMobile"): string;
246
+ function getValue(key: "WKIsService"): string;
247
+ function getValue(key: "WKUserLocale"): string;
248
+ function getValue(key: "WKManagerMode"): string;
249
+ function getValue(key: "WKReplacement"): string;
250
+ function getValue(key: "WKIsTransfer"): string;
251
+ function getValue(key: "WKCurrentMovto"): string;
252
+ function getValue(key: "WKActualThread"): string;
253
+
254
+ /**
255
+ * Obtém informações da API de Workflow
256
+ */
257
+ class hAPI {
258
+ /**
259
+ * Permite acessar o valor de um campo do formulário do processo
260
+ * @param nomeCampo - Nome do campo do formulário
261
+ */
262
+ static getCardValue(nomeCampo: string): string;
263
+ /**
264
+ * Permite definir o valor de um campo do formulário do processo
265
+ * @param nomeCampo - Nome do campo do formulário
266
+ * @param valor - Valor a ser definido no campo do formulário
267
+ */
268
+ static setCardValue(nomeCampo: string, valor: string): string;
269
+ /**
270
+ * Adiciona um filho no formulário pai e filho do processo
271
+ * @param tableName - Nome da tabela do formulário
272
+ * @param cardData - Mapa com os campos do filho e seus valores
273
+ * @example
274
+ * const cardData = new java.util.HashMap();
275
+ * cardData.put("NOME", "João");
276
+ * cardData.put("IDADE", "30");
277
+ * hAPI.addCardChild("TABELA_FILHOS", cardData);
278
+ */
279
+ static addCardChild(
280
+ tableName: string,
281
+ cardData: java.util.HashMap<java.lang.String, java.lang.String>
282
+ ): void;
283
+
284
+ static removeCardChild(tableName: string, index: number): void;
285
+ static setAutomaticDecision(
286
+ taskNumber: number,
287
+ responsible: java.util.ArrayList<string>,
288
+ comment: string
289
+ ): void;
290
+ static getActiveStates(): java.util.ArrayList<object>;
291
+ static getParentInstance(processInstanceId: number): number;
292
+ static getChildrenInstances(
293
+ processInstanceId: number
294
+ ): java.util.List<number>;
295
+ static setDueDate(
296
+ processId: number,
297
+ numThread: number,
298
+ userId: string,
299
+ dueDate: Date,
300
+ timeInSeconds: number
301
+ ): void;
302
+ static transferTask(
303
+ users: java.util.ArrayList<string>,
304
+ comment: string,
305
+ numThread?: number
306
+ ): void;
307
+ static setTaskComments(
308
+ userId: string,
309
+ processId: number,
310
+ threadId: number,
311
+ comment: string
312
+ ): void;
313
+ static getAdvancedProperty(nomePropriedade: string): string;
314
+ static getCardData(numProcesso: number): java.util.HashMap<string, string>;
315
+ static startProcess(
316
+ processId: string,
317
+ taskNumber: number,
318
+ users: java.util.ArrayList<java.lang.String>,
319
+ comment?: string,
320
+ taskFinished?: boolean,
321
+ form?: java.util.HashMap<java.lang.String, java.lang.String>,
322
+ managerMode?: boolean
323
+ ): java.util.HashMap<string, string>;
324
+ static calculateDeadLineHours(
325
+ deadlineDate: Date,
326
+ seconds: number,
327
+ deadlineInHours: number,
328
+ periodId: string
329
+ ): unknown;
330
+ static calculateDeadLineTime(
331
+ deadlineDate: Date,
332
+ seconds: number,
333
+ deadlineInHours: number,
334
+ periodId: string
335
+ ): unknown;
336
+ static setColleagueReplacement(responsible: string): void;
337
+ static getUserTaskLink(numAtividade: number): string;
338
+ static getActualThread(
339
+ companyNumber: number,
340
+ processNumber: number,
341
+ activityNumber: number
342
+ ): number;
343
+ static createAdHocTasks(
344
+ processoId: number,
345
+ sequenciaId: number,
346
+ assunto: string,
347
+ detalhamento: string,
348
+ tarefas: unknown[]
349
+ ): void;
350
+ static listAttachments(): java.util.List<unknown>;
351
+ static publishWorkflowAttachment(documentDto: unknown): void;
352
+ static attachDocument(documentId: number): void;
353
+ static getChildrenFromTable(
354
+ tableName: string
355
+ ): java.util.HashMap<string, string>;
356
+ static getChildrenIndexes(tableName: string): number[];
357
+ static getAvailableStatesDetail(
358
+ companyId: number,
359
+ userId: string,
360
+ processId: number,
361
+ processInstanceId: number,
362
+ threadSequenceId?: number
363
+ ): unknown;
364
+ }
365
+
366
+ class JSONUtil {
367
+ static toJSON(data: object): java.lang.String;
368
+ }
369
+
370
+ // #########################################################################
371
+ // ########################## Eventos de Formulário ########################
372
+ // #########################################################################
373
+ class FormController {
374
+ getCompanyId(): number;
375
+ getDocumentId(): number;
376
+ getVersion(): number;
377
+ getCardIndex(): number;
378
+ setEnabled(nomeCampo: string, habilita: boolean, protegido: boolean): void;
379
+ getEnabled(nomeCampo: string): boolean;
380
+ setValue(nomeCampo: string, valor: string): void;
381
+ getValue(nomeCampo: string): string;
382
+ setVisible(nomeCampo: string, visible: boolean): void;
383
+ setVisibleById(idDoCampo: string, visible: boolean): void;
384
+ setShowDisabledFields(habilita: boolean): void;
385
+ setHidePrintLink(habilita: boolean): void;
386
+ setHideDeleteButton(habilita: boolean): void;
387
+ setEnhancedSecurityHiddenInputs(proteger: boolean): void;
388
+ getFormMode(): FormMod;
389
+ isHidePrintLink(): boolean;
390
+ getChildrenFromTable(tableName: string): object;
391
+ getChildrenIndexes(tableName: string): number[];
392
+ isHideDeleteButton(): boolean;
393
+ getMobile(): boolean;
394
+ isVisible(nomeCampo: string): boolean;
395
+ isVisibleById(id: string): boolean;
396
+ }
397
+ class customHTML {
398
+ static append(html: string): void;
399
+ }
400
+ function displayFields(form: FormController, customHTML: customHTML): void;
401
+ function enableFields(form: FormController): void;
402
+ function inputFields(form: FormController): void;
403
+ function validateForm(form: FormController): void;
404
+
405
+ // #########################################################################
406
+ // ####################### Definição de Log ################################
407
+ // #########################################################################
408
+ class log {
409
+ static dir(object: object): void;
410
+ static info(message: string): void;
411
+ static error(message: string): void;
412
+ static warn(message: string): void;
413
+ static debug(message: string): void;
414
+ }
415
+
416
+ // #########################################################################
417
+ // ########################## ServiceManager Types #########################
418
+ // #########################################################################
419
+
420
+ // Mapeamento de classes Java comuns no Fluig
421
+ interface ClassNameMap {
422
+ 'java.util.ArrayList': java.util.ArrayList<any>;
423
+ 'java.util.HashMap': java.util.HashMap<any, any>;
424
+ 'java.util.List': java.util.List<any>;
425
+ 'java.util.Collection': java.util.Collection<any>;
426
+ 'java.util.Map': java.util.Map<any, any>;
427
+ 'java.lang.String': java.lang.String;
428
+ 'java.lang.Integer': java.lang.Integer;
429
+ 'java.lang.Long': java.lang.Long;
430
+ 'java.lang.Object': java.lang.Object;
431
+ 'java.sql.ResultSet': java.sql.ResultSet;
432
+ 'java.sql.Date': java.sql.Date;
433
+ 'java.sql.Timestamp': java.sql.Timestamp;
434
+ 'javax.naming.InitialContext': javax.naming.InitialContext;
435
+ 'com.fluig.sdk.api.FluigAPI': com.fluig.sdk.api.FluigAPI;
436
+ 'com.totvs.technology.ecm.workflow.ws.ECMWorkflowEngineServiceService': com.totvs.technology.ecm.workflow.ws.ECMWorkflowEngineServiceService;
437
+ }
438
+
439
+ class ServiceManager {
440
+ static getService(serviceName: string): Service;
441
+ }
442
+
443
+ class Service {
444
+ getBean(): {
445
+ /**
446
+ * Instancia uma classe Java com tipagem específica baseada no nome da classe
447
+ * @param className Nome completo da classe Java
448
+ * @returns Instância da classe com tipagem apropriada
449
+ * @example
450
+ * const arrayList = service.getBean().instantiate('java.util.ArrayList');
451
+ * arrayList.add("item"); // Métodos do ArrayList disponíveis
452
+ *
453
+ * const hashMap = service.getBean().instantiate('java.util.HashMap');
454
+ * hashMap.put("key", "value"); // Métodos do HashMap disponíveis
455
+ *
456
+ * const fluigAPI = service.getBean().instantiate('com.fluig.sdk.api.FluigAPI');
457
+ * fluigAPI.getUserService(); // Métodos da FluigAPI disponíveis
458
+ *
459
+ * const workflowService = service.getBean().instantiate('com.totvs.technology.ecm.workflow.ws.ECMWorkflowEngineServiceService');
460
+ * workflowService.startProcess(...); // Métodos do ECMWorkflowEngineService disponíveis
461
+ */
462
+ instantiate<T extends keyof ClassNameMap>(className: T): ClassNameMap[T];
463
+ instantiate<T = any>(className: string): T;
464
+ };
465
+ }
466
+ }
467
+ export {};
@@ -157,12 +157,7 @@ declare type ConfirmCallback = (
157
157
  ) => void;
158
158
  declare type MessageCallback = (element: HTMLElement, event: Event) => void;
159
159
 
160
- declare enum Status {
161
- SUCCESS = "success",
162
- ERROR = "error",
163
- WARNING = "warning",
164
- FAIL = "fail",
165
- }
160
+
166
161
 
167
162
  declare type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
168
163
 
@@ -255,178 +250,13 @@ declare global {
255
250
  };
256
251
  }
257
252
 
258
- class Dataset {
259
- rowsCount: number;
260
- updateRow(valores: string[] | object[]): void;
261
- addOrUpdateRow(valores: string[] | object[]): void;
262
- deleteRow(valores: string[] | object[]): void;
263
- addColumn(): void;
264
- addRow(): void;
265
- getColumnName(): java.lang.String;
266
- getColumnsName(): java.lang.String[];
267
- getColumnsCount(): number;
268
- getMap(): java.util.ArrayList<
269
- java.util.HashMap<java.lang.String, java.lang.Object>
270
- >;
271
- getRowsCount(): number;
272
- getSubDataset(): Dataset;
273
- getValue(row: number, col: number): string;
274
- getValue(row: number, colName: string): string;
275
- getValues(): java.lang.Object[][];
276
- toResultSet(): java.sql.ResultSet;
277
- addColumn(name: string): void;
278
- addRow(row: unknown[]): void;
279
- getValue(row: number, column: string): string;
280
- }
281
- /**
282
- * Função principal para criação de datasets no Fluig
283
- * Cada arquivo de dataset deve implementar esta função
284
- */
285
- function createDataset(
286
- fields: string[],
287
- constraints: Constraint[],
288
- sortFields: string[]
289
- ): Dataset;
290
-
291
253
  // Funções globais do Fluig
292
254
  function wdkAddChild(tablename: string): number;
293
255
  function fnWdkRemoveChild(element: Element): void;
294
- function getValue(element: string): string;
295
256
 
296
257
  // Variável global definida pelo Fluig no navegador
297
258
  const formMode: FormMod;
298
259
 
299
- // Namespace hAPI
300
- namespace hAPI {
301
- function getCardValue(nomeCampo: string): string;
302
- function setCardValue(nomeCampo: string, valor: string): string;
303
- function addCardChild(
304
- tableName: string,
305
- cardData: java.util.HashMap<java.lang.String, java.lang.String>
306
- ): void;
307
- function removeCardChild(tableName: string, index: number): void;
308
- function setAutomaticDecision(
309
- taskNumber: number,
310
- responsible: java.util.ArrayList<string>,
311
- comment: string
312
- ): void;
313
- function getActiveStates(): java.util.ArrayList<object>;
314
- function getParentInstance(processInstanceId: number): number;
315
- function getChildrenInstances(
316
- processInstanceId: number
317
- ): java.util.List<number>;
318
- function setDueDate(
319
- processId: number,
320
- numThread: number,
321
- userId: string,
322
- dueDate: Date,
323
- timeInSeconds: number
324
- ): void;
325
- function transferTask(
326
- users: java.util.ArrayList<string>,
327
- comment: string,
328
- numThread?: number
329
- ): void;
330
- function setTaskComments(
331
- userId: string,
332
- processId: number,
333
- threadId: number,
334
- comment: string
335
- ): void;
336
- function getAdvancedProperty(nomePropriedade: string): string;
337
- function getCardData(
338
- numProcesso: number
339
- ): java.util.HashMap<string, string>;
340
- function startProcess(
341
- processId: string,
342
- taskNumber: number,
343
- users: java.util.ArrayList<java.lang.String>,
344
- comment?: string,
345
- taskFinished?: boolean,
346
- form?: java.util.HashMap<java.lang.String, java.lang.String>,
347
- managerMode?: boolean
348
- ): java.util.HashMap<string, string>;
349
- function calculateDeadLineHours(
350
- deadlineDate: Date,
351
- seconds: number,
352
- deadlineInHours: number,
353
- periodId: string
354
- ): unknown;
355
- function calculateDeadLineTime(
356
- deadlineDate: Date,
357
- seconds: number,
358
- deadlineInHours: number,
359
- periodId: string
360
- ): unknown;
361
- function setColleagueReplacement(responsible: string): void;
362
- function getUserTaskLink(numAtividade: number): string;
363
- function getActualThread(
364
- companyNumber: number,
365
- processNumber: number,
366
- activityNumber: number
367
- ): number;
368
- function createAdHocTasks(
369
- processoId: number,
370
- sequenciaId: number,
371
- assunto: string,
372
- detalhamento: string,
373
- tarefas: unknown[]
374
- ): void;
375
- function listAttachments(): java.util.List<unknown>;
376
- function publishWorkflowAttachment(documentDto: unknown): void;
377
- function attachDocument(documentId: number): void;
378
- function getChildrenFromTable(
379
- tableName: string
380
- ): java.util.HashMap<string, string>;
381
- function getChildrenIndexes(tableName: string): number[];
382
- function getAvailableStatesDetail(
383
- companyId: number,
384
- userId: string,
385
- processId: number,
386
- processInstanceId: number,
387
- threadSequenceId?: number
388
- ): unknown;
389
- }
390
-
391
- class log {
392
- static dir(object: object): void;
393
- static info(message: string): void;
394
- static error(message: string): void;
395
- }
396
-
397
- enum ConstraintType {
398
- MUST = 1,
399
- SHOULD = 2,
400
- MUST_NOT = 3,
401
- }
402
-
403
- class DatasetFactory {
404
- static getAvailableDatasets(): string[];
405
- static createConstraint(
406
- fieldName: string,
407
- initialValue: string,
408
- finalValue: string,
409
- constraintType: ConstraintType
410
- ): Constraint;
411
- static createConstraint(
412
- fieldName: string,
413
- initialValue: string,
414
- finalValue: string,
415
- constraintType: ConstraintType,
416
- searchLike: boolean
417
- ): Constraint;
418
- static getDataset(
419
- nomeDataset: string,
420
- campos: string[] | null,
421
- constraints: Constraint[] | null,
422
- ordem: string[] | null
423
- ): Dataset | DatasetWcmResult;
424
- }
425
-
426
- class JSONUtil {
427
- static toJSON(data: object): java.lang.String;
428
- }
429
-
430
260
  // Adicione as declarações de tipos para Dataset e Constraint se não estiverem disponíveis globalmente
431
261
 
432
262
  // =============================
@@ -435,31 +265,7 @@ declare global {
435
265
 
436
266
  // Adicione o tipo HttpMethod
437
267
 
438
- interface DatasetRequest {
439
- serviceParams: string;
440
- serviceCode: string;
441
- endpoint: string;
442
- method: HttpMethod;
443
- options?: Record<string, string>;
444
- headers?: Record<string, string>;
445
- }
446
-
447
- class DatasetBuilder {
448
- static newDataset(): Dataset;
449
- }
450
-
451
- class Constraint {
452
- fieldName: string;
453
- initialValue: string;
454
- finalValue: string;
455
- constraintType: ConstraintType;
456
- setLikeSearch(likeSearch: boolean): void;
457
- getFieldName(): string;
458
- getInitialValue(): string;
459
- getFinalValue(): string;
460
- }
461
-
462
- class SearchConstraint {}
268
+
463
269
 
464
270
  class DatasetWcmCallback {
465
271
  success: (result: DatasetWcmResult) => unknown;
@@ -629,35 +435,6 @@ declare global {
629
435
  // CLASSES DE FORMULÁRIO
630
436
  // =============================
631
437
 
632
- class FormController {
633
- getCompanyId(): number;
634
- getDocumentId(): number;
635
- getVersion(): number;
636
- getCardIndex(): number;
637
- setEnabled(nomeCampo: string, habilita: boolean, protegido: boolean): void;
638
- getEnabled(nomeCampo: string): boolean;
639
- setValue(nomeCampo: string, valor: string): void;
640
- getValue(nomeCampo: string): string;
641
- setVisible(nomeCampo: string, visible: boolean): void;
642
- setVisibleById(idDoCampo: string, visible: boolean): void;
643
- setShowDisabledFields(habilita: boolean): void;
644
- setHidePrintLink(habilita: boolean): void;
645
- setHideDeleteButton(habilita: boolean): void;
646
- setEnhancedSecurityHiddenInputs(proteger: boolean): void;
647
- getFormMode(): FormMod;
648
- isHidePrintLink(): boolean;
649
- getChildrenFromTable(tableName: string): object;
650
- getChildrenIndexes(tableName: string): number[];
651
- isHideDeleteButton(): boolean;
652
- getMobile(): boolean;
653
- isVisible(nomeCampo: string): boolean;
654
- isVisibleById(id: string): boolean;
655
- }
656
-
657
- class customHTML {
658
- append(html: string): void;
659
- }
660
-
661
438
  // =============================
662
439
  // CLASSES DE API
663
440
  // =============================
@@ -673,10 +450,6 @@ declare global {
673
450
  user: string;
674
451
  }
675
452
 
676
- class ServiceManager {
677
- static getServiceInstance(service: string): unknown;
678
- }
679
-
680
453
  class JSInterface {
681
454
  static showCamera(param: string): void;
682
455
  }
@@ -691,39 +464,5 @@ declare global {
691
464
  values: T[];
692
465
  }
693
466
 
694
- interface ServiceRequestOptions {
695
- companyId: string;
696
- serviceCode: string;
697
- endpoint: string;
698
- timeoutService?: number;
699
- method: HttpMethod;
700
- params: string;
701
- options?: Record<string, string> | undefined;
702
- headers?: Record<string, string> | undefined;
703
- }
704
-
705
- interface ErrorDetail {
706
- code: string;
707
- message: string;
708
- field?: string;
709
- }
710
- interface DatasetValue {
711
- status: Status;
712
- code: number;
713
- message: string;
714
- data?: unknown | null;
715
- errors?: ErrorDetail[];
716
- }
717
- interface ClientErrorInstance extends Error {
718
- name: string;
719
- message: string;
720
- statusCode: number;
721
- stack?: string;
722
- }
723
-
724
- interface ResultDataset {
725
- status: number;
726
- result: string;
727
- }
728
467
  }
729
468
  export {};
@@ -0,0 +1,344 @@
1
+ // fluig.webservice.d.ts
2
+ // Tipos para webservices do Fluig
3
+
4
+ declare global {
5
+ // #########################################################################
6
+ // #################### ECM Workflow Engine Service Types ##################
7
+ // #########################################################################
8
+
9
+ namespace com {
10
+ namespace totvs {
11
+ namespace technology {
12
+ namespace ecm {
13
+ namespace workflow {
14
+ namespace ws {
15
+ // Classe principal do serviço ECM Workflow Engine
16
+ class ECMWorkflowEngineServiceService {
17
+ constructor();
18
+
19
+ // Método para obter a porta do serviço
20
+ getWorkflowEngineServicePort(): WorkflowEngineService;
21
+
22
+ // Métodos de gerenciamento de processo
23
+ importProcess(username: string, password: string, companyId: number, processId: string, processFile: string): string;
24
+ exportProcess(username: string, password: string, companyId: number, processId: string, version: number): string;
25
+ exportProcessInZipFormat(username: string, password: string, companyId: number, processId: string, version: number): string;
26
+
27
+ // Métodos de inicialização de processo
28
+ startProcess(username: string, password: string, companyId: number, processId: string, nextState: number, choosedUsers: java.util.ArrayList<string>, comments: string, completeTask: boolean, cardData: java.util.HashMap<string, string>, managerMode: boolean): java.util.HashMap<string, string>;
29
+ startProcessClassic(username: string, password: string, companyId: number, processId: string, nextState: number, choosedUsers: java.util.ArrayList<string>, comments: string, completeTask: boolean, cardData: java.util.HashMap<string, string>): java.util.HashMap<string, string>;
30
+ simpleStartProcess(username: string, password: string, companyId: number, processId: string, nextState: number, userId: string, comments: string): java.util.HashMap<string, string>;
31
+
32
+ // Métodos de gerenciamento de tarefas
33
+ saveAndSendTask(username: string, password: string, companyId: number, processInstanceId: number, choosedState: number, threadSequence: number, userId: string, completeTask: boolean, comments: string, cardData: java.util.HashMap<string, string>, managerMode: boolean): java.util.HashMap<string, string>;
34
+ saveAndSendTaskClassic(username: string, password: string, companyId: number, processInstanceId: number, choosedState: number, threadSequence: number, userId: string, completeTask: boolean, comments: string, cardData: java.util.HashMap<string, string>): java.util.HashMap<string, string>;
35
+ saveAndSendTaskByReplacement(username: string, password: string, companyId: number, processInstanceId: number, choosedState: number, threadSequence: number, userId: string, completeTask: boolean, comments: string, cardData: java.util.HashMap<string, string>, replacementUserId: string): java.util.HashMap<string, string>;
36
+
37
+ // Métodos de tarefa
38
+ takeProcessTask(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number, userId: string): string;
39
+ takeProcessTaskByReplacement(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number, userId: string, replacementUserId: string): string;
40
+
41
+ // Métodos de cancelamento
42
+ cancelInstance(username: string, password: string, companyId: number, processInstanceId: number, userId: string, cancelText: string): string;
43
+ cancelInstanceByReplacement(username: string, password: string, companyId: number, processInstanceId: number, userId: string, cancelText: string, replacementUserId: string): string;
44
+
45
+ // Métodos de consulta
46
+ getAvailableProcess(username: string, password: string, companyId: number): ProcessDefinitionVersionDtoArray;
47
+ getAvailableProcessOnDemand(username: string, password: string, companyId: number, limit: number, initialProcess: number, processSearch: string): ProcessDefinitionVersionDtoArray;
48
+ getAllProcessAvailableToExport(username: string, password: string, companyId: number): ProcessDefinitionVersionDtoArray;
49
+ getAllProcessAvailableToImport(username: string, password: string, companyId: number): ProcessDefinitionVersionDtoArray;
50
+ searchProcess(username: string, password: string, companyId: number, processSearch: string): ProcessDefinitionVersionDtoArray;
51
+
52
+ // Métodos de estados
53
+ getAvailableStates(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number): java.util.ArrayList<StateDto>;
54
+ getAvailableStatesDetail(username: string, password: string, companyId: number, processInstanceId: number, userId: string, threadSequence?: number): AvailableStatesDetailDto;
55
+ getAllActiveStates(username: string, password: string, companyId: number, processInstanceId: number): java.util.ArrayList<StateDto>;
56
+
57
+ // Métodos de usuários
58
+ getAvailableUsers(username: string, password: string, companyId: number, processInstanceId: number, state: number, threadSequence: number): AvailableUsersDto;
59
+ getAvailableUsersOnDemand(username: string, password: string, companyId: number, processInstanceId: number, state: number, threadSequence: number, limit: number, initialUser: number, userSearch: string): AvailableUsersDto;
60
+ getAvailableUsersStart(username: string, password: string, companyId: number, processId: string, state: number, threadSequence: number): AvailableUsersDto;
61
+ getAvailableUsersStartOnDemand(username: string, password: string, companyId: number, processId: string, state: number, threadSequence: number, limit: number, initialUser: number, userSearch: string): AvailableUsersDto;
62
+
63
+ // Métodos de dados do cartão
64
+ getInstanceCardData(username: string, password: string, companyId: number, processInstanceId: number): java.util.HashMap<string, string>;
65
+ getCardValue(username: string, password: string, companyId: number, processInstanceId: number, cardFieldId: string): string;
66
+
67
+ // Métodos de vencimento
68
+ setDueDate(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number, userId: string, dueDate: java.sql.Date, timeInSeconds: number): string;
69
+ calculateDeadLineHours(deadlineDate: java.sql.Date, seconds: number, deadlineInHours: number, periodId: string): unknown;
70
+ calculateDeadLineTime(deadlineDate: java.sql.Date, seconds: number, deadlineInHours: number, periodId: string): unknown;
71
+
72
+ // Métodos diversos
73
+ getActualThread(username: string, password: string, companyId: number, processInstanceId: number, state: number): number;
74
+ getProcessFormId(username: string, password: string, companyId: number, processId: string): string;
75
+ getProcessImage(username: string, password: string, companyId: number, processId: string, version: number): string;
76
+ getAttachments(username: string, password: string, companyId: number, processInstanceId: number): java.util.ArrayList<AttachmentDto>;
77
+ getHistories(username: string, password: string, companyId: number, processInstanceId: number): java.util.ArrayList<HistoryDto>;
78
+
79
+ // Métodos de comentários
80
+ setTasksComments(username: string, password: string, companyId: number, processInstanceId: number, userId: string, threadSequence: number, comments: string): string;
81
+
82
+ // Métodos de decisão automática
83
+ setAutomaticDecisionClassic(username: string, password: string, companyId: number, processInstanceId: number, state: number, threadSequence: number, userId: string, targetUserId: string, comments: string): string;
84
+
85
+ // Métodos de versão de processo
86
+ createWorkFlowProcessVersion(username: string, password: string, companyId: number, processId: string): string;
87
+ getWorkFlowProcessVersion(username: string, password: string, companyId: number, processId: string): number;
88
+
89
+ // Métodos de importação avançada
90
+ importProcessWithCard(username: string, password: string, companyId: number, processId: string, processFile: string): string;
91
+ importProcessWithCardAndRelatedDatasets(username: string, password: string, companyId: number, processId: string, processFile: string): string;
92
+ importProcessWithCardAndPersistenceType(username: string, password: string, companyId: number, processId: string, processFile: string, persistenceType: string): string;
93
+ importProcessWithCardAndGeneralInfo(username: string, password: string, companyId: number, processId: string, processFile: string, generalInfo: string): string;
94
+
95
+ // Métodos de anexo
96
+ updateWorkflowAttachment(username: string, password: string, companyId: number, processInstanceId: number, attachmentData: AttachmentDto): string;
97
+
98
+ // Métodos de liberação
99
+ releaseProcess(username: string, password: string, companyId: number, processId: string): string;
100
+ }
101
+
102
+ // Interface do port/endpoint do webservice
103
+ interface WorkflowEngineService {
104
+ // Métodos de gerenciamento de processo
105
+ importProcess(username: string, password: string, companyId: number, processId: string, processFile: string): string;
106
+ exportProcess(username: string, password: string, companyId: number, processId: string, version: number): string;
107
+ exportProcessInZipFormat(username: string, password: string, companyId: number, processId: string, version: number): string;
108
+
109
+ // Métodos de inicialização de processo
110
+ startProcess(username: string, password: string, companyId: number, processId: string, nextState: number, choosedUsers: java.util.ArrayList<string>, comments: string, completeTask: boolean, cardData: java.util.HashMap<string, string>, managerMode: boolean): java.util.HashMap<string, string>;
111
+ startProcessClassic(username: string, password: string, companyId: number, processId: string, nextState: number, choosedUsers: java.util.ArrayList<string>, comments: string, completeTask: boolean, cardData: java.util.HashMap<string, string>): java.util.HashMap<string, string>;
112
+ simpleStartProcess(username: string, password: string, companyId: number, processId: string, nextState: number, userId: string, comments: string): java.util.HashMap<string, string>;
113
+
114
+ // Métodos de gerenciamento de tarefas
115
+ saveAndSendTask(username: string, password: string, companyId: number, processInstanceId: number, choosedState: number, threadSequence: number, userId: string, completeTask: boolean, comments: string, cardData: java.util.HashMap<string, string>, managerMode: boolean): java.util.HashMap<string, string>;
116
+ saveAndSendTaskClassic(username: string, password: string, companyId: number, processInstanceId: number, choosedState: number, threadSequence: number, userId: string, completeTask: boolean, comments: string, cardData: java.util.HashMap<string, string>): java.util.HashMap<string, string>;
117
+ saveAndSendTaskByReplacement(username: string, password: string, companyId: number, processInstanceId: number, choosedState: number, threadSequence: number, userId: string, completeTask: boolean, comments: string, cardData: java.util.HashMap<string, string>, replacementUserId: string): java.util.HashMap<string, string>;
118
+
119
+ // Métodos de tarefa
120
+ takeProcessTask(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number, userId: string): string;
121
+ takeProcessTaskByReplacement(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number, userId: string, replacementUserId: string): string;
122
+
123
+ // Métodos de cancelamento
124
+ cancelInstance(username: string, password: string, companyId: number, processInstanceId: number, userId: string, cancelText: string): string;
125
+ cancelInstanceByReplacement(username: string, password: string, companyId: number, processInstanceId: number, userId: string, cancelText: string, replacementUserId: string): string;
126
+
127
+ // Métodos de consulta
128
+ getAvailableProcess(username: string, password: string, companyId: number): ProcessDefinitionVersionDtoArray;
129
+ getAvailableProcessOnDemand(username: string, password: string, companyId: number, limit: number, initialProcess: number, processSearch: string): ProcessDefinitionVersionDtoArray;
130
+ getAllProcessAvailableToExport(username: string, password: string, companyId: number): ProcessDefinitionVersionDtoArray;
131
+ getAllProcessAvailableToImport(username: string, password: string, companyId: number): ProcessDefinitionVersionDtoArray;
132
+ searchProcess(username: string, password: string, companyId: number, processSearch: string): ProcessDefinitionVersionDtoArray;
133
+
134
+ // Métodos de estados
135
+ getAvailableStates(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number): java.util.ArrayList<StateDto>;
136
+ getAvailableStatesDetail(username: string, password: string, companyId: number, processInstanceId: number, userId: string, threadSequence?: number): AvailableStatesDetailDto;
137
+ getAllActiveStates(username: string, password: string, companyId: number, processInstanceId: number): java.util.ArrayList<StateDto>;
138
+
139
+ // Métodos de usuários
140
+ getAvailableUsers(username: string, password: string, companyId: number, processInstanceId: number, state: number, threadSequence: number): AvailableUsersDto;
141
+ getAvailableUsersOnDemand(username: string, password: string, companyId: number, processInstanceId: number, state: number, threadSequence: number, limit: number, initialUser: number, userSearch: string): AvailableUsersDto;
142
+ getAvailableUsersStart(username: string, password: string, companyId: number, processId: string, state: number, threadSequence: number): AvailableUsersDto;
143
+ getAvailableUsersStartOnDemand(username: string, password: string, companyId: number, processId: string, state: number, threadSequence: number, limit: number, initialUser: number, userSearch: string): AvailableUsersDto;
144
+
145
+ // Métodos de dados do cartão
146
+ getInstanceCardData(username: string, password: string, companyId: number, processInstanceId: number): java.util.HashMap<string, string>;
147
+ getCardValue(username: string, password: string, companyId: number, processInstanceId: number, cardFieldId: string): string;
148
+
149
+ // Métodos de vencimento
150
+ setDueDate(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number, userId: string, dueDate: java.sql.Date, timeInSeconds: number): string;
151
+ calculateDeadLineHours(deadlineDate: java.sql.Date, seconds: number, deadlineInHours: number, periodId: string): unknown;
152
+ calculateDeadLineTime(deadlineDate: java.sql.Date, seconds: number, deadlineInHours: number, periodId: string): unknown;
153
+
154
+ // Métodos diversos
155
+ getActualThread(username: string, password: string, companyId: number, processInstanceId: number, state: number): number;
156
+ getProcessFormId(username: string, password: string, companyId: number, processId: string): string;
157
+ getProcessImage(username: string, password: string, companyId: number, processId: string, version: number): string;
158
+ getAttachments(username: string, password: string, companyId: number, processInstanceId: number): java.util.ArrayList<AttachmentDto>;
159
+ getHistories(username: string, password: string, companyId: number, processInstanceId: number): java.util.ArrayList<HistoryDto>;
160
+
161
+ // Métodos de comentários
162
+ setTasksComments(username: string, password: string, companyId: number, processInstanceId: number, userId: string, threadSequence: number, comments: string): string;
163
+
164
+ // Métodos de decisão automática
165
+ setAutomaticDecisionClassic(username: string, password: string, companyId: number, processInstanceId: number, state: number, threadSequence: number, userId: string, targetUserId: string, comments: string): string;
166
+
167
+ // Métodos de versão de processo
168
+ createWorkFlowProcessVersion(username: string, password: string, companyId: number, processId: string): string;
169
+ getWorkFlowProcessVersion(username: string, password: string, companyId: number, processId: string): number;
170
+
171
+ // Métodos de importação avançada
172
+ importProcessWithCard(username: string, password: string, companyId: number, processId: string, processFile: string): string;
173
+ importProcessWithCardAndRelatedDatasets(username: string, password: string, companyId: number, processId: string, processFile: string): string;
174
+ importProcessWithCardAndPersistenceType(username: string, password: string, companyId: number, processId: string, processFile: string, persistenceType: string): string;
175
+ importProcessWithCardAndGeneralInfo(username: string, password: string, companyId: number, processId: string, processFile: string, generalInfo: string): string;
176
+
177
+ // Métodos de anexo
178
+ updateWorkflowAttachment(username: string, password: string, companyId: number, processInstanceId: number, attachmentData: AttachmentDto): string;
179
+
180
+ // Métodos de liberação
181
+ releaseProcess(username: string, password: string, companyId: number, processId: string): string;
182
+ }
183
+
184
+ // DTOs e tipos auxiliares
185
+ interface ProcessDefinitionVersionDtoArray {
186
+ item: ProcessDefinitionVersionDto[];
187
+ }
188
+
189
+ interface ProcessDefinitionVersionDto {
190
+ processId: string;
191
+ version: number;
192
+ description: string;
193
+ active: boolean;
194
+ }
195
+
196
+ interface StateDto {
197
+ sequence: number;
198
+ state: number;
199
+ description: string;
200
+ stateType: string;
201
+ }
202
+
203
+ interface AvailableStatesDetailDto {
204
+ item: StateDetailDto[];
205
+ }
206
+
207
+ interface StateDetailDto {
208
+ sequence: number;
209
+ state: number;
210
+ description: string;
211
+ stateType: string;
212
+ canReceiveTask: boolean;
213
+ canTakeTask: boolean;
214
+ }
215
+
216
+ interface AvailableUsersDto {
217
+ item: UserDto[];
218
+ }
219
+
220
+ interface UserDto {
221
+ userId: string;
222
+ userName: string;
223
+ email: string;
224
+ active: boolean;
225
+ }
226
+
227
+ interface AttachmentDto {
228
+ documentId: number;
229
+ version: number;
230
+ fileName: string;
231
+ description: string;
232
+ uploadDate: java.sql.Date;
233
+ userId: string;
234
+ }
235
+
236
+ interface HistoryDto {
237
+ processInstanceId: number;
238
+ state: number;
239
+ sequence: number;
240
+ userId: string;
241
+ dateTime: java.sql.Date;
242
+ comments: string;
243
+ action: string;
244
+ stateDescription: string;
245
+ }
246
+ }
247
+ }
248
+ }
249
+ }
250
+ }
251
+ }
252
+
253
+ // #########################################################################
254
+ // ##################### WebService ServiceManager Types ###################
255
+ // #########################################################################
256
+
257
+ // A classe ECMWorkflowEngineServiceService já está mapeada no ClassNameMap do fluig.backend.d.ts
258
+ // Este arquivo apenas define os tipos específicos para webservices
259
+ }
260
+
261
+ /*
262
+ // ############################################################################
263
+ // #################### Exemplos de uso do ECMWorkflowEngineService ##########
264
+ // ############################################################################
265
+
266
+ // Exemplo de uso básico do ECMWorkflowEngineService
267
+ function exemploWorkflowService() {
268
+ // Instanciando o serviço com tipagem completa
269
+ const service = ServiceManager.getService("ECMWorkflowEngineServiceService");
270
+ const workflowServiceClass = service.getBean().instantiate('com.totvs.technology.ecm.workflow.ws.ECMWorkflowEngineServiceService');
271
+
272
+ // Obtendo o port/endpoint do webservice
273
+ const workflowService = workflowServiceClass.getWorkflowEngineServicePort();
274
+
275
+ // Exemplo 1: Iniciar um processo
276
+ const cardData = new java.util.HashMap<string, string>();
277
+ cardData.put("campo1", "valor1");
278
+ cardData.put("campo2", "valor2");
279
+
280
+ const choosedUsers = new java.util.ArrayList<string>();
281
+ choosedUsers.add("usuario123");
282
+
283
+ const result = workflowService.startProcess(
284
+ "admin", // username
285
+ "senha", // password
286
+ 1, // companyId
287
+ "ProcessoTeste", // processId
288
+ 2, // nextState
289
+ choosedUsers, // choosedUsers
290
+ "Iniciando processo via webservice", // comments
291
+ true, // completeTask
292
+ cardData, // cardData
293
+ false // managerMode
294
+ );
295
+
296
+ // Exemplo 2: Obter processos disponíveis
297
+ const availableProcesses = workflowService.getAvailableProcess("admin", "senha", 1);
298
+ for (const process of availableProcesses.item) {
299
+ log.info(`Processo: ${process.processId} - Versão: ${process.version}`);
300
+ }
301
+
302
+ // Exemplo 3: Obter dados do cartão de uma instância
303
+ const instanceCardData = workflowService.getInstanceCardData("admin", "senha", 1, 12345);
304
+
305
+ // Exemplo 4: Avançar uma tarefa
306
+ const nextCardData = new java.util.HashMap<string, string>();
307
+ nextCardData.put("aprovacao", "APROVADO");
308
+ nextCardData.put("observacoes", "Processo aprovado com sucesso");
309
+
310
+ const taskResult = workflowService.saveAndSendTask(
311
+ "admin", // username
312
+ "senha", // password
313
+ 1, // companyId
314
+ 12345, // processInstanceId
315
+ 3, // choosedState
316
+ 1, // threadSequence
317
+ "usuario123", // userId
318
+ true, // completeTask
319
+ "Aprovando processo", // comments
320
+ nextCardData, // cardData
321
+ false // managerMode
322
+ );
323
+
324
+ // Exemplo 5: Obter usuários disponíveis para uma atividade
325
+ const availableUsers = workflowService.getAvailableUsers("admin", "senha", 1, 12345, 3, 1);
326
+ for (const user of availableUsers.item) {
327
+ log.info(`Usuário disponível: ${user.userId} - ${user.userName}`);
328
+ }
329
+
330
+ // Exemplo 6: Cancelar uma instância
331
+ const cancelResult = workflowService.cancelInstance(
332
+ "admin", // username
333
+ "senha", // password
334
+ 1, // companyId
335
+ 12345, // processInstanceId
336
+ "admin", // userId
337
+ "Cancelamento solicitado pelo administrador" // cancelText
338
+ );
339
+
340
+ return result;
341
+ }
342
+ */
343
+
344
+ export {};
package/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
- export * from './fluig.sdk.d';
2
- export * from './java.d';
3
- export * from './types.d';
1
+ export * from "./fluig.sdk.d";
2
+ export * from "./java.d";
3
+ export * from "./fluig.frontend.d";
4
+ export * from "./fluig.backend.d";
5
+ export * from "./fluig.webservice.d";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsegd-fluig-types",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Pacote de tipos para fluig",
5
5
  "license": "CC-BY-NC-ND-4.0",
6
6
  "author": "Elemar Deckmann",
@@ -9,7 +9,9 @@
9
9
  "files": [
10
10
  "index.d.ts",
11
11
  "fluig.sdk.d.ts",
12
- "java.d.ts",
13
- "types.d.ts"
12
+ "fluig.frontend.d.ts",
13
+ "fluig.backend.d.ts",
14
+ "fluig.webservice.d.ts",
15
+ "java.d.ts"
14
16
  ]
15
17
  }