@cosmicdrift/kumiko-types 0.274.0 → 0.276.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/package.json +1 -1
- package/src/config.ts +3 -1
- package/src/feature.ts +2 -0
- package/src/fields.ts +18 -0
- package/src/handlers.ts +7 -4
- package/src/screen.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.276.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/config.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { ConcurrencyMode } from "./concurrency-mode";
|
|
|
3
3
|
import type { ConfigScope } from "./config-scope";
|
|
4
4
|
import type { DbConnection } from "./db-connection";
|
|
5
5
|
import type { FieldDefinition } from "./fields";
|
|
6
|
-
import type { JobContext } from "./handlers";
|
|
6
|
+
import type { EscapeHatchDeclaration, JobContext } from "./handlers";
|
|
7
7
|
import type {
|
|
8
8
|
PostDeleteHookFn,
|
|
9
9
|
PostSaveHookFn,
|
|
@@ -392,6 +392,8 @@ export type JobDefinition = {
|
|
|
392
392
|
// don't justify a separate worker container — long/CPU-heavy jobs on the
|
|
393
393
|
// API lane will starve request handlers.
|
|
394
394
|
readonly runIn?: JobRunIn | undefined;
|
|
395
|
+
// Grants `ctx.db.unsafeRaw(reason)` for this job, audited as `unsafe-raw`.
|
|
396
|
+
readonly escapeHatch?: EscapeHatchDeclaration | undefined;
|
|
395
397
|
};
|
|
396
398
|
|
|
397
399
|
// --- Notifications ---
|
package/src/feature.ts
CHANGED
|
@@ -382,6 +382,8 @@ export type FeatureDefinition = {
|
|
|
382
382
|
// rendering. Absence means the feature reads no env-vars (or hasn't
|
|
383
383
|
// been migrated yet — Sprint-9 migration is add-only per phase).
|
|
384
384
|
readonly envSchema?: z.ZodObject<z.ZodRawShape>;
|
|
385
|
+
// Factory guarantee: two instances with shallow-equal dedupeOptions are interchangeable.
|
|
386
|
+
readonly dedupeOptions?: Readonly<Record<string, unknown>>;
|
|
385
387
|
};
|
|
386
388
|
|
|
387
389
|
// --- Feature Registrar (the "r" object in defineFeature) ---
|
package/src/fields.ts
CHANGED
|
@@ -445,6 +445,19 @@ export type DecimalFieldDef = {
|
|
|
445
445
|
readonly access?: FieldAccess;
|
|
446
446
|
} & ResolvedPiiFlags;
|
|
447
447
|
|
|
448
|
+
/** Where a money field's currency comes from, for the fields that opt in.
|
|
449
|
+
* Discriminated union so #2839 can add `{ kind: "literal", code }` and
|
|
450
|
+
* `{ kind: "field", of }` variants without a breaking change. `"tenant"` is
|
|
451
|
+
* the tenant-settings bundle's per-tenant currency (`tenant-settings:config:
|
|
452
|
+
* currency`) — see kumiko-framework#2933. */
|
|
453
|
+
export type MoneyCurrencySource = { readonly kind: "tenant" };
|
|
454
|
+
|
|
455
|
+
/** Qualified config key a `{ kind: "tenant" }` MoneyCurrencySource resolves
|
|
456
|
+
* against — the tenant-settings bundle's per-tenant currency. Lives here
|
|
457
|
+
* (client-safe) rather than framework/engine so renderer code can read it
|
|
458
|
+
* without a runtime-only import (kumiko-framework#2937). */
|
|
459
|
+
export const TENANT_CURRENCY_CONFIG_KEY = "tenant-settings:config:currency";
|
|
460
|
+
|
|
448
461
|
export type MoneyFieldDef = {
|
|
449
462
|
readonly type: "money";
|
|
450
463
|
readonly description?: string;
|
|
@@ -453,6 +466,11 @@ export type MoneyFieldDef = {
|
|
|
453
466
|
readonly filterable?: boolean;
|
|
454
467
|
readonly sensitive?: boolean;
|
|
455
468
|
readonly access?: FieldAccess;
|
|
469
|
+
/** Declares where this field's currency comes from for a currently-empty
|
|
470
|
+
* value in an entityEdit form. Undefined = unchanged existing behaviour
|
|
471
|
+
* (`entity.defaultCurrency ?? "EUR"`); a stored value always keeps its
|
|
472
|
+
* own currency regardless of this declaration. */
|
|
473
|
+
readonly currency?: MoneyCurrencySource;
|
|
456
474
|
};
|
|
457
475
|
|
|
458
476
|
// Reference-Field (Tier 2.7e-3) — FK-Style Verweis auf eine andere
|
package/src/handlers.ts
CHANGED
|
@@ -707,11 +707,14 @@ export type HandlerContext<TMap extends object = KumikoEventTypeMap> = SharedCon
|
|
|
707
707
|
//
|
|
708
708
|
// The passed identity also decides the target tenant — `writeAs` hands
|
|
709
709
|
// `user.tenantId` straight to the dispatcher with nothing cross-checking it
|
|
710
|
-
// against the job's own tenant, exactly as `queryAs`
|
|
711
|
-
//
|
|
712
|
-
//
|
|
710
|
+
// against the job's own tenant, exactly as `queryAs` does. Building an
|
|
711
|
+
// identity from job payload data is therefore a cross-tenant write path;
|
|
712
|
+
// derive it from a trusted lookup instead.
|
|
713
713
|
export type JobContext = SharedContextFields & {
|
|
714
|
-
|
|
714
|
+
// Tenant-filtered to the job's own tenant. Cross-tenant raw access needs
|
|
715
|
+
// `escapeHatch` on the job (`ctx.db.unsafeRaw(reason)`) or `r.systemScope()`
|
|
716
|
+
// (`ctx.systemDb`).
|
|
717
|
+
readonly db: TenantDb;
|
|
715
718
|
readonly registry: Registry;
|
|
716
719
|
readonly systemUser: SessionUser;
|
|
717
720
|
readonly log: Logger;
|
package/src/screen.ts
CHANGED
|
@@ -1474,6 +1474,8 @@ export type SecretsEditScreenDefinition = {
|
|
|
1474
1474
|
|
|
1475
1475
|
export type ScreenSlots = {
|
|
1476
1476
|
readonly header?: PlatformComponent;
|
|
1477
|
+
/** entityEdit / actionForm: rendered on the right of the form title, same row. */
|
|
1478
|
+
readonly titleAction?: PlatformComponent;
|
|
1477
1479
|
readonly beforeForm?: PlatformComponent;
|
|
1478
1480
|
readonly afterForm?: PlatformComponent;
|
|
1479
1481
|
readonly sidebar?: PlatformComponent;
|