@pacp/spec 1.0.0 → 1.0.1

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 CHANGED
@@ -1,17 +1,17 @@
1
- # pacp
1
+ # @pacp/spec
2
2
 
3
3
  Schema, profiles e validador do [PACP](https://pacp-org.github.io/pacp/) (Padrão Aberto de Catálogo e Precificação) como pacote npm.
4
4
 
5
5
  ## Instalação
6
6
 
7
7
  ```bash
8
- npm install pacp
8
+ npm install @pacp/spec
9
9
  ```
10
10
 
11
11
  Para usar a função `validate()`, instale também as peer dependencies:
12
12
 
13
13
  ```bash
14
- npm install pacp ajv ajv-formats
14
+ npm install @pacp/spec ajv ajv-formats
15
15
  ```
16
16
 
17
17
  ## Uso
@@ -19,7 +19,7 @@ npm install pacp ajv ajv-formats
19
19
  ### Schema e profiles (sem dependências extras)
20
20
 
21
21
  ```typescript
22
- import { schema, profiles, profileIds, SPEC_VERSION } from 'pacp';
22
+ import { schema, profiles, profileIds, SPEC_VERSION } from '@pacp/spec';
23
23
 
24
24
  // JSON Schema completo do PACP v1.0.0
25
25
  console.log(schema.$id); // "https://pacp.dev/spec/1.0.0/pacp.schema.json"
@@ -37,7 +37,7 @@ console.log(profiles.moveis.title); // "PACP Profile: Moveis e Alta Decoracao"
37
37
  ### Validação de documentos
38
38
 
39
39
  ```typescript
40
- import { validate } from 'pacp';
40
+ import { validate } from '@pacp/spec';
41
41
 
42
42
  const catalogDocument = {
43
43
  spec: '1.0.0',
@@ -84,7 +84,7 @@ import type {
84
84
  Measure,
85
85
  DimensionsObj,
86
86
  ValidationResult,
87
- } from 'pacp';
87
+ } from '@pacp/spec';
88
88
 
89
89
  const product: Product = {
90
90
  id: 'prod_mesa',
@@ -109,13 +109,13 @@ Se preferir usar os JSONs diretamente (sem TypeScript):
109
109
 
110
110
  ```javascript
111
111
  // Schema principal
112
- const schema = require('pacp/schema.json');
112
+ const schema = require('@pacp/spec/schema.json');
113
113
 
114
114
  // Profiles
115
- const moveis = require('pacp/profiles/moveis.json');
116
- const iluminacao = require('pacp/profiles/iluminacao.json');
117
- const pisos = require('pacp/profiles/pisos-revestimentos.json');
118
- const fiscal = require('pacp/profiles/fiscal-br.json');
115
+ const moveis = require('@pacp/spec/profiles/moveis.json');
116
+ const iluminacao = require('@pacp/spec/profiles/iluminacao.json');
117
+ const pisos = require('@pacp/spec/profiles/pisos-revestimentos.json');
118
+ const fiscal = require('@pacp/spec/profiles/fiscal-br.json');
119
119
  ```
120
120
 
121
121
  ## O que está incluído
package/dist/index.d.cts CHANGED
@@ -55,6 +55,7 @@ interface Product {
55
55
  category?: string;
56
56
  gtin?: string;
57
57
  base_price?: number;
58
+ unit?: string;
58
59
  images?: ImageRef[];
59
60
  tags?: string[];
60
61
  weight?: Measure;
package/dist/index.d.ts CHANGED
@@ -55,6 +55,7 @@ interface Product {
55
55
  category?: string;
56
56
  gtin?: string;
57
57
  base_price?: number;
58
+ unit?: string;
58
59
  images?: ImageRef[];
59
60
  tags?: string[];
60
61
  weight?: Measure;
@@ -230,6 +230,7 @@
230
230
  "category": { "type": "string", "minLength": 1 },
231
231
  "gtin": { "type": "string", "pattern": "^\\d{8,14}$" },
232
232
  "base_price": { "type": "number" },
233
+ "unit": { "type": "string", "minLength": 1 },
233
234
  "images": {
234
235
  "type": "array",
235
236
  "items": { "$ref": "#/$defs/imageRef" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pacp/spec",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "PACP - Padrão Aberto de Catálogo e Precificação. Schema, profiles e validador para catálogos de produtos.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",