mitra-sdk 1.0.4 → 1.0.6
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 +19 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -151,8 +151,8 @@ const structure = await getScreenStructureMitra({ projectId: 123, screenId: 1 })
|
|
|
151
151
|
|
|
152
152
|
### Componentes
|
|
153
153
|
|
|
154
|
-
- `addComponentMitra({ projectId, screenId, type,
|
|
155
|
-
- `updateComponentMitra({ projectId, componentId,
|
|
154
|
+
- `addComponentMitra({ projectId, screenId, type, variables?, sizes? })` - Adiciona componente
|
|
155
|
+
- `updateComponentMitra({ projectId, componentId, variables?, sizes? })` - Atualiza componente
|
|
156
156
|
- `deleteComponentMitra({ projectId, componentId })` - Deleta componente
|
|
157
157
|
|
|
158
158
|
```typescript
|
|
@@ -162,7 +162,7 @@ const result = await addComponentMitra({
|
|
|
162
162
|
projectId: 123,
|
|
163
163
|
screenId: 1,
|
|
164
164
|
type: 'CARD_GROUP',
|
|
165
|
-
|
|
165
|
+
variables: {
|
|
166
166
|
query: "SELECT 1 AS ID, 'Vendas' AS DESC, COUNT(*) AS VALOR FROM VENDAS",
|
|
167
167
|
jdbcId: 1,
|
|
168
168
|
idColumn: 'ID',
|
|
@@ -189,12 +189,25 @@ const preview = await getFilePreviewMitra({ projectId: 123, fileName: 'dados.csv
|
|
|
189
189
|
|
|
190
190
|
- `listFormsMitra({ projectId })` - Lista formulários
|
|
191
191
|
- `getFormDetailsMitra({ projectId, formId })` - Detalhes de um formulário (campos, botões)
|
|
192
|
+
- `createFormMitra({ projectId, name, table, fields?, buttons?, ... })` - Cria formulário
|
|
193
|
+
- `updateFormMitra({ projectId, formId, fields?, buttons?, ... })` - Atualiza formulário
|
|
194
|
+
- `deleteFormMitra({ projectId, formId })` - Deleta formulário
|
|
192
195
|
|
|
193
196
|
```typescript
|
|
194
|
-
import {
|
|
197
|
+
import { createFormMitra } from 'mitra-sdk';
|
|
195
198
|
|
|
196
|
-
const
|
|
197
|
-
|
|
199
|
+
const result = await createFormMitra({
|
|
200
|
+
projectId: 123,
|
|
201
|
+
name: 'Cadastro de Usuário',
|
|
202
|
+
table: 'USUARIOS',
|
|
203
|
+
fields: [
|
|
204
|
+
{ name: 'NOME', alias: 'Nome', visibility: 'MANDATORY' },
|
|
205
|
+
{ name: 'EMAIL', alias: 'E-mail', visibility: 'EDIT' }
|
|
206
|
+
],
|
|
207
|
+
buttons: [
|
|
208
|
+
{ title: 'Salvar', executionType: 'DBACTION', dbActionsIds: [1] }
|
|
209
|
+
]
|
|
210
|
+
});
|
|
198
211
|
```
|
|
199
212
|
|
|
200
213
|
### Tabelas
|