@greatapps/greatagents 0.1.22 → 0.1.24

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/CLAUDE.md CHANGED
@@ -1,4 +1,8 @@
1
- # gagents-schemas — Agente de Schemas
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## gagents-schemas — @greatapps/greatagents
2
6
 
3
7
  Pacote NPM `@greatapps/greatagents`: definições de schema compartilhadas por todos os serviços.
4
8
 
@@ -6,11 +10,11 @@ Pacote NPM `@greatapps/greatagents`: definições de schema compartilhadas por t
6
10
 
7
11
  ```bash
8
12
  # Após alterar schemas, atualizar version e publicar:
9
- npm version patch # ou minor/major
13
+ bun version patch # ou minor/major
10
14
  npm publish # Publica no registry
11
15
  ```
12
16
 
13
- **IMPORTANTE**: Após publicar, atualizar a versão em `gagents-r1-api-postgresql/package.json` e `gagents-r3-api/package.json`, rodar `npm install` em ambos, e fazer deploy.
17
+ **IMPORTANTE**: Após publicar, atualizar a versão em `gagents-r1-api-postgresql/package.json` e `gagents-r3-api/package.json`, rodar `bun install` em ambos, e fazer deploy.
14
18
 
15
19
  ## Estrutura
16
20
 
@@ -95,3 +99,7 @@ O array `params` define quais campos são obrigatórios em WHERE clauses:
95
99
  - **`contacts.identifier`**: Tem constraint UNIQUE global, não per-account
96
100
  - **Versionamento**: Sempre bumpar version antes de publicar — consumers usam versão fixa
97
101
  - **Impacto cross-service**: Mudanças em schemas afetam gagents-r1-api-postgresql (validação, queries) e gagents-r3-api (serviços, lógica)
102
+
103
+ ## API Response Shape (para consumidores)
104
+
105
+ Schemas definem a estrutura, mas consumers devem saber: `@greatapps/api` view operations retornam `{ data: [{...}] }` — **sempre array**. `insert()` retorna `{ status: 0 }` em falha de validação (não throw). **JSONB columns** (metadata, config, products): schema define `type: "string"` mas DB é JSONB — sempre `JSON.stringify()` antes de insert/update.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greatapps/greatagents",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "description": "Schemas para GreatAgents",
5
5
  "main": "./src/product.js",
6
6
  "type": "module"
@@ -45,6 +45,18 @@ export const properties = {
45
45
  disabled: true
46
46
  }
47
47
  },
48
+ active: {
49
+ type: "boolean",
50
+ default: true,
51
+ filterable: true,
52
+ interface: {
53
+ label: {
54
+ "pt-br": "Ativo",
55
+ "en": "Active"
56
+ },
57
+ component: "toggle"
58
+ }
59
+ },
48
60
  title: {
49
61
  type: "string",
50
62
  required: true,
@@ -67,7 +67,7 @@ export const properties = {
67
67
  },
68
68
  id_agent: {
69
69
  type: "number",
70
- required: true,
70
+ required: false,
71
71
  updatable: false,
72
72
  filterable: true,
73
73
  index: true,
@@ -85,6 +85,24 @@ export const properties = {
85
85
  disabled: true
86
86
  }
87
87
  },
88
+ external_reference: {
89
+ type: "string",
90
+ required: false,
91
+ updatable: false,
92
+ filterable: true,
93
+ index: true,
94
+ validation: {
95
+ maxLength: 255
96
+ },
97
+ interface: {
98
+ label: {
99
+ "pt-br": "Referência externa",
100
+ "en": "External reference"
101
+ },
102
+ component: "input",
103
+ disabled: true
104
+ }
105
+ },
88
106
  authorized_by_contact: {
89
107
  type: "number",
90
108
  required: false,