@greatapps/greatagents 0.1.23 → 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
 
@@ -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.23",
3
+ "version": "0.1.24",
4
4
  "description": "Schemas para GreatAgents",
5
5
  "main": "./src/product.js",
6
6
  "type": "module"
@@ -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,