@stackone/olap 1.67.0 → 1.69.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 +43 -0
- package/dist/index.cjs +37 -107
- package/dist/index.d.cts +23 -17
- package/dist/index.d.mts +23 -17
- package/dist/index.mjs +37 -107
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,6 +49,49 @@ $ pnpm lint
|
|
|
49
49
|
$ pnpm lint:fix
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
## Platform logs
|
|
53
|
+
|
|
54
|
+
Platform logs are the audit trail of operations on StackOne itself — creating an account, deleting
|
|
55
|
+
an integration, minting a session — as opposed to requests proxied to a provider.
|
|
56
|
+
|
|
57
|
+
They are read through `getPlatformLogs` and **only** through it. It takes no `engine` argument,
|
|
58
|
+
because there is nothing to choose: the `platform` table lives in ClickHouse and has no Tinybird
|
|
59
|
+
datasource, so the client is resolved here rather than by the caller.
|
|
60
|
+
|
|
61
|
+
They are also deliberately **not** part of the combined `getLogs` feed. That feed still serves orgs
|
|
62
|
+
on Tinybird, so including platform rows meant classifying every filter and dimension the platform
|
|
63
|
+
table lacks, per arm, and quietly rerouting such queries to ClickHouse behind the caller's back.
|
|
64
|
+
`CombinedLogType` is therefore `action | unified`, and it stays that way at least until Tinybird is
|
|
65
|
+
gone.
|
|
66
|
+
|
|
67
|
+
### `isRead`
|
|
68
|
+
|
|
69
|
+
Each row carries `isRead`: whether the operation only retrieved state, changing nothing and sending
|
|
70
|
+
nothing onwards. It is a `UInt8` in ClickHouse and a boolean on the way out, filterable through
|
|
71
|
+
`PlatformQuery`.
|
|
72
|
+
|
|
73
|
+
The value comes from the emitting route and nothing else, and an absent value means `false` — "not
|
|
74
|
+
known to be a pure read", which is where anything with a side effect belongs. Neither the HTTP
|
|
75
|
+
method nor the verb can stand in for it: a read is often a `POST` carrying filters, and plenty of
|
|
76
|
+
`get`-shaped operations write.
|
|
77
|
+
|
|
78
|
+
### Columns are the filter surface; `details` is render-only
|
|
79
|
+
|
|
80
|
+
There is more than one producer — this API writes them, and the IDP will too, with
|
|
81
|
+
`service: 'idp'`, once `@stackone/audit` is retired. So **anything a caller might filter or group by
|
|
82
|
+
has to be a column**: with several producers you cannot rely on a key being present in the blob.
|
|
83
|
+
|
|
84
|
+
What happened is `resource` + `action` (`account` + `create`), with `eventType` carrying the pair as
|
|
85
|
+
one string (`account_create`) and `resourceId` naming the thing acted on — the question an audit
|
|
86
|
+
trail exists to answer. `statusCode` is nullable, because not every IDP event is an HTTP request,
|
|
87
|
+
and so is `organizationId`, because not every IDP event has an organization. A platform event
|
|
88
|
+
records an operation on the **project**, so there is deliberately no `accountSecureId`.
|
|
89
|
+
|
|
90
|
+
`details` is everything with no column of its own, and it is a ClickHouse `JSON` column: pass an
|
|
91
|
+
object, not a string. A JSON-encoded string does not parse under `JSONEachRow` — the row is
|
|
92
|
+
rejected, the materialized view discards it, and nothing anywhere reports an error. Its shape varies
|
|
93
|
+
per producer, so treat it as display detail rather than a contract; it is not filterable.
|
|
94
|
+
|
|
52
95
|
## Advanced log truncation
|
|
53
96
|
|
|
54
97
|
Advanced logs hold the full request and response of a call. When one is too large to store, what the
|