@openeld/openeld 0.1.0 → 0.1.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 +166 -24
- package/dist/index.d.ts +8045 -0
- package/dist/index.js +2072 -0
- package/docs/README.md +71 -0
- package/docs/architecture/README.md +4 -0
- package/docs/concepts/schema-and-generated-bindings.md +74 -0
- package/docs/decisions/README.md +4 -0
- package/docs/getting-started/quickstart.md +62 -0
- package/docs/guides/normalization.md +106 -0
- package/docs/guides/query-and-sync.md +59 -0
- package/docs/guides/transports-and-remote-services.md +79 -0
- package/docs/protobuf/README.md +15 -11
- package/docs/providers/README.md +35 -54
- package/docs/providers/capability-matrix.md +2 -0
- package/docs/providers/geotab.md +55 -23
- package/docs/providers/keeptruckin.md +32 -22
- package/docs/providers/motive.md +52 -21
- package/docs/providers/provider-template.md +2 -0
- package/docs/providers/samsara.md +57 -25
- package/docs/providers/verification-matrix.md +2 -0
- package/docs/services/README.md +4 -0
- package/examples/ts/README.md +67 -1
- package/gen/README.md +8 -0
- package/gen/ts/common/metadata/audit_pb.d.ts +84 -0
- package/gen/ts/common/metadata/audit_pb.js +27 -0
- package/gen/ts/common/metadata/source_pb.d.ts +128 -0
- package/gen/ts/common/metadata/source_pb.js +34 -0
- package/gen/ts/common/primitives/ids_pb.d.ts +81 -0
- package/gen/ts/common/primitives/ids_pb.js +33 -0
- package/gen/ts/common/primitives/location_pb.d.ts +91 -0
- package/gen/ts/common/primitives/location_pb.js +33 -0
- package/gen/ts/common/primitives/time_pb.d.ts +82 -0
- package/gen/ts/common/primitives/time_pb.js +34 -0
- package/gen/ts/common/units/measurements_pb.d.ts +102 -0
- package/gen/ts/common/units/measurements_pb.js +47 -0
- package/gen/ts/logistics/asset_location_pb.d.ts +64 -0
- package/gen/ts/logistics/asset_location_pb.js +23 -0
- package/gen/ts/logistics/asset_pb.d.ts +93 -0
- package/gen/ts/logistics/asset_pb.js +22 -0
- package/gen/ts/logistics/carrier_pb.d.ts +67 -0
- package/gen/ts/logistics/carrier_pb.js +21 -0
- package/gen/ts/logistics/data_consent_pb.d.ts +89 -0
- package/gen/ts/logistics/data_consent_pb.js +23 -0
- package/gen/ts/logistics/driver_pb.d.ts +109 -0
- package/gen/ts/logistics/driver_pb.js +23 -0
- package/gen/ts/logistics/dvir_pb.d.ts +132 -0
- package/gen/ts/logistics/dvir_pb.js +30 -0
- package/gen/ts/logistics/enums_pb.d.ts +837 -0
- package/gen/ts/logistics/enums_pb.js +264 -0
- package/gen/ts/logistics/gps_location_pb.d.ts +85 -0
- package/gen/ts/logistics/gps_location_pb.js +24 -0
- package/gen/ts/logistics/hos_daily_summary_pb.d.ts +139 -0
- package/gen/ts/logistics/hos_daily_summary_pb.js +32 -0
- package/gen/ts/logistics/hos_event_pb.d.ts +159 -0
- package/gen/ts/logistics/hos_event_pb.js +32 -0
- package/gen/ts/logistics/ifta_trip_pb.d.ts +85 -0
- package/gen/ts/logistics/ifta_trip_pb.js +24 -0
- package/gen/ts/logistics/safety_event_pb.d.ts +96 -0
- package/gen/ts/logistics/safety_event_pb.js +25 -0
- package/gen/ts/logistics/vehicle_assignment_pb.d.ts +91 -0
- package/gen/ts/logistics/vehicle_assignment_pb.js +29 -0
- package/gen/ts/logistics/vehicle_pb.d.ts +98 -0
- package/gen/ts/logistics/vehicle_pb.js +22 -0
- package/gen/ts/providers/eld/geotab/contracts_pb.d.ts +453 -0
- package/gen/ts/providers/eld/geotab/contracts_pb.js +70 -0
- package/gen/ts/providers/eld/keeptruckin/contracts_pb.d.ts +443 -0
- package/gen/ts/providers/eld/keeptruckin/contracts_pb.js +70 -0
- package/gen/ts/providers/eld/motive/contracts_pb.d.ts +468 -0
- package/gen/ts/providers/eld/motive/contracts_pb.js +70 -0
- package/gen/ts/providers/eld/samsara/contracts_pb.d.ts +474 -0
- package/gen/ts/providers/eld/samsara/contracts_pb.js +71 -0
- package/gen/ts/providers/eld/shared/common_pb.d.ts +752 -0
- package/gen/ts/providers/eld/shared/common_pb.js +113 -0
- package/gen/ts/providers/telematics/fleet_complete/contracts_pb.d.ts +46 -0
- package/gen/ts/providers/telematics/fleet_complete/contracts_pb.js +20 -0
- package/gen/ts/providers/telematics/fourkites/contracts_pb.d.ts +46 -0
- package/gen/ts/providers/telematics/fourkites/contracts_pb.js +20 -0
- package/gen/ts/providers/telematics/project44/contracts_pb.d.ts +46 -0
- package/gen/ts/providers/telematics/project44/contracts_pb.js +20 -0
- package/gen/ts/providers/telematics/shared/common_pb.d.ts +192 -0
- package/gen/ts/providers/telematics/shared/common_pb.js +43 -0
- package/gen/ts/providers/telematics/verizon_connect/contracts_pb.d.ts +46 -0
- package/gen/ts/providers/telematics/verizon_connect/contracts_pb.js +20 -0
- package/gen/ts/services/ingestion/service_pb.d.ts +128 -0
- package/gen/ts/services/ingestion/service_pb.js +40 -0
- package/gen/ts/services/normalization/service_pb.d.ts +201 -0
- package/gen/ts/services/normalization/service_pb.js +53 -0
- package/gen/ts/services/query/service_pb.d.ts +1018 -0
- package/gen/ts/services/query/service_pb.js +278 -0
- package/gen/ts/services/sync/service_pb.d.ts +361 -0
- package/gen/ts/services/sync/service_pb.js +97 -0
- package/gen/ts/v1/openeld_pb.d.ts +11 -0
- package/gen/ts/v1/openeld_pb.js +46 -0
- package/package.json +45 -11
- package/src/clients/.gitkeep +0 -0
- package/src/fixture-normalization.ts +0 -471
- package/src/generated/README.md +0 -3
- package/src/generated/ts/.gitkeep +0 -0
- package/src/index.ts +0 -1
- package/src/mappers/.gitkeep +0 -0
- package/src/registry/.gitkeep +0 -0
- /package/{src/adapters/providers → gen/ts}/.gitkeep +0 -0
package/README.md
CHANGED
|
@@ -1,40 +1,182 @@
|
|
|
1
1
|
# openeld
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@openeld/openeld` is a protobuf-first SDK for normalizing ELD and telematics data into a shared logistics model.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
It is designed for teams that want:
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
- `docs/`, `examples/`, and `tests/fixtures/` support schema evolution and provider onboarding.
|
|
7
|
+
- one canonical schema across providers
|
|
8
|
+
- a pleasant TypeScript SDK for day-to-day integration work
|
|
9
|
+
- generated protobuf bindings as the source of truth for runtime types
|
|
10
|
+
- a path toward transport-backed query and sync APIs without changing the package shape later
|
|
12
11
|
|
|
13
|
-
##
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install @openeld/openeld
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
bun add @openeld/openeld
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quickstart
|
|
23
|
+
|
|
24
|
+
The fastest way to get value from OpenELD today is local provider normalization through the OO SDK:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { createOpenEldClient } from "@openeld/openeld";
|
|
28
|
+
|
|
29
|
+
const client = createOpenEldClient();
|
|
30
|
+
|
|
31
|
+
const result = await client.providers.samsara.normalize({
|
|
32
|
+
drivers,
|
|
33
|
+
vehicles,
|
|
34
|
+
hosLogs,
|
|
35
|
+
hosClocks,
|
|
36
|
+
vehicleLocations,
|
|
37
|
+
dvirs,
|
|
38
|
+
feedCursor,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
console.log(result.response.drivers);
|
|
42
|
+
console.log(result.response.vehicles);
|
|
43
|
+
console.log(result.warnings);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The provider method returns:
|
|
47
|
+
|
|
48
|
+
- `payload`: the generated provider payload message
|
|
49
|
+
- `request`: the generated normalization request
|
|
50
|
+
- `response`: the generated canonical normalization response
|
|
51
|
+
- `warnings`: provider-specific caveats and staging notes
|
|
52
|
+
|
|
53
|
+
## Choose Your Path
|
|
54
|
+
|
|
55
|
+
### Recommended: OO SDK
|
|
56
|
+
|
|
57
|
+
Use `createOpenEldClient()` when you want the cleanest consumer experience.
|
|
58
|
+
|
|
59
|
+
- `client.providers.samsara.normalize(...)`
|
|
60
|
+
- `client.providers.motive.normalize(...)`
|
|
61
|
+
- `client.providers.geotab.normalize(...)`
|
|
62
|
+
- `client.providers.supported()`
|
|
63
|
+
|
|
64
|
+
### Advanced: Protobuf-First Normalization
|
|
65
|
+
|
|
66
|
+
Use the normalization namespace when you want to stay closer to generated request and response types:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
import {
|
|
70
|
+
createOpenEldClient,
|
|
71
|
+
buildSamsaraPayload,
|
|
72
|
+
} from "@openeld/openeld";
|
|
73
|
+
|
|
74
|
+
const client = createOpenEldClient();
|
|
75
|
+
const payload = buildSamsaraPayload({
|
|
76
|
+
drivers,
|
|
77
|
+
vehicles,
|
|
78
|
+
hosLogs,
|
|
79
|
+
hosClocks,
|
|
80
|
+
vehicleLocations,
|
|
81
|
+
dvirs,
|
|
82
|
+
feedCursor,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const request = client.normalization.toRequest("samsara", payload, {
|
|
86
|
+
tenantId: "tenant-123",
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const response = await client.normalization.normalize(request);
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Staged: Query And Sync
|
|
93
|
+
|
|
94
|
+
`client.query` and `client.sync` already match the intended protobuf service boundaries, but they require a configured transport invoker.
|
|
14
95
|
|
|
15
|
-
|
|
96
|
+
They are useful when you are:
|
|
16
97
|
|
|
17
|
-
|
|
98
|
+
- calling a remote service that implements the protobuf contracts
|
|
99
|
+
- standardizing your own transport layer around OpenELD request and response types
|
|
18
100
|
|
|
19
|
-
|
|
101
|
+
They are not local in-process data stores or built-in hosted APIs.
|
|
20
102
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
103
|
+
## SDK Scope Today
|
|
104
|
+
|
|
105
|
+
What works locally right now:
|
|
106
|
+
|
|
107
|
+
- provider payload building and normalization for `samsara`, `motive`, and `geotab`
|
|
108
|
+
- advanced in-process normalization through `client.normalization`
|
|
109
|
+
- generated protobuf bindings through the root package, `client.schemas`, and `@openeld/openeld/generated`
|
|
110
|
+
|
|
111
|
+
What is transport-ready but not locally implemented:
|
|
112
|
+
|
|
113
|
+
- `client.query.*`
|
|
114
|
+
- `client.sync.*`
|
|
115
|
+
|
|
116
|
+
## Supported Providers
|
|
117
|
+
|
|
118
|
+
Current consumer-ready local normalization support:
|
|
119
|
+
|
|
120
|
+
- Samsara
|
|
121
|
+
- Motive
|
|
122
|
+
- Geotab
|
|
123
|
+
|
|
124
|
+
Limited or staged provider support:
|
|
125
|
+
|
|
126
|
+
- KeepTruckin is documented as a legacy compatibility path
|
|
127
|
+
- additional provider contracts exist in the protobuf surface, but not all are wired into the local runtime yet
|
|
128
|
+
|
|
129
|
+
See the provider guides in [`docs/providers/README.md`](docs/providers/README.md).
|
|
130
|
+
|
|
131
|
+
## Documentation
|
|
132
|
+
|
|
133
|
+
Start here:
|
|
134
|
+
|
|
135
|
+
- [Documentation Home](docs/README.md)
|
|
136
|
+
- [Quickstart](docs/getting-started/quickstart.md)
|
|
137
|
+
- [Normalization Guide](docs/guides/normalization.md)
|
|
138
|
+
- [Transport And Remote Services](docs/guides/transports-and-remote-services.md)
|
|
139
|
+
- [Query And Sync Guide](docs/guides/query-and-sync.md)
|
|
140
|
+
- [Schema And Generated Bindings](docs/concepts/schema-and-generated-bindings.md)
|
|
141
|
+
- [Provider Guides](docs/providers/README.md)
|
|
142
|
+
|
|
143
|
+
## Source Of Truth
|
|
144
|
+
|
|
145
|
+
`proto/` is the only source of structural types.
|
|
146
|
+
|
|
147
|
+
That means:
|
|
148
|
+
|
|
149
|
+
- canonical logistics entities are defined in protobuf
|
|
150
|
+
- provider-native payload contracts are defined in protobuf
|
|
151
|
+
- generated TypeScript bindings in `gen/ts` are the runtime type surface
|
|
152
|
+
- handwritten TypeScript in `src/` focuses on behavior, orchestration, and transport boundaries
|
|
25
153
|
|
|
26
154
|
The aggregate import surface is `proto/v1/openeld.proto`.
|
|
27
155
|
|
|
28
|
-
##
|
|
156
|
+
## Package Layout
|
|
157
|
+
|
|
158
|
+
- `src/` contains the SDK, runtime services, adapters, and client facades
|
|
159
|
+
- `proto/` contains canonical and provider-native protobuf definitions
|
|
160
|
+
- `gen/ts` contains generated TypeScript bindings that ship with the package
|
|
161
|
+
- `docs/` contains consumer and contributor documentation
|
|
162
|
+
- `examples/` contains focused usage examples
|
|
163
|
+
|
|
164
|
+
## Packaging
|
|
165
|
+
|
|
166
|
+
- `bun run build` emits the ESM bundle and `.d.ts` types
|
|
167
|
+
- `@openeld/openeld/client` and `@openeld/openeld/generated` provide clearer import intent while resolving to the published bundle
|
|
168
|
+
- `npm pack --dry-run` validates publish contents locally
|
|
169
|
+
|
|
170
|
+
## Versioning And Release
|
|
29
171
|
|
|
30
|
-
|
|
172
|
+
This repository uses Changesets for semantic versioning, changelog entries, and release tagging.
|
|
31
173
|
|
|
32
|
-
-
|
|
33
|
-
-
|
|
174
|
+
- run `bun run changeset` when a change should affect the published package version
|
|
175
|
+
- commit the generated file under `.changeset/`
|
|
176
|
+
- merge to `main` to let the release workflow open or update the version PR
|
|
177
|
+
- merging the version PR publishes to npm and creates the corresponding release tag
|
|
34
178
|
|
|
35
|
-
|
|
179
|
+
GitHub Actions handles validation and release automation:
|
|
36
180
|
|
|
37
|
-
-
|
|
38
|
-
-
|
|
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.
|
|
181
|
+
- `.github/workflows/ci.yml` runs build, tests, and package validation
|
|
182
|
+
- `.github/workflows/publish.yml` opens version PRs and publishes tagged releases through Changesets
|