@cosmicdrift/kumiko-types 0.364.0 → 0.365.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/dist/db-connection.d.ts +6 -1
- package/dist/file-handle-types.d.ts +3 -0
- package/dist/handlers.d.ts +5 -1
- package/dist/screen.d.ts +3 -1
- package/dist/screen.js +7 -0
- package/package.json +1 -1
- package/src/changes.json +6 -0
package/dist/db-connection.d.ts
CHANGED
|
@@ -11,4 +11,9 @@ export type DbTx = postgres.TransactionSql<Record<string, unknown>> | RawDbClien
|
|
|
11
11
|
export type DbRunner = DbConnection | DbTx;
|
|
12
12
|
export type DbRow = Record<string, unknown>;
|
|
13
13
|
export type PgClient = ReturnType<typeof postgres>;
|
|
14
|
-
export type
|
|
14
|
+
export type PgListenSubscription = {
|
|
15
|
+
unlisten(): Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
export type PgListenClient = {
|
|
18
|
+
listen(channel: string, onnotify: (payload: string) => void, onlisten?: () => void): Promise<PgListenSubscription>;
|
|
19
|
+
};
|
package/dist/handlers.d.ts
CHANGED
|
@@ -238,6 +238,7 @@ type SharedContextFields = {
|
|
|
238
238
|
readonly notify?: NotifyFn;
|
|
239
239
|
readonly _notifyFactory?: NotifyFactory;
|
|
240
240
|
readonly _notifyInTransactionFactory?: (user: SessionUser, tenantId: TenantId) => NotifyFn;
|
|
241
|
+
readonly _notifyAfterCommitFactory?: (user: SessionUser, tenantId: TenantId) => NotifyFn;
|
|
241
242
|
readonly _escapeHatchAuditSink?: EscapeHatchAuditSink;
|
|
242
243
|
readonly secrets?: import("./secrets-types.js").SecretsContext;
|
|
243
244
|
readonly masterKeyProvider?: import("./secrets-types.js").MasterKeyProvider;
|
|
@@ -355,6 +356,7 @@ export type JobContext = SharedContextFields & {
|
|
|
355
356
|
readonly registry: Registry;
|
|
356
357
|
readonly systemUser: SessionUser;
|
|
357
358
|
readonly log: Logger;
|
|
359
|
+
readonly metricsFor: (featureName: string) => MetricsHandle;
|
|
358
360
|
readonly triggeredBy: {
|
|
359
361
|
readonly id: string;
|
|
360
362
|
readonly tenantId: TenantId;
|
|
@@ -596,7 +598,9 @@ export type WriteHandlerDef = {
|
|
|
596
598
|
/** Runs after all pre-handler gates (and after reserveBeforeTransaction) and before the
|
|
597
599
|
* transaction opens: no transaction and no connection held, for external I/O and reads only.
|
|
598
600
|
* Its `data` reaches the handler as `event.prepared`; a failure result or throw rejects the
|
|
599
|
-
* write before anything is written. A handler with this phase cannot run as a nested ctx.write.
|
|
601
|
+
* write before anything is written. A handler with this phase cannot run as a nested ctx.write.
|
|
602
|
+
* `ctx.forTenant` is available but read-only here: its db denies writes for the own and a
|
|
603
|
+
* foreign tenant alike (a foreign tenant stays gated by the SystemAdmin check). */
|
|
600
604
|
readonly beforeTransaction?: BeforeTransactionPhase;
|
|
601
605
|
/** `"perCommand"`: the handler runs without a transaction of its own. Every ctx.write/writeAs it
|
|
602
606
|
* issues runs as its own top-level command with its own transaction and afterCommit hooks;
|
package/dist/screen.d.ts
CHANGED
|
@@ -723,6 +723,8 @@ export type DashboardPanelEmptyState = {
|
|
|
723
723
|
/** Second line under `emptyLabel`. */
|
|
724
724
|
readonly emptyHint?: string;
|
|
725
725
|
};
|
|
726
|
+
export declare const DASHBOARD_STAT_TONES: readonly ["default", "positive", "ok", "warn", "negative"];
|
|
727
|
+
export type DashboardStatTone = (typeof DASHBOARD_STAT_TONES)[number];
|
|
726
728
|
export type DashboardStatPanel = DashboardPanelQueryOptions & DashboardPanelGate & {
|
|
727
729
|
readonly kind: "stat";
|
|
728
730
|
/** Stable id: kebab-case, unique within the panel set. */
|
|
@@ -736,7 +738,7 @@ export type DashboardStatPanel = DashboardPanelQueryOptions & DashboardPanelGate
|
|
|
736
738
|
/** Formats a numeric value as currency (minor units); ignored for string values. The sparkline is not formatted. */
|
|
737
739
|
readonly valueFormat?: DashboardValueFormat;
|
|
738
740
|
/** Fixed tone when `toneField` is unset or yields none; not applied while the value is 0. */
|
|
739
|
-
readonly tone?:
|
|
741
|
+
readonly tone?: DashboardStatTone;
|
|
740
742
|
/** Record field holding `{ atMs, value | null }[]` (MetricResult.points),
|
|
741
743
|
* drawn as a sparkline next to the value. */
|
|
742
744
|
readonly sparklineField?: string;
|
package/dist/screen.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export function metricField(metric) {
|
|
2
2
|
return typeof metric === "string" ? metric : metric.field;
|
|
3
3
|
}
|
|
4
|
+
// Query result contract: flat record; `valueField` points at the
|
|
5
|
+
// value (string is display-ready, number is locale-formatted, DashboardI18nText
|
|
6
|
+
// is translated), `subField` optionally at a sub line (string | DashboardI18nText), `toneField` optionally at
|
|
7
|
+
// "default" | "positive" | "ok" | "warn" | "negative".
|
|
8
|
+
// `visibleWhen` only on a top-level stat; the boot validator rejects it on a
|
|
9
|
+
// stat-group child (gate the whole group instead).
|
|
10
|
+
export const DASHBOARD_STAT_TONES = ["default", "positive", "ok", "warn", "negative"];
|
|
4
11
|
/** Group key of a field value; `collapsedWhen` and row values both go through it. */
|
|
5
12
|
export function relatedListGroupKey(value) {
|
|
6
13
|
return value === undefined || value === null ? "" : String(value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.365.0",
|
|
4
4
|
"description": "Framework-Type-Definitions für Kumiko — FeatureDefinition, BootCheck-Types und die reinen Engine-Types. Erlaubt Downstream-Konsumenten, gegen die Type-Contracts zu bauen, ohne das ganze Framework-Package zu importieren. Enthaelt keine identitaets-sensitiven Runtime-Werte mehr (Error-Klassen leben seit #1629 in kumiko-framework, Brand-Symbole nutzen Symbol.for) und ist deshalb eine plain dependency, keine peerDependency.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
package/src/changes.json
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.365.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "DASHBOARD_STAT_TONES is the single source for dashboard stat tones",
|
|
6
|
+
"detail": "screen.ts exports DASHBOARD_STAT_TONES and DashboardStatTone; DashboardStatPanel.tone derives from it, and the web renderer builds its runtime tone check and StatTone type from the same constant, so a new tone can no longer be silently dropped from toneField values."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.362.0",
|
|
4
10
|
"type": "improvement",
|