@openeld/openeld 0.1.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 (95) hide show
  1. package/README.md +40 -0
  2. package/buf/buf.gen.yaml +8 -0
  3. package/buf/buf.work.yaml +3 -0
  4. package/docs/architecture/.gitkeep +0 -0
  5. package/docs/architecture/README.md +3 -0
  6. package/docs/decisions/.gitkeep +0 -0
  7. package/docs/decisions/README.md +3 -0
  8. package/docs/protobuf/.gitkeep +0 -0
  9. package/docs/protobuf/README.md +28 -0
  10. package/docs/providers/.gitkeep +0 -0
  11. package/docs/providers/README.md +73 -0
  12. package/docs/providers/capability-matrix.md +13 -0
  13. package/docs/providers/geotab.md +37 -0
  14. package/docs/providers/keeptruckin.md +35 -0
  15. package/docs/providers/motive.md +36 -0
  16. package/docs/providers/provider-template.md +56 -0
  17. package/docs/providers/samsara.md +38 -0
  18. package/docs/providers/verification-matrix.md +13 -0
  19. package/docs/services/.gitkeep +0 -0
  20. package/docs/services/README.md +3 -0
  21. package/examples/ts/.gitkeep +0 -0
  22. package/examples/ts/README.md +3 -0
  23. package/package.json +34 -0
  24. package/proto/.gitkeep +0 -0
  25. package/proto/README.md +9 -0
  26. package/proto/common/metadata/.gitkeep +0 -0
  27. package/proto/common/metadata/audit.proto +22 -0
  28. package/proto/common/metadata/source.proto +31 -0
  29. package/proto/common/primitives/.gitkeep +0 -0
  30. package/proto/common/primitives/ids.proto +21 -0
  31. package/proto/common/primitives/location.proto +23 -0
  32. package/proto/common/primitives/time.proto +24 -0
  33. package/proto/common/units/.gitkeep +0 -0
  34. package/proto/common/units/measurements.proto +28 -0
  35. package/proto/logistics/asset.proto +24 -0
  36. package/proto/logistics/asset_location.proto +19 -0
  37. package/proto/logistics/assets/.gitkeep +0 -0
  38. package/proto/logistics/carrier.proto +18 -0
  39. package/proto/logistics/compliance/.gitkeep +0 -0
  40. package/proto/logistics/data_consent.proto +24 -0
  41. package/proto/logistics/diagnostics/.gitkeep +0 -0
  42. package/proto/logistics/driver.proto +28 -0
  43. package/proto/logistics/drivers/.gitkeep +0 -0
  44. package/proto/logistics/dvir.proto +34 -0
  45. package/proto/logistics/enums.proto +197 -0
  46. package/proto/logistics/events/.gitkeep +0 -0
  47. package/proto/logistics/gps_location.proto +24 -0
  48. package/proto/logistics/hos/.gitkeep +0 -0
  49. package/proto/logistics/hos_daily_summary.proto +38 -0
  50. package/proto/logistics/hos_event.proto +41 -0
  51. package/proto/logistics/ifta_trip.proto +24 -0
  52. package/proto/logistics/locations/.gitkeep +0 -0
  53. package/proto/logistics/safety_event.proto +27 -0
  54. package/proto/logistics/trips/.gitkeep +0 -0
  55. package/proto/logistics/vehicle.proto +25 -0
  56. package/proto/logistics/vehicle_assignment.proto +25 -0
  57. package/proto/logistics/vehicles/.gitkeep +0 -0
  58. package/proto/providers/eld/geotab/.gitkeep +0 -0
  59. package/proto/providers/eld/geotab/contracts.proto +105 -0
  60. package/proto/providers/eld/keeptruckin/.gitkeep +0 -0
  61. package/proto/providers/eld/keeptruckin/contracts.proto +103 -0
  62. package/proto/providers/eld/motive/.gitkeep +0 -0
  63. package/proto/providers/eld/motive/contracts.proto +108 -0
  64. package/proto/providers/eld/samsara/.gitkeep +0 -0
  65. package/proto/providers/eld/samsara/contracts.proto +110 -0
  66. package/proto/providers/eld/shared/.gitkeep +0 -0
  67. package/proto/providers/eld/shared/common.proto +174 -0
  68. package/proto/providers/telematics/fleet_complete/.gitkeep +0 -0
  69. package/proto/providers/telematics/fleet_complete/contracts.proto +13 -0
  70. package/proto/providers/telematics/fourkites/.gitkeep +0 -0
  71. package/proto/providers/telematics/fourkites/contracts.proto +13 -0
  72. package/proto/providers/telematics/project44/.gitkeep +0 -0
  73. package/proto/providers/telematics/project44/contracts.proto +13 -0
  74. package/proto/providers/telematics/shared/.gitkeep +0 -0
  75. package/proto/providers/telematics/shared/common.proto +48 -0
  76. package/proto/providers/telematics/verizon_connect/.gitkeep +0 -0
  77. package/proto/providers/telematics/verizon_connect/contracts.proto +13 -0
  78. package/proto/services/ingestion/.gitkeep +0 -0
  79. package/proto/services/ingestion/service.proto +37 -0
  80. package/proto/services/normalization/.gitkeep +0 -0
  81. package/proto/services/normalization/service.proto +62 -0
  82. package/proto/services/query/.gitkeep +0 -0
  83. package/proto/services/query/service.proto +238 -0
  84. package/proto/services/sync/.gitkeep +0 -0
  85. package/proto/services/sync/service.proto +89 -0
  86. package/proto/v1/.gitkeep +0 -0
  87. package/proto/v1/openeld.proto +39 -0
  88. package/src/adapters/providers/.gitkeep +0 -0
  89. package/src/clients/.gitkeep +0 -0
  90. package/src/fixture-normalization.ts +471 -0
  91. package/src/generated/README.md +3 -0
  92. package/src/generated/ts/.gitkeep +0 -0
  93. package/src/index.ts +1 -0
  94. package/src/mappers/.gitkeep +0 -0
  95. package/src/registry/.gitkeep +0 -0
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # openeld
2
+
3
+ `openeld` is a protobuf-first package for a universal logistics data interface across ELD and telematics providers.
4
+
5
+ ## Repository Shape
6
+
7
+ - `proto/` contains the canonical message and service definitions.
8
+ - `src/` contains the thin TypeScript package surface and hand-written integration scaffolding.
9
+ - `gen/` is reserved for generated language bindings.
10
+ - `buf/` contains protobuf linting and generation configuration.
11
+ - `docs/`, `examples/`, and `tests/fixtures/` support schema evolution and provider onboarding.
12
+
13
+ ## Source Of Truth
14
+
15
+ All shared types are intended to be defined in Protocol Buffers so TypeScript and Python bindings can be generated from the same contracts.
16
+
17
+ ## Current Schema Coverage
18
+
19
+ The `v1` schema currently includes:
20
+
21
+ - common primitives for IDs, dates, time ranges, locations, measurements, source metadata, and audit metadata
22
+ - normalized logistics entities for carriers, drivers, vehicles, vehicle assignments, HOS events, HOS daily summaries, GPS locations, DVIRs, data consents, safety events, IFTA trips, assets, and asset locations
23
+ - provider payload contracts for Samsara, Motive, Geotab, KeepTruckin, Project44, FourKites, Verizon Connect, and Fleet Complete
24
+ - service definitions for ingestion, normalization, query, and sync workflows
25
+
26
+ The aggregate import surface is `proto/v1/openeld.proto`.
27
+
28
+ ## Generation
29
+
30
+ The default Buf generation template produces:
31
+
32
+ - TypeScript output in `gen/ts`
33
+ - Python output in `gen/py`
34
+
35
+ ## Next Steps
36
+
37
+ - Refine provider-native record coverage as more provider field mappings are confirmed.
38
+ - Widen normalization outputs for consent, safety, IFTA, and asset tracking once provider mappings for those domains are mature.
39
+ - Add validation and contract tests around the `v1` schema.
40
+ - Decide whether query and sync service APIs should remain generic or split further by domain area.
@@ -0,0 +1,8 @@
1
+ version: v2
2
+ plugins:
3
+ - remote: buf.build/bufbuild/es
4
+ out: gen/ts
5
+ - remote: buf.build/protocolbuffers/python
6
+ out: gen/py
7
+ - remote: buf.build/grpc/python
8
+ out: gen/py
@@ -0,0 +1,3 @@
1
+ version: v1
2
+ directories:
3
+ - ../proto
File without changes
@@ -0,0 +1,3 @@
1
+ # Architecture Notes
2
+
3
+ Use this directory for repository structure decisions, normalization flow diagrams, and provider integration architecture.
File without changes
@@ -0,0 +1,3 @@
1
+ # Decision Records
2
+
3
+ Use this directory for architecture decision records related to schema versioning, provider boundaries, and generation strategy.
File without changes
@@ -0,0 +1,28 @@
1
+ # Protobuf Notes
2
+
3
+ `proto/` is the source of truth for the package.
4
+
5
+ ## Package Layout
6
+
7
+ - `common/` contains reusable primitives, units, source metadata, and audit metadata.
8
+ - `logistics/` contains the normalized canonical model for carriers, drivers, vehicles, assignments, HOS, GPS, DVIR, consent, safety, IFTA, and assets.
9
+ - `providers/` contains provider-native payload contracts grouped by ELD and telematics source.
10
+ - `services/` contains RPC-ready ingestion, normalization, query, and sync APIs.
11
+ - `v1/openeld.proto` is the aggregate import surface for the current schema version.
12
+
13
+ ## Generation
14
+
15
+ `buf/buf.gen.yaml` is configured to generate:
16
+
17
+ - TypeScript via `buf.build/bufbuild/es` into `gen/ts`
18
+ - Python message types via `buf.build/protocolbuffers/python` into `gen/py`
19
+ - Python gRPC stubs via `buf.build/grpc/python` into `gen/py`
20
+
21
+ ## Design Rules
22
+
23
+ - All identifiers are modeled as strings for cross-language ergonomics.
24
+ - Provider payloads stay separate from normalized logistics messages.
25
+ - Source metadata is attached to records for traceability back to native provider payloads.
26
+ - Distances, speed, engine hours, timestamps, and coordinates use normalized units defined in the schema.
27
+ - Consent, safety, IFTA, and asset tracking are part of the canonical `v1` model.
28
+ - The new Catena-inspired domains are currently exposed through the canonical schema and query APIs without widening provider normalization responses yet.
File without changes
@@ -0,0 +1,73 @@
1
+ # Provider Notes
2
+
3
+ This directory is the source of truth for onboarding and maintaining direct U.S. ELD providers.
4
+
5
+ ## Required Documents
6
+
7
+ Every provider should have:
8
+
9
+ - a provider note file describing auth, sync, supported domains, and quirks
10
+ - an entry in the capability matrix
11
+ - an entry in the verification matrix
12
+ - a fixture source record tied to authoritative API examples
13
+
14
+ ## Provider Onboarding Playbook
15
+
16
+ For each provider, complete the same sequence:
17
+
18
+ 1. Confirm provider relevance.
19
+ Accept only providers that materially help U.S. FMCSA fleet coverage and expose enough API surface to justify direct support.
20
+ 2. Capture authoritative API truth.
21
+ Collect official docs, sandbox responses, or sanitized production payloads for the provider's key endpoints.
22
+ 3. Define provider-native protobuf contracts.
23
+ Represent native records faithfully before mapping them into the canonical logistics schema.
24
+ 4. Write failing high-signal tests first.
25
+ Start with provider contract tests, canonical normalization snapshot tests, and sync-state tests.
26
+ 5. Implement normalization and sync logic.
27
+ Convert provider-native payloads to canonical protobuf messages and model the provider's real checkpoint behavior.
28
+ 6. Document fidelity and gaps.
29
+ Record unsupported fields, inferred mappings, rate limits, auth caveats, and known differences from the canonical model.
30
+ 7. Promote maturity deliberately.
31
+ Move from `planned` to `experimental`, `beta`, and `production` only when the verification matrix supports it.
32
+
33
+ ## High-Signal Fixture Policy
34
+
35
+ Fixture sources are ranked in this order:
36
+
37
+ 1. official provider examples or schemas
38
+ 2. sandbox responses
39
+ 3. sanitized production captures
40
+ 4. hand-crafted inferred fixtures only when clearly marked and scheduled for replacement
41
+
42
+ Every fixture set should carry metadata for:
43
+
44
+ - source URL or endpoint
45
+ - provider API version or doc version
46
+ - capture date
47
+ - auth context
48
+ - sanitization notes
49
+ - supported domains covered by the fixture
50
+
51
+ ## Quality Gates
52
+
53
+ A provider is not production-ready until:
54
+
55
+ - provider-native protobuf contracts exist
56
+ - authoritative fixtures exist for the supported domains
57
+ - contract tests pass against those fixtures
58
+ - normalization golden tests pass for those fixtures
59
+ - sync behavior tests cover the provider's real pagination/checkpoint model
60
+ - unsupported or degraded fields are explicitly documented
61
+
62
+ ## Matrix Files
63
+
64
+ - `capability-matrix.md` tracks what each provider supports and how it behaves operationally
65
+ - `verification-matrix.md` tracks how well each provider has been proven against real API truth
66
+ - `provider-template.md` is the template for adding new provider notes
67
+
68
+ ## Current Provider Notes
69
+
70
+ - `samsara.md`
71
+ - `motive.md`
72
+ - `geotab.md`
73
+ - `keeptruckin.md`
@@ -0,0 +1,13 @@
1
+ # Provider Capability Matrix
2
+
3
+ | Provider | Auth | Sync Model | Rate Limits | Driver | Vehicle | HOS Events | HOS Clocks | GPS | DVIR | Safety | IFTA | Assets | Maturity | Notes |
4
+ |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5
+ | Samsara | Bearer token | Feed + webhook + cursor | Documented | Planned | Planned | Planned | Planned | Planned | Planned | Planned | Unknown | Unknown | Planned | Priority direct provider |
6
+ | Motive | API key / OAuth | Page-based polling | Partially documented | Planned | Planned | Planned | Unknown | Planned | Unknown | Unknown | Unknown | Unknown | Planned | Priority direct provider |
7
+ | Geotab | Session auth | `GetFeed` + version token | Documented per database | Planned | Planned | Planned | Planned | Planned | Unknown | Unknown | Unknown | Unknown | Planned | Priority direct provider |
8
+ | KeepTruckin | Legacy compatibility | Legacy polling | Legacy / variable | Planned | Planned | Planned | Unknown | Planned | Unknown | Unknown | Unknown | Unknown | Planned | Maintain only where legacy data matters |
9
+ | TT ELD | API key | Time-window polling | Unknown | Planned | Planned | Planned | Unknown | Planned | Unknown | Unknown | Unknown | Unknown | Planned | Candidate for later expansion |
10
+ | EZLOGZ | API key | Unknown | Unknown | Planned | Planned | Planned | Unknown | Planned | Unknown | Unknown | Unknown | Unknown | Planned | Candidate for later expansion |
11
+ | Verizon Connect | OAuth | Unknown | Unknown | Partial | Partial | Partial | Unknown | Planned | Unknown | Unknown | Unknown | Planned | Planned | Verify ELD/HOS depth before prioritizing |
12
+
13
+ Update this file as soon as a provider moves beyond planning. Replace `Unknown` and `Partial` with documented facts backed by provider notes and fixtures.
@@ -0,0 +1,37 @@
1
+ # Geotab
2
+
3
+ ## Summary
4
+
5
+ - Regulatory scope: U.S. ELD / compliance capable
6
+ - Target maturity: Planned
7
+ - Current status: Doc-verified fixtures and contract tests committed
8
+
9
+ ## Auth
10
+
11
+ - Session-style authenticate flow
12
+
13
+ ## Sync Model
14
+
15
+ - `GetFeed` and `fromVersion` style incremental sync
16
+ - Best fit checkpoint types: version token and watermark
17
+
18
+ ## Supported Domains To Target
19
+
20
+ - Driver
21
+ - Vehicle
22
+ - HOS events
23
+ - HOS clocks / driver regulation
24
+ - GPS
25
+
26
+ ## Known Mapping Notes
27
+
28
+ - HOS data centers on `DutyStatusLog` and related types
29
+ - event semantics are richer and more system-oriented than some other providers
30
+ - license number availability may depend on custom fields or account configuration
31
+ - initial committed fixtures are schema-derived from official object and method docs because public static payload examples are limited
32
+
33
+ ## Verification Priority
34
+
35
+ - committed fixtures: `users`, `devices`, `duty-status-logs`, `driver-regulations`, `log-records`, `getfeed`
36
+ - test coverage: fixture provenance, provider contract shape, canonical golden normalization, version-token sync semantics
37
+ - remaining upgrade path: replace schema-derived fixtures with recorded `Get` and `GetFeed` payloads from a sandbox or live tenant
@@ -0,0 +1,35 @@
1
+ # KeepTruckin
2
+
3
+ ## Summary
4
+
5
+ - Regulatory scope: Legacy compatibility for the Motive lineage
6
+ - Target maturity: Legacy compatibility path
7
+ - Current status: Planned
8
+
9
+ ## Auth
10
+
11
+ - Legacy behavior may differ by account age and migration path
12
+
13
+ ## Sync Model
14
+
15
+ - Treat as a legacy polling integration unless verified otherwise
16
+ - Best fit checkpoint types: page-based or watermark-based depending on recovered API behavior
17
+
18
+ ## Supported Domains To Target
19
+
20
+ - Driver
21
+ - Vehicle
22
+ - HOS events
23
+ - GPS
24
+ - limited DVIR and clock support where verified
25
+
26
+ ## Known Mapping Notes
27
+
28
+ - use only where customer data or migration scenarios require it
29
+ - prefer compatibility rules and fixtures over broad new feature expansion
30
+
31
+ ## Verification Priority
32
+
33
+ - capture authentic legacy payloads
34
+ - distinguish legacy KeepTruckin behavior from modern Motive behavior
35
+ - mark all inferred mappings clearly until verified
@@ -0,0 +1,36 @@
1
+ # Motive
2
+
3
+ ## Summary
4
+
5
+ - Regulatory scope: U.S. ELD / compliance capable
6
+ - Target maturity: Planned
7
+ - Current status: Doc-verified fixtures and contract tests committed
8
+
9
+ ## Auth
10
+
11
+ - API key or OAuth 2.0 depending on account/application path
12
+
13
+ ## Sync Model
14
+
15
+ - Page-based polling is the documented sync model
16
+ - Best fit checkpoint types: page token or page counter plus watermark
17
+
18
+ ## Supported Domains To Target
19
+
20
+ - Driver
21
+ - Vehicle
22
+ - HOS events
23
+ - GPS
24
+ - DVIR where available
25
+
26
+ ## Known Mapping Notes
27
+
28
+ - odometer may require miles-to-meters conversion
29
+ - engine hours may require hours-to-seconds conversion
30
+ - logs use native `status`, `annotation`, and coordinate fields
31
+
32
+ ## Verification Priority
33
+
34
+ - committed fixtures: `drivers`, `vehicles`, `hos-logs`, `vehicle-locations`, `page-sync`
35
+ - test coverage: fixture provenance, provider contract shape, canonical golden normalization, page-based sync semantics
36
+ - remaining upgrade path: validate unit conversion assumptions against sandbox or production captures
@@ -0,0 +1,56 @@
1
+ # Provider Template
2
+
3
+ ## Provider Summary
4
+
5
+ - Provider:
6
+ - Regulatory scope:
7
+ - Maturity:
8
+ - Last reviewed:
9
+
10
+ ## Auth
11
+
12
+ - Auth method:
13
+ - Token/session refresh behavior:
14
+ - Required scopes or account setup:
15
+
16
+ ## Sync Model
17
+
18
+ - Primary sync mechanism:
19
+ - Checkpoint type:
20
+ - Pagination model:
21
+ - Time-window constraints:
22
+ - Webhook support:
23
+
24
+ ## Supported Domains
25
+
26
+ - Driver:
27
+ - Vehicle:
28
+ - HOS events:
29
+ - HOS clocks:
30
+ - GPS:
31
+ - DVIR:
32
+ - Safety:
33
+ - IFTA:
34
+ - Assets:
35
+
36
+ ## Mapping Notes
37
+
38
+ - Native payload identifiers:
39
+ - Unit normalization rules:
40
+ - Enum mapping quirks:
41
+ - Known missing or degraded fields:
42
+
43
+ ## Fixture Provenance
44
+
45
+ - Fixture source:
46
+ - Source URL or endpoint:
47
+ - API/doc version:
48
+ - Capture date:
49
+ - Sanitization notes:
50
+
51
+ ## Test Coverage
52
+
53
+ - Contract tests:
54
+ - Normalization snapshot tests:
55
+ - Sync behavior tests:
56
+ - Remaining inferred mappings:
@@ -0,0 +1,38 @@
1
+ # Samsara
2
+
3
+ ## Summary
4
+
5
+ - Regulatory scope: U.S. ELD / compliance capable
6
+ - Target maturity: Planned
7
+ - Current status: Doc-verified fixtures and contract tests committed
8
+
9
+ ## Auth
10
+
11
+ - Bearer API token
12
+
13
+ ## Sync Model
14
+
15
+ - Feed endpoints with cursor semantics
16
+ - Webhook support is available
17
+ - Best fit checkpoint types: cursor and time watermark
18
+
19
+ ## Supported Domains To Target
20
+
21
+ - Driver
22
+ - Vehicle
23
+ - HOS events
24
+ - HOS clocks
25
+ - GPS
26
+ - DVIR
27
+
28
+ ## Known Mapping Notes
29
+
30
+ - `driver.name` may need splitting into first and last name
31
+ - speed may be reported in mph and should normalize to km/h
32
+ - HOS logs expose native `hosStatusType`, `origin`, `remark`, and location details
33
+
34
+ ## Verification Priority
35
+
36
+ - committed fixtures: `drivers`, `vehicles`, `hos-logs`, `hos-clocks`, `vehicle-locations`, `dvirs`, `feed-cursor`
37
+ - test coverage: fixture provenance, provider contract shape, canonical golden normalization, cursor sync semantics
38
+ - remaining upgrade path: replace doc-derived fixture set with sandbox or production captures when credentials are available
@@ -0,0 +1,13 @@
1
+ # Provider Verification Matrix
2
+
3
+ | Provider | Fixture Source | Last Verified | Auth Tested | Sync Tested | Driver | Vehicle | HOS Events | HOS Clocks | GPS | DVIR | Safety | IFTA | Assets | Inferred Mappings Remaining | Status |
4
+ |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5
+ | Samsara | Official docs examples and sync docs | 2026-03-14 | No | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | Doc-verified fixtures |
6
+ | Motive | Official docs examples | 2026-03-14 | No | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | Doc-verified fixtures |
7
+ | Geotab | Official object and method docs (schema-derived fixtures) | 2026-03-14 | No | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | No | Yes | Doc-verified fixtures |
8
+ | KeepTruckin | Not captured yet | Not verified | No | No | No | No | No | No | No | No | No | No | No | Yes | Planned |
9
+ | TT ELD | Not captured yet | Not verified | No | No | No | No | No | No | No | No | No | No | No | Yes | Planned |
10
+ | EZLOGZ | Not captured yet | Not verified | No | No | No | No | No | No | No | No | No | No | No | Yes | Planned |
11
+ | Verizon Connect | Not captured yet | Not verified | No | No | No | No | No | No | No | No | No | No | No | Yes | Planned |
12
+
13
+ A provider must not be promoted to production-ready if the fixture source is inferred-only or if core supported domains remain unverified.
File without changes
@@ -0,0 +1,3 @@
1
+ # Service Notes
2
+
3
+ Use this directory for protobuf service responsibilities, request and response flow notes, and transport decisions.
File without changes
@@ -0,0 +1,3 @@
1
+ # TypeScript Examples
2
+
3
+ Use this directory for consumer-facing TypeScript examples once protobuf generation and package exports are defined.
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@openeld/openeld",
3
+ "version": "0.1.0",
4
+ "description": "Universal protobuf-first data interface for logistics ELD and telematics integrations.",
5
+ "type": "module",
6
+ "module": "src/index.ts",
7
+ "exports": {
8
+ ".": "./src/index.ts"
9
+ },
10
+ "files": [
11
+ "proto",
12
+ "src",
13
+ "buf",
14
+ "docs",
15
+ "examples"
16
+ ],
17
+ "scripts": {
18
+ "proto:lint": "buf lint",
19
+ "proto:breaking": "buf breaking --against '.git#branch=main'",
20
+ "gen": "buf generate --template buf/buf.gen.yaml",
21
+ "test": "bun test",
22
+ "test:contract": "bun test tests/contract",
23
+ "test:integration": "bun test tests/integration"
24
+ },
25
+ "devDependencies": {
26
+ "@types/bun": "latest"
27
+ },
28
+ "peerDependencies": {
29
+ "typescript": "^5"
30
+ },
31
+ "dependencies": {
32
+ "tsup": "^8.5.1"
33
+ }
34
+ }
package/proto/.gitkeep ADDED
File without changes
@@ -0,0 +1,9 @@
1
+ # Proto Layout
2
+
3
+ This directory is the source of truth for all shared data contracts.
4
+
5
+ - `common/` is reserved for reusable primitives, units, and metadata messages.
6
+ - `logistics/` is reserved for normalized cross-provider logistics models.
7
+ - `providers/` is reserved for vendor-specific message contracts.
8
+ - `services/` is reserved for protobuf service definitions.
9
+ - `v1/` is reserved for versioned package entry definitions.
File without changes
@@ -0,0 +1,22 @@
1
+ syntax = "proto3";
2
+
3
+ package openeld.common.metadata.v1;
4
+
5
+ import "google/protobuf/timestamp.proto";
6
+
7
+ // * Stores audit timestamps and actor references for mutable records.
8
+ message AuditMetadata {
9
+ optional google.protobuf.Timestamp created_at = 1;
10
+ optional google.protobuf.Timestamp updated_at = 2;
11
+ optional string created_by = 3;
12
+ optional string updated_by = 4;
13
+ uint32 revision = 5;
14
+ }
15
+
16
+ // * Describes a discrete change or certification action.
17
+ message ChangeRecord {
18
+ optional string actor_id = 1;
19
+ optional string actor_role = 2;
20
+ optional google.protobuf.Timestamp changed_at = 3;
21
+ optional string reason = 4;
22
+ }
@@ -0,0 +1,31 @@
1
+ syntax = "proto3";
2
+
3
+ package openeld.common.metadata.v1;
4
+
5
+ import "common/primitives/ids.proto";
6
+
7
+ // * Identifies the upstream provider that originated a record.
8
+ enum SourceProvider {
9
+ SOURCE_PROVIDER_UNSPECIFIED = 0;
10
+ SOURCE_PROVIDER_SAMSARA = 1;
11
+ SOURCE_PROVIDER_MOTIVE = 2;
12
+ SOURCE_PROVIDER_GEOTAB = 3;
13
+ SOURCE_PROVIDER_KEEPTRUCKIN = 4;
14
+ SOURCE_PROVIDER_PROJECT44 = 5;
15
+ SOURCE_PROVIDER_FOUR_KITES = 6;
16
+ SOURCE_PROVIDER_VERIZON_CONNECT = 7;
17
+ SOURCE_PROVIDER_FLEET_COMPLETE = 8;
18
+ SOURCE_PROVIDER_CUSTOM = 9;
19
+ }
20
+
21
+ // * Captures traceability back to the upstream payload and identifiers.
22
+ message SourceRecord {
23
+ SourceProvider provider = 1;
24
+ optional string provider_account_id = 2;
25
+ optional string provider_record_type = 3;
26
+ optional string primary_external_id = 4;
27
+ repeated openeld.common.primitives.v1.ExternalIdentifier external_ids = 5;
28
+ optional string native_status = 6;
29
+ optional string sync_cursor = 7;
30
+ optional string raw_payload_json = 8;
31
+ }
File without changes
@@ -0,0 +1,21 @@
1
+ syntax = "proto3";
2
+
3
+ package openeld.common.primitives.v1;
4
+
5
+ // * Represents a reusable identifier value.
6
+ message Identifier {
7
+ string value = 1;
8
+ }
9
+
10
+ // * References another entity by identifier and logical type.
11
+ message EntityReference {
12
+ string id = 1;
13
+ string entity_type = 2;
14
+ }
15
+
16
+ // * Captures a provider or external system identifier.
17
+ message ExternalIdentifier {
18
+ string namespace = 1;
19
+ string value = 2;
20
+ optional string label = 3;
21
+ }
@@ -0,0 +1,23 @@
1
+ syntax = "proto3";
2
+
3
+ package openeld.common.primitives.v1;
4
+
5
+ // * Stores a geographic point using normalized decimal-degree coordinates.
6
+ message GeoPoint {
7
+ double latitude = 1;
8
+ double longitude = 2;
9
+ }
10
+
11
+ // * Stores a human-readable location label for operational and compliance views.
12
+ message LocationDescription {
13
+ optional string city = 1;
14
+ optional string subdivision_code = 2;
15
+ optional string country_code = 3;
16
+ optional string description = 4;
17
+ }
18
+
19
+ // * Combines coordinates with an optional human-readable description.
20
+ message GeoLocation {
21
+ GeoPoint point = 1;
22
+ optional LocationDescription description = 2;
23
+ }
@@ -0,0 +1,24 @@
1
+ syntax = "proto3";
2
+
3
+ package openeld.common.primitives.v1;
4
+
5
+ import "google/protobuf/duration.proto";
6
+ import "google/protobuf/timestamp.proto";
7
+
8
+ // * Represents a calendar date without a timezone.
9
+ message LocalDate {
10
+ int32 year = 1;
11
+ int32 month = 2;
12
+ int32 day = 3;
13
+ }
14
+
15
+ // * Represents a bounded time window.
16
+ message TimeRange {
17
+ google.protobuf.Timestamp start_time = 1;
18
+ optional google.protobuf.Timestamp end_time = 2;
19
+ }
20
+
21
+ // * Represents a duration summary using protobuf's cross-language duration type.
22
+ message DurationValue {
23
+ google.protobuf.Duration value = 1;
24
+ }
File without changes
@@ -0,0 +1,28 @@
1
+ syntax = "proto3";
2
+
3
+ package openeld.common.units.v1;
4
+
5
+ // * Stores a normalized distance measurement in meters.
6
+ message Distance {
7
+ double meters = 1;
8
+ }
9
+
10
+ // * Stores a normalized speed measurement in kilometers per hour.
11
+ message Speed {
12
+ double kilometers_per_hour = 1;
13
+ }
14
+
15
+ // * Stores a normalized compass heading in degrees.
16
+ message Heading {
17
+ double degrees = 1;
18
+ }
19
+
20
+ // * Stores a normalized odometer reading in meters.
21
+ message OdometerReading {
22
+ double meters = 1;
23
+ }
24
+
25
+ // * Stores a normalized engine-hour reading in seconds.
26
+ message EngineHours {
27
+ double seconds = 1;
28
+ }
@@ -0,0 +1,24 @@
1
+ syntax = "proto3";
2
+
3
+ package openeld.logistics.v1;
4
+
5
+ import "common/metadata/audit.proto";
6
+ import "common/metadata/source.proto";
7
+ import "logistics/enums.proto";
8
+
9
+ // * Represents a non-powered or auxiliary asset such as a trailer or chassis.
10
+ message Asset {
11
+ string asset_id = 1;
12
+ string carrier_id = 2;
13
+ AssetType asset_type = 3;
14
+ string asset_number = 4;
15
+ optional string vin = 5;
16
+ optional string make = 6;
17
+ optional string model = 7;
18
+ optional int32 year = 8;
19
+ optional string license_plate = 9;
20
+ optional string license_state = 10;
21
+ AssetStatus status = 11;
22
+ optional openeld.common.metadata.v1.SourceRecord source = 20;
23
+ optional openeld.common.metadata.v1.AuditMetadata audit = 21;
24
+ }