@dolard.eu/versiq-core-types 0.1.0 → 0.2.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/README.md +87 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# @dolard.eu/versiq-core-types
|
|
2
|
+
|
|
3
|
+
Cross-workspace TypeScript contracts and Zod schemas consumed by
|
|
4
|
+
[`@dolard.eu/versiq-widget`](https://www.npmjs.com/package/@dolard.eu/versiq-widget).
|
|
5
|
+
|
|
6
|
+
> **Companion package — not for standalone use.** This package exists to share
|
|
7
|
+
> type definitions between the Versiq backend, the marketing site, and the
|
|
8
|
+
> public widget SDK. If you are integrating the widget into your site, you need
|
|
9
|
+
> [`@dolard.eu/versiq-widget`](https://www.npmjs.com/package/@dolard.eu/versiq-widget),
|
|
10
|
+
> not this one. The widget already re-exports the types you need.
|
|
11
|
+
|
|
12
|
+
## When you might need this directly
|
|
13
|
+
|
|
14
|
+
You only need to depend on `@dolard.eu/versiq-core-types` if you are building a
|
|
15
|
+
custom integration that talks to the Versiq backend without going through the
|
|
16
|
+
widget SDK — for example, a server-to-server pipeline that posts events to the
|
|
17
|
+
Versiq API and wants the same Zod schemas the official widget uses.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @dolard.eu/versiq-core-types zod
|
|
23
|
+
# or
|
|
24
|
+
pnpm add @dolard.eu/versiq-core-types zod
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`zod` is a peer dependency: schemas are runtime-validatable.
|
|
28
|
+
|
|
29
|
+
## Scope (ADR-006)
|
|
30
|
+
|
|
31
|
+
The package contract is intentionally narrow: only types and schemas that cross
|
|
32
|
+
a workspace boundary live here. Domain-specific schemas (real-estate profiles,
|
|
33
|
+
B2B qualification, scoring rules, …) stay in the workspace that owns the domain.
|
|
34
|
+
|
|
35
|
+
## Public exports
|
|
36
|
+
|
|
37
|
+
| Module | Contents |
|
|
38
|
+
| ----------------------- | ------------------------------------------------------------------------ |
|
|
39
|
+
| `theme` | `ThemeConfig`, hex-color constraints, default palette |
|
|
40
|
+
| `theme-resolver` | Merges host-side theme with server-side theme; returns the final config |
|
|
41
|
+
| `viewport` | Viewport bucket helpers (`mobile` / `tablet` / `desktop`) + breakpoints |
|
|
42
|
+
| `widget-config` | `WidgetConfig` — the public contract of `createWidget(config)` |
|
|
43
|
+
| `widget-runtime-config` | Internal runtime view of the resolved widget config (after server merge) |
|
|
44
|
+
| `application-config` | Server-side Application metadata (vertical, allowed origins, identity) |
|
|
45
|
+
| `postmessage` | Discriminated unions for `window.postMessage` host ↔ iframe protocol |
|
|
46
|
+
| `geo` | Lightweight geo primitives (`LatLng`, `BoundingBox`) |
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import type {
|
|
50
|
+
ThemeConfig,
|
|
51
|
+
WidgetConfig,
|
|
52
|
+
ViewportBucket,
|
|
53
|
+
HostToWidgetMessage,
|
|
54
|
+
WidgetToHostMessage,
|
|
55
|
+
} from "@dolard.eu/versiq-core-types";
|
|
56
|
+
|
|
57
|
+
import {
|
|
58
|
+
themeConfigSchema,
|
|
59
|
+
hostToWidgetMessageSchema,
|
|
60
|
+
} from "@dolard.eu/versiq-core-types";
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
All schemas are Zod 4 (`zod@^4.2.0`) and infer their TypeScript types via
|
|
64
|
+
`z.infer<typeof xxxSchema>` — the same `.parse()` / `.safeParse()` API as the
|
|
65
|
+
widget itself.
|
|
66
|
+
|
|
67
|
+
## Versioning
|
|
68
|
+
|
|
69
|
+
Released in lockstep with `@dolard.eu/versiq-widget` (same version number).
|
|
70
|
+
Breaking changes follow SemVer:
|
|
71
|
+
|
|
72
|
+
- **MINOR** — added optional fields, added discriminant values, new schemas
|
|
73
|
+
- **MAJOR** — removed/renamed fields, narrowed unions, schema-level breaking
|
|
74
|
+
changes
|
|
75
|
+
|
|
76
|
+
The widget SDK pins its dependency on `@dolard.eu/versiq-core-types` to the
|
|
77
|
+
exact same version it ships with — you never need to align them yourself.
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
Commercial Source-available — see [LICENSE](./LICENSE).
|
|
82
|
+
|
|
83
|
+
This is **not** an open-source release. The source is published so integrators
|
|
84
|
+
can audit what runs in their visitors' browsers, but fork / redistribution /
|
|
85
|
+
competing-SDK use are prohibited without a written agreement.
|
|
86
|
+
|
|
87
|
+
For commercial licensing inquiries: admin@dolard.eu
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dolard.eu/versiq-core-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Cross-workspace TypeScript contracts and Zod schemas consumed by @dolard.eu/versiq-widget. Intended as a peer of the widget SDK.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|