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.
Files changed (2) hide show
  1. package/README.md +19 -6
  2. 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, props?, sizes? })` - Adiciona componente
155
- - `updateComponentMitra({ projectId, componentId, props?, sizes? })` - Atualiza componente
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
- props: {
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 { listFormsMitra, getFormDetailsMitra } from 'mitra-sdk';
197
+ import { createFormMitra } from 'mitra-sdk';
195
198
 
196
- const forms = await listFormsMitra({ projectId: 123 });
197
- const details = await getFormDetailsMitra({ projectId: 123, formId: 1 });
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mitra-sdk",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "SDK completo para a plataforma Mitra ECP",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",