@infinitetoken/lumber-kit 0.7.0 → 0.8.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 +20 -8
- package/contract/schema.json +1295 -1251
- package/dist/index.d.mts +63 -43
- package/dist/index.d.ts +63 -43
- package/dist/index.js +18 -0
- package/dist/index.mjs +15 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @infinitetoken/lumber-kit
|
|
2
2
|
|
|
3
|
-
Shared TypeScript types, wire format contract, and query interfaces for the [Lumber](https://
|
|
3
|
+
Shared TypeScript types, wire format contract, and query interfaces for the [Lumber](https://lumber.infinitetoken.com) cloud logging suite. Lumber is end-to-end encrypted: a client encrypts every log with AES-256-GCM before it leaves the process, and the server stores only ciphertext plus each log's level.
|
|
4
|
+
|
|
5
|
+
To send logs from your own code, you want a client rather than this package: [`@infinitetoken/lumber`](https://github.com/infinitetoken/Lumber-Node) for Node.js, [`lumber-cloud`](https://github.com/infinitetoken/Lumber-Python) for Python or [`lumber-go`](https://github.com/infinitetoken/lumber-go) for Go. The kit is what those clients and Lumber's own apps and services share, and its [contract](contract/README.md) is what a client in any language is tested against.
|
|
4
6
|
|
|
5
7
|
## Install
|
|
6
8
|
|
|
@@ -84,6 +86,10 @@ import { LogLevel, LogRecord, LogEncrypted, LogPayload, LogsQuery } from '@infin
|
|
|
84
86
|
| `AppRecord` | interface | API response shape for an app |
|
|
85
87
|
| `AppCreatedRecord` | interface | POST /apps 201 response (includes `encryptedKey` once) |
|
|
86
88
|
| `UserRecord` | interface | API response shape for a user |
|
|
89
|
+
| `TimeFormat` | interface | How a user reads times on every device: `{ clock: '24h' \| '12h', zone: 'local' \| 'utc' }` |
|
|
90
|
+
| `DEFAULT_TIME_FORMAT` | constant | 24-hour, local: what a user gets until they pick one |
|
|
91
|
+
| `isValidTimeFormat` | function | A known clock and zone, and nothing else |
|
|
92
|
+
| `normalizeTimeFormat` | function | A stored or sent time format, each part the default when missing or unknown |
|
|
87
93
|
| `TeamRecord` | interface | API response shape for a team |
|
|
88
94
|
| `TeamMemberRecord` | interface | Team membership record (listed members carry name, handle, color and picture) |
|
|
89
95
|
| `AppTeamAccess` | type | Who on an app's team reads it: `'everyone'` or `'owner'` |
|
|
@@ -172,7 +178,7 @@ The plaintext shape inside `payload` is `LogPayload`:
|
|
|
172
178
|
|
|
173
179
|
## Other languages
|
|
174
180
|
|
|
175
|
-
TypeScript can't be imported from Python or Go, so the kit ships its contract in `contract/`: a JSON Schema of every exported type (`schema.json`, generated from the TypeScript by `npm run contract`) and known answers (`vectors.json`) for API keys, AES-256-GCM, payloads and delivery, which the kit's own tests check against its code. Lumber-Python and Lumber-Go test against a pinned copy. See `contract/README.md
|
|
181
|
+
TypeScript can't be imported from Python or Go, so the kit ships its contract in `contract/`: a JSON Schema of every exported type (`schema.json`, generated from the TypeScript by `npm run contract`) and known answers (`vectors.json`) for API keys, AES-256-GCM, payloads and delivery, which the kit's own tests check against its code. Lumber-Python and Lumber-Go test against a pinned copy. See [`contract/README.md`](contract/README.md).
|
|
176
182
|
|
|
177
183
|
## const enum and Babel consumers
|
|
178
184
|
|
|
@@ -180,20 +186,26 @@ TypeScript can't be imported from Python or Go, so the kit ships its contract in
|
|
|
180
186
|
|
|
181
187
|
If your project uses Babel, esbuild, or `isolatedModules: true`, the runtime enum object is available because Lumber-Kit is compiled with `preserveConstEnums: true`. No special configuration is needed.
|
|
182
188
|
|
|
183
|
-
##
|
|
189
|
+
## Developing
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
npm install
|
|
193
|
+
npm run verify # lint, test, typecheck, build
|
|
194
|
+
npm run contract # regenerate contract/schema.json after changing a type
|
|
195
|
+
```
|
|
184
196
|
|
|
185
|
-
|
|
197
|
+
To try a change in a project that uses the kit before it's published, use [yalc](https://github.com/wclr/yalc) rather than `npm link`, whose symlinks break Metro (React Native's bundler):
|
|
186
198
|
|
|
187
199
|
```bash
|
|
188
|
-
# In Lumber-Kit
|
|
200
|
+
# In Lumber-Kit
|
|
189
201
|
npm run build
|
|
190
202
|
yalc publish
|
|
191
203
|
|
|
192
|
-
# In
|
|
204
|
+
# In the project using it
|
|
193
205
|
yalc add @infinitetoken/lumber-kit
|
|
194
206
|
npm install
|
|
195
207
|
|
|
196
|
-
# After
|
|
208
|
+
# After each change to Lumber-Kit
|
|
197
209
|
npm run build
|
|
198
|
-
yalc push #
|
|
210
|
+
yalc push # updates every project that added it
|
|
199
211
|
```
|