jsegd-fluig-types 1.0.9 → 1.0.11
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 +138 -14
- package/fluig.backend.d.ts +428 -0
- package/{types.d.ts → fluig.frontend.d.ts} +1 -262
- package/index.d.ts +4 -3
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,29 +1,153 @@
|
|
|
1
1
|
# jsegd-fluig-types
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+

|
|
4
5
|
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
26
|
-
|
|
125
|
+
- TypeScript 3.0+
|
|
126
|
+
- Ambiente Fluig (para execução)
|
|
27
127
|
|
|
28
|
-
##
|
|
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,428 @@
|
|
|
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
|
+
// ########################## WebService Types ############################
|
|
418
|
+
// #########################################################################
|
|
419
|
+
class ServiceManager {
|
|
420
|
+
static getService(serviceName: string): Service;
|
|
421
|
+
}
|
|
422
|
+
class Service {
|
|
423
|
+
getBean(): {
|
|
424
|
+
instantiate(): object;
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
export {};
|
|
@@ -157,18 +157,7 @@ declare type ConfirmCallback = (
|
|
|
157
157
|
) => void;
|
|
158
158
|
declare type MessageCallback = (element: HTMLElement, event: Event) => void;
|
|
159
159
|
|
|
160
|
-
declare enum ConstraintType {
|
|
161
|
-
MUST = 1,
|
|
162
|
-
SHOULD = 2,
|
|
163
|
-
MUST_NOT = 3,
|
|
164
|
-
}
|
|
165
160
|
|
|
166
|
-
declare enum Status {
|
|
167
|
-
SUCCESS = "success",
|
|
168
|
-
ERROR = "error",
|
|
169
|
-
WARNING = "warning",
|
|
170
|
-
FAIL = "fail",
|
|
171
|
-
}
|
|
172
161
|
|
|
173
162
|
declare type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
174
163
|
|
|
@@ -261,172 +250,13 @@ declare global {
|
|
|
261
250
|
};
|
|
262
251
|
}
|
|
263
252
|
|
|
264
|
-
class Dataset {
|
|
265
|
-
rowsCount: number;
|
|
266
|
-
updateRow(valores: string[] | object[]): void;
|
|
267
|
-
addOrUpdateRow(valores: string[] | object[]): void;
|
|
268
|
-
deleteRow(valores: string[] | object[]): void;
|
|
269
|
-
addColumn(): void;
|
|
270
|
-
addRow(): void;
|
|
271
|
-
getColumnName(): java.lang.String;
|
|
272
|
-
getColumnsName(): java.lang.String[];
|
|
273
|
-
getColumnsCount(): number;
|
|
274
|
-
getMap(): java.util.ArrayList<
|
|
275
|
-
java.util.HashMap<java.lang.String, java.lang.Object>
|
|
276
|
-
>;
|
|
277
|
-
getRowsCount(): number;
|
|
278
|
-
getSubDataset(): Dataset;
|
|
279
|
-
getValue(row: number, col: number): string;
|
|
280
|
-
getValue(row: number, colName: string): string;
|
|
281
|
-
getValues(): java.lang.Object[][];
|
|
282
|
-
toResultSet(): java.sql.ResultSet;
|
|
283
|
-
addColumn(name: string): void;
|
|
284
|
-
addRow(row: unknown[]): void;
|
|
285
|
-
getValue(row: number, column: string): string;
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* Função principal para criação de datasets no Fluig
|
|
289
|
-
* Cada arquivo de dataset deve implementar esta função
|
|
290
|
-
*/
|
|
291
|
-
function createDataset(
|
|
292
|
-
fields: string[],
|
|
293
|
-
constraints: Constraint[],
|
|
294
|
-
sortFields: string[]
|
|
295
|
-
): Dataset;
|
|
296
|
-
|
|
297
253
|
// Funções globais do Fluig
|
|
298
254
|
function wdkAddChild(tablename: string): number;
|
|
299
255
|
function fnWdkRemoveChild(element: Element): void;
|
|
300
|
-
function getValue(element: string): string;
|
|
301
256
|
|
|
302
257
|
// Variável global definida pelo Fluig no navegador
|
|
303
258
|
const formMode: FormMod;
|
|
304
259
|
|
|
305
|
-
// Namespace hAPI
|
|
306
|
-
namespace hAPI {
|
|
307
|
-
function getCardValue(nomeCampo: string): string;
|
|
308
|
-
function setCardValue(nomeCampo: string, valor: string): string;
|
|
309
|
-
function addCardChild(
|
|
310
|
-
tableName: string,
|
|
311
|
-
cardData: java.util.HashMap<java.lang.String, java.lang.String>
|
|
312
|
-
): void;
|
|
313
|
-
function removeCardChild(tableName: string, index: number): void;
|
|
314
|
-
function setAutomaticDecision(
|
|
315
|
-
taskNumber: number,
|
|
316
|
-
responsible: java.util.ArrayList<string>,
|
|
317
|
-
comment: string
|
|
318
|
-
): void;
|
|
319
|
-
function getActiveStates(): java.util.ArrayList<object>;
|
|
320
|
-
function getParentInstance(processInstanceId: number): number;
|
|
321
|
-
function getChildrenInstances(
|
|
322
|
-
processInstanceId: number
|
|
323
|
-
): java.util.List<number>;
|
|
324
|
-
function setDueDate(
|
|
325
|
-
processId: number,
|
|
326
|
-
numThread: number,
|
|
327
|
-
userId: string,
|
|
328
|
-
dueDate: Date,
|
|
329
|
-
timeInSeconds: number
|
|
330
|
-
): void;
|
|
331
|
-
function transferTask(
|
|
332
|
-
users: java.util.ArrayList<string>,
|
|
333
|
-
comment: string,
|
|
334
|
-
numThread?: number
|
|
335
|
-
): void;
|
|
336
|
-
function setTaskComments(
|
|
337
|
-
userId: string,
|
|
338
|
-
processId: number,
|
|
339
|
-
threadId: number,
|
|
340
|
-
comment: string
|
|
341
|
-
): void;
|
|
342
|
-
function getAdvancedProperty(nomePropriedade: string): string;
|
|
343
|
-
function getCardData(
|
|
344
|
-
numProcesso: number
|
|
345
|
-
): java.util.HashMap<string, string>;
|
|
346
|
-
function startProcess(
|
|
347
|
-
processId: string,
|
|
348
|
-
taskNumber: number,
|
|
349
|
-
users: java.util.ArrayList<java.lang.String>,
|
|
350
|
-
comment?: string,
|
|
351
|
-
taskFinished?: boolean,
|
|
352
|
-
form?: java.util.HashMap<java.lang.String, java.lang.String>,
|
|
353
|
-
managerMode?: boolean
|
|
354
|
-
): java.util.HashMap<string, string>;
|
|
355
|
-
function calculateDeadLineHours(
|
|
356
|
-
deadlineDate: Date,
|
|
357
|
-
seconds: number,
|
|
358
|
-
deadlineInHours: number,
|
|
359
|
-
periodId: string
|
|
360
|
-
): unknown;
|
|
361
|
-
function calculateDeadLineTime(
|
|
362
|
-
deadlineDate: Date,
|
|
363
|
-
seconds: number,
|
|
364
|
-
deadlineInHours: number,
|
|
365
|
-
periodId: string
|
|
366
|
-
): unknown;
|
|
367
|
-
function setColleagueReplacement(responsible: string): void;
|
|
368
|
-
function getUserTaskLink(numAtividade: number): string;
|
|
369
|
-
function getActualThread(
|
|
370
|
-
companyNumber: number,
|
|
371
|
-
processNumber: number,
|
|
372
|
-
activityNumber: number
|
|
373
|
-
): number;
|
|
374
|
-
function createAdHocTasks(
|
|
375
|
-
processoId: number,
|
|
376
|
-
sequenciaId: number,
|
|
377
|
-
assunto: string,
|
|
378
|
-
detalhamento: string,
|
|
379
|
-
tarefas: unknown[]
|
|
380
|
-
): void;
|
|
381
|
-
function listAttachments(): java.util.List<unknown>;
|
|
382
|
-
function publishWorkflowAttachment(documentDto: unknown): void;
|
|
383
|
-
function attachDocument(documentId: number): void;
|
|
384
|
-
function getChildrenFromTable(
|
|
385
|
-
tableName: string
|
|
386
|
-
): java.util.HashMap<string, string>;
|
|
387
|
-
function getChildrenIndexes(tableName: string): number[];
|
|
388
|
-
function getAvailableStatesDetail(
|
|
389
|
-
companyId: number,
|
|
390
|
-
userId: string,
|
|
391
|
-
processId: number,
|
|
392
|
-
processInstanceId: number,
|
|
393
|
-
threadSequenceId?: number
|
|
394
|
-
): unknown;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
class log {
|
|
398
|
-
static dir(object: object): void;
|
|
399
|
-
static info(message: string): void;
|
|
400
|
-
static error(message: string): void;
|
|
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
|
-
|
|
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 {};
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./fluig.sdk.d";
|
|
2
|
+
export * from "./java.d";
|
|
3
|
+
export * from "./fluig.frontend.d";
|
|
4
|
+
export * from "./fluig.backend.d";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsegd-fluig-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
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,8 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"index.d.ts",
|
|
11
11
|
"fluig.sdk.d.ts",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
12
|
+
"fluig.frontend.d.ts",
|
|
13
|
+
"fluig.backend.d.ts",
|
|
14
|
+
"java.d.ts"
|
|
14
15
|
]
|
|
15
16
|
}
|