@emulates/brevo 0.0.0-stage → 1.0.0

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/dist/server.js ADDED
@@ -0,0 +1,12 @@
1
+ import {
2
+ DEFAULT_PORT,
3
+ createServer,
4
+ serveTarget
5
+ } from "./chunk-BTYZOTOG.js";
6
+ import "./chunk-HG4G5UFW.js";
7
+ export {
8
+ DEFAULT_PORT,
9
+ createServer,
10
+ serveTarget
11
+ };
12
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
package/openapi.yaml ADDED
@@ -0,0 +1,119 @@
1
+ openapi: 3.1.0
2
+ info:
3
+ title: Brevo contacts subset
4
+ version: v3
5
+ x-emulates-upstream:
6
+ url: https://developers.brevo.com/reference/create-contact
7
+ servers:
8
+ - url: https://api.brevo.com
9
+ security:
10
+ - apiKey: []
11
+ paths:
12
+ /v3/contacts:
13
+ post:
14
+ operationId: CreateContact
15
+ requestBody:
16
+ required: true
17
+ content:
18
+ application/json:
19
+ example: { email: synthetic@example.invalid, ext_id: mock-contact, listIds: [1], updateEnabled: false }
20
+ schema:
21
+ allOf:
22
+ - { $ref: '#/components/schemas/contact_write' }
23
+ - type: object
24
+ properties:
25
+ email: { type: string, maxLength: 254 }
26
+ updateEnabled: { type: boolean }
27
+ responses:
28
+ '201':
29
+ description: Contact created
30
+ content:
31
+ application/json:
32
+ schema:
33
+ type: object
34
+ required: [id]
35
+ properties:
36
+ id: { type: integer }
37
+ '204': { description: Existing contact updated }
38
+ '400': { $ref: '#/components/responses/Error' }
39
+ '401': { $ref: '#/components/responses/Error' }
40
+ x-emulates: { supported: true, parity: { enabled: true, safe: false } }
41
+ /v3/contacts/{identifier}:
42
+ parameters:
43
+ - name: identifier
44
+ in: path
45
+ required: true
46
+ schema: { type: string, minLength: 1, maxLength: 254 }
47
+ - name: identifierType
48
+ in: query
49
+ schema: { type: string, enum: [email_id, contact_id, ext_id] }
50
+ get:
51
+ operationId: GetContact
52
+ responses:
53
+ '200':
54
+ description: Contact details
55
+ content:
56
+ application/json:
57
+ schema: { $ref: '#/components/schemas/contact' }
58
+ '400': { $ref: '#/components/responses/Error' }
59
+ '401': { $ref: '#/components/responses/Error' }
60
+ '404': { $ref: '#/components/responses/Error' }
61
+ x-emulates: { supported: true, parity: { enabled: true, safe: true } }
62
+ put:
63
+ operationId: UpdateContact
64
+ requestBody:
65
+ required: true
66
+ content:
67
+ application/json:
68
+ schema: { $ref: '#/components/schemas/contact_write' }
69
+ responses:
70
+ '204': { description: Contact updated }
71
+ '400': { $ref: '#/components/responses/Error' }
72
+ '401': { $ref: '#/components/responses/Error' }
73
+ '404': { $ref: '#/components/responses/Error' }
74
+ x-emulates: { supported: true, parity: { enabled: true, safe: false } }
75
+ delete:
76
+ operationId: DeleteContact
77
+ responses:
78
+ '204': { description: Contact deleted }
79
+ '400': { $ref: '#/components/responses/Error' }
80
+ '401': { $ref: '#/components/responses/Error' }
81
+ '404': { $ref: '#/components/responses/Error' }
82
+ x-emulates: { supported: true, parity: { enabled: true, safe: false } }
83
+ components:
84
+ securitySchemes:
85
+ apiKey: { type: apiKey, in: header, name: api-key }
86
+ responses:
87
+ Error:
88
+ description: Brevo error envelope
89
+ content:
90
+ application/json:
91
+ schema:
92
+ type: object
93
+ required: [code, message]
94
+ properties:
95
+ code: { type: string }
96
+ message: { type: string }
97
+ schemas:
98
+ contact_write:
99
+ type: object
100
+ properties:
101
+ ext_id: { type: string, maxLength: 200 }
102
+ attributes: { type: object, additionalProperties: true }
103
+ listIds: { type: array, maxItems: 20, items: { type: integer, minimum: 1 } }
104
+ unlinkListIds: { type: array, maxItems: 20, items: { type: integer, minimum: 1 } }
105
+ emailBlacklisted: { type: boolean }
106
+ smsBlacklisted: { type: boolean }
107
+ contact:
108
+ type: object
109
+ required: [id, attributes, listIds, createdAt, modifiedAt, emailBlacklisted, smsBlacklisted]
110
+ properties:
111
+ id: { type: integer }
112
+ email: { type: string }
113
+ ext_id: { type: string }
114
+ attributes: { type: object, additionalProperties: true }
115
+ listIds: { type: array, items: { type: integer } }
116
+ createdAt: { type: string, format: date-time }
117
+ modifiedAt: { type: string, format: date-time }
118
+ emailBlacklisted: { type: boolean }
119
+ smsBlacklisted: { type: boolean }
package/package.json CHANGED
@@ -1,6 +1,124 @@
1
1
  {
2
2
  "name": "@emulates/brevo",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "Stateful Brevo contact creation, external-id updates and email deletion emulator.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "files": [
9
+ "dist",
10
+ "README.md",
11
+ "CHANGELOG.md",
12
+ "DISCOVERY.md",
13
+ "SUPPORT.md",
14
+ "openapi.yaml"
15
+ ],
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "default": "./dist/index.js"
22
+ },
23
+ "./server": {
24
+ "types": "./dist/server.d.ts",
25
+ "default": "./dist/server.js"
26
+ }
27
+ },
28
+ "bin": {
29
+ "emulates-brevo": "./dist/cli.js"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public",
33
+ "provenance": true
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/crvouga/emulates.git",
38
+ "directory": "packages/service/brevo"
39
+ },
40
+ "homepage": "https://github.com/crvouga/emulates/tree/main/packages/service/brevo#readme",
41
+ "keywords": [
42
+ "emulates",
43
+ "service",
44
+ "brevo",
45
+ "contacts"
46
+ ],
47
+ "emulates": {
48
+ "runtime": "portable",
49
+ "entries": {
50
+ "server": "node",
51
+ "cli": "node"
52
+ },
53
+ "layer": "service",
54
+ "category": "marketing",
55
+ "displayName": "Brevo",
56
+ "vendor": {
57
+ "website": "https://www.brevo.com",
58
+ "docs": "https://developers.brevo.com/reference/create-contact",
59
+ "description": "Brevo contact management and customer identifiers."
60
+ },
61
+ "parity": "Contact identity and CRUD",
62
+ "parityTier": "cold",
63
+ "playground": {
64
+ "headers": {
65
+ "api-key": "mock_brevo_key"
66
+ },
67
+ "operation": "CreateContact"
68
+ },
69
+ "status": "wip",
70
+ "discovery": {
71
+ "guide": "DISCOVERY.md",
72
+ "behavior": "README.md",
73
+ "capabilities": "SUPPORT.md",
74
+ "contract": "openapi.yaml",
75
+ "types": "dist/index.d.ts",
76
+ "oracle": {
77
+ "kind": "Live vendor API or sandbox",
78
+ "command": "bun run parity:service -- brevo",
79
+ "note": "Run from an Emulates checkout; credentials come only from .env.local or GitHub Actions secrets. Missing credentials exit 2."
80
+ },
81
+ "introspection": [
82
+ "GET /__admin/health",
83
+ "GET /__admin",
84
+ "GET /__admin/state",
85
+ "GET /__admin/requests",
86
+ "GET /__admin/metrics",
87
+ "GET /__admin/faults/presets",
88
+ "GET /__admin/ui"
89
+ ],
90
+ "reporting": "https://github.com/crvouga/emulates/blob/main/docs/REPORTING_ISSUES.md"
91
+ }
92
+ },
93
+ "scripts": {
94
+ "generate": "bun ../../openapi/codegen/dist/cli.js",
95
+ "generate:check": "bun ../../openapi/codegen/dist/cli.js --check",
96
+ "openapi:check": "bun ../../openapi/codegen/dist/cli.js --validate",
97
+ "build": "bun ../../../scripts/bundle-service.ts",
98
+ "typecheck": "tsc -p tsconfig.json --noEmit",
99
+ "lint": "biome check .",
100
+ "test": "bun test",
101
+ "parity": "bun scripts/parity.ts",
102
+ "portability": "bun ../../../scripts/portability.ts",
103
+ "pack:check": "bun ../../../scripts/pack-check.ts"
104
+ },
105
+ "dependencies": {
106
+ "@emulates/sqlite": "3.0.0",
107
+ "hono": "4.11.9"
108
+ },
109
+ "devDependencies": {
110
+ "fast-check": "4.9.0",
111
+ "@emulates/testing": "0.1.0",
112
+ "@emulates/sqlite": "0.0.0-development",
113
+ "@emulates/parity": "0.0.0-development",
114
+ "@emulates/credentials": "0.0.0-development",
115
+ "@emulates/openapi-codegen": "0.1.0",
116
+ "@emulates/openapi-metadata": "0.0.0-development",
117
+ "@emulates/core": "0.0.0-development",
118
+ "@emulates/sqlite-client": "0.0.0-development",
119
+ "@emulates/openapi": "0.0.0-development",
120
+ "@emulates/service": "0.0.0-development",
121
+ "@emulates/http-codec": "0.0.0-development",
122
+ "@emulates/adapter-node": "0.0.0-development"
123
+ }
124
+ }