@livdot-tech/contracts 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.
Files changed (2) hide show
  1. package/README.md +78 -0
  2. package/package.json +59 -0
package/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # LivDot Shared Contracts
2
+ Central contract repository for schemas and shared API-facing types used across the LivDot platform.
3
+ ## Purpose
4
+ This repository exists to keep backend, frontend, and mobile aligned on the same contract surface without coupling the codebases into a monorepo.
5
+ It is the single shared source for:
6
+ - request and response schemas
7
+ - domain enums and state constants
8
+ - canonical error codes
9
+ - shared DTOs and validation rules
10
+ - other API-boundary definitions that must remain consistent across services and clients
11
+
12
+ ## Repositories That Consume This Package
13
+ - `livdot-backend`
14
+ - `livdot-frontend`
15
+ - `livdot-mobile`
16
+
17
+ ## What Belongs Here
18
+ Only cross-stack contract artifacts.
19
+ Examples:
20
+ - `CreateEventRequest`
21
+ - `BookingStatus`
22
+ - `EventLifecycleState`
23
+ - `ApiErrorCode`
24
+ - Zod schemas for payload validation
25
+ - shared auth/token payload shapes where applicable
26
+
27
+ ## What Must Not Be Added Here
28
+ This repository is **not** a dumping ground for shared code.
29
+ Do **not** add:
30
+ - backend business logic
31
+ - ORM/database models
32
+ - repositories/services/use-cases
33
+ - frontend UI components
34
+ - mobile-specific runtime code
35
+ - infrastructure or deployment logic
36
+ - utilities that are not part of a cross-stack contract
37
+ If it is not part of the contract boundary, it does not belong here.
38
+
39
+ ## Ownership
40
+ The backend remains the authority on system behavior and API truth.
41
+ This repository defines the **contract shape**, not the implementation or business logic.
42
+
43
+ ## Versioning
44
+ This package must follow semantic versioning:
45
+ - **PATCH**: backward-compatible fixes
46
+ - **MINOR**: backward-compatible additions
47
+ - **MAJOR**: breaking changes
48
+ Consumer repositories must pin explicit versions and upgrade through review.
49
+
50
+ ## Change Rules
51
+ Any contract change must be treated carefully because it can affect multiple codebases.
52
+ Before merging a change:
53
+ 1. confirm the change is truly cross-stack
54
+ 2. identify whether it is breaking or non-breaking
55
+ 3. update version appropriately
56
+ 4. document migration notes if consumers need code changes
57
+
58
+ ## Recommended Structure
59
+ ```text
60
+ src/
61
+ auth/
62
+ booking/
63
+ common/
64
+ errors/
65
+ event/
66
+ payment/
67
+ index.ts
68
+ ```
69
+
70
+ ## Installation and Usage
71
+
72
+ See [README.md](./docs/README.md).
73
+
74
+ ## Goal
75
+
76
+ Keep contracts explicit, versioned, and stable.
77
+
78
+ This repository exists to improve consistency across backend, frontend, and mobile while preserving clear ownership boundaries between the separate LivDot codebases.
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@livdot-tech/contracts",
3
+ "version": "1.0.0",
4
+ "description": "Shared API contracts for the LivDot platform",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ },
14
+ "./*": {
15
+ "types": "./dist/*/index.d.ts",
16
+ "import": "./dist/*/index.mjs",
17
+ "require": "./dist/*/index.js"
18
+ }
19
+ },
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "scripts": {
27
+ "build": "tsup",
28
+ "dev": "tsup --watch",
29
+ "test": "jest --coverage --coverageReporters=lcov --coverageReporters=text --coverageReporters=text-summary",
30
+ "test:watch": "jest --watch",
31
+ "test:coverage": "jest --coverage",
32
+ "lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\"",
33
+ "lint:fix": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" --fix",
34
+ "format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
35
+ "typecheck": "tsc --noEmit",
36
+ "docs": "typedoc --out docs/api",
37
+ "release": "standard-version"
38
+ },
39
+ "dependencies": {
40
+ "zod": "^3.22.4"
41
+ },
42
+ "devDependencies": {
43
+ "@types/jest": "^29.5.12",
44
+ "@types/node": "^20.11.24",
45
+ "@typescript-eslint/eslint-plugin": "^8.59.0",
46
+ "@typescript-eslint/parser": "^8.59.0",
47
+ "eslint": "^8.57.1",
48
+ "eslint-config-prettier": "^10.1.8",
49
+ "eslint-plugin-prettier": "^5.5.5",
50
+ "jest": "^29.7.0",
51
+ "jest-environment-node": "^29.7.0",
52
+ "prettier": "^3.2.5",
53
+ "standard-version": "^9.5.0",
54
+ "ts-jest": "^29.1.2",
55
+ "tsup": "^8.0.2",
56
+ "typedoc": "^0.25.10",
57
+ "typescript": "^5.3.3"
58
+ }
59
+ }