@cosmicdrift/kumiko-bundled-features 0.306.0 → 0.308.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 +9 -9
- package/src/__tests__/access-invalidation-consumer.integration.test.ts +107 -0
- package/src/__tests__/access-invalidation-stream.integration.test.ts +1 -1
- package/src/__tests__/credential-scoped-sse-revoke.integration.test.ts +296 -0
- package/src/agent-tools/__tests__/agent-doc-lint.test.ts +1 -1
- package/src/agent-tools/__tests__/agent-manifest.test.ts +1 -1
- package/src/agent-tools/__tests__/agent-optout.test.ts +1 -1
- package/src/agent-tools/__tests__/agent-tools.integration.test.ts +1 -1
- package/src/agent-tools/__tests__/feature.test.ts +1 -1
- package/src/agent-tools/__tests__/tool-catalog.test.ts +1 -1
- package/src/agent-tools/agent-manifest.ts +1 -1
- package/src/audit/__tests__/escape-hatch-audit.integration.test.ts +1 -1
- package/src/audit/escape-hatch-audit-sink.ts +1 -1
- package/src/audit/handlers/details.query.ts +1 -1
- package/src/audit/handlers/list.query.ts +1 -1
- package/src/auth-email-password/__tests__/query-as-member.integration.test.ts +1 -1
- package/src/auth-email-password/changes.json +5 -0
- package/src/auth-email-password/feature.ts +1 -1
- package/src/auth-email-password/handlers/change-password.write.ts +1 -1
- package/src/auth-email-password/handlers/confirm-account-unlock.write.ts +1 -1
- package/src/auth-email-password/handlers/invite-accept-with-login.write.ts +1 -1
- package/src/auth-email-password/handlers/invite-accept.write.ts +1 -1
- package/src/auth-email-password/handlers/invite-create.write.ts +1 -1
- package/src/auth-email-password/handlers/invite-signup-complete.write.ts +2 -2
- package/src/auth-email-password/handlers/login.write.ts +1 -1
- package/src/auth-email-password/handlers/logout.write.ts +1 -1
- package/src/auth-email-password/handlers/reset-password.write.ts +1 -1
- package/src/auth-email-password/handlers/self-registration-status.query.ts +1 -1
- package/src/auth-email-password/handlers/signup-confirm.write.ts +2 -2
- package/src/auth-email-password/handlers/signup-request.write.ts +1 -1
- package/src/auth-email-password/handlers/token-request-handler.ts +1 -1
- package/src/auth-email-password/handlers/verify-email.write.ts +1 -1
- package/src/auth-email-password/password-policy.ts +1 -1
- package/src/auth-mfa/__tests__/session-scoped-sse-revoke.integration.test.ts +270 -0
- package/src/auth-mfa/handlers/disable.write.ts +1 -1
- package/src/auth-mfa/handlers/enable-confirm-preauth.write.ts +2 -2
- package/src/auth-mfa/handlers/enable-confirm.write.ts +1 -1
- package/src/auth-mfa/handlers/enable-start-preauth.write.ts +1 -1
- package/src/auth-mfa/handlers/enable-start.write.ts +1 -1
- package/src/auth-mfa/handlers/regenerate-recovery.write.ts +1 -1
- package/src/auth-mfa/handlers/status.query.ts +1 -1
- package/src/auth-mfa/handlers/verify.write.ts +2 -2
- package/src/billing-foundation/billing-info-query.ts +1 -1
- package/src/billing-foundation/events.ts +1 -1
- package/src/billing-foundation/handlers/create-checkout-session.write.ts +1 -1
- package/src/billing-foundation/handlers/create-portal-session.write.ts +1 -1
- package/src/billing-foundation/handlers/list-subscriptions.query.ts +1 -1
- package/src/billing-foundation/handlers/process-event.write.ts +1 -1
- package/src/billing-foundation/handlers/process-payment-event.write.ts +1 -1
- package/src/cap-counter/__tests__/cap-counter.integration.test.ts +1 -1
- package/src/cap-counter/__tests__/enforce-cap.test.ts +7 -0
- package/src/cap-counter/__tests__/stock-cap-guard.integration.test.ts +1 -1
- package/src/cap-counter/__tests__/with-cap-enforcement.integration.test.ts +1 -1
- package/src/cap-counter/book-cap-usage.ts +1 -1
- package/src/cap-counter/changes.json +5 -0
- package/src/cap-counter/enforce-cap.ts +8 -1
- package/src/cap-counter/handlers/get-counter.query.ts +1 -1
- package/src/cap-counter/handlers/increment-rolling.write.ts +1 -1
- package/src/cap-counter/handlers/increment.write.ts +1 -1
- package/src/cap-counter/handlers/mark-soft-warned.write.ts +1 -1
- package/src/cap-overview/handlers/caps-usage.query.ts +1 -1
- package/src/cap-overview/handlers/tenant-caps-list.query.ts +1 -1
- package/src/cap-overview/handlers/tenant-options.query.ts +1 -1
- package/src/channel-in-app/handlers/inbox.query.ts +1 -1
- package/src/channel-in-app/handlers/mark-all-read.write.ts +1 -1
- package/src/channel-in-app/handlers/mark-read.write.ts +1 -1
- package/src/channel-in-app/handlers/unread-count.query.ts +1 -1
- package/src/compliance-profiles/handlers/for-tenant.query.ts +1 -1
- package/src/compliance-profiles/handlers/list-profiles.query.ts +1 -1
- package/src/compliance-profiles/handlers/needs-profile.query.ts +1 -1
- package/src/compliance-profiles/handlers/set-profile.write.ts +1 -1
- package/src/compliance-profiles/handlers/sub-processors.query.ts +1 -1
- package/src/compliance-profiles-ops/handlers/tenants-missing-profile.query.ts +1 -1
- package/src/config/__tests__/backing-secrets.integration.test.ts +1 -1
- package/src/config/__tests__/config.integration.test.ts +1 -1
- package/src/config/__tests__/tz-resolution.integration.test.ts +1 -1
- package/src/config/handlers/cascade.query.ts +1 -1
- package/src/config/handlers/readiness.query.ts +1 -1
- package/src/config/handlers/reset.write.ts +1 -1
- package/src/config/handlers/schema.query.ts +1 -1
- package/src/config/handlers/set.write.ts +1 -1
- package/src/config/handlers/values.query.ts +1 -1
- package/src/crypto-shredding/handlers/forget-subject.write.ts +1 -1
- package/src/custom-fields/__tests__/audit-integration.integration.test.ts +1 -1
- package/src/custom-fields/__tests__/cross-tenant-field-delete.integration.test.ts +1 -1
- package/src/custom-fields/__tests__/cross-tenant-set-write.integration.test.ts +1 -1
- package/src/custom-fields/__tests__/custom-fields.integration.test.ts +1 -1
- package/src/custom-fields/__tests__/field-access.integration.test.ts +1 -1
- package/src/custom-fields/__tests__/quota.integration.test.ts +1 -1
- package/src/custom-fields/__tests__/retention.integration.test.ts +1 -1
- package/src/custom-fields/__tests__/user-data-rights.integration.test.ts +1 -1
- package/src/custom-fields/events.ts +1 -1
- package/src/custom-fields/feature.ts +1 -1
- package/src/custom-fields/handlers/clear-custom-field.write.ts +1 -1
- package/src/custom-fields/handlers/set-custom-field.write.ts +1 -1
- package/src/custom-fields/lib/value-schema.ts +1 -1
- package/src/custom-fields/schemas.ts +1 -1
- package/src/data-retention/handlers/policy-for.query.ts +1 -1
- package/src/data-retention/override-schema.ts +1 -1
- package/src/delivery/__tests__/delivery-pii-kms.integration.test.ts +1 -1
- package/src/delivery/__tests__/delivery.integration.test.ts +1 -1
- package/src/delivery/events.ts +1 -1
- package/src/delivery/feature.ts +1 -1
- package/src/delivery/handlers/log.query.ts +1 -1
- package/src/delivery/handlers/preferences.query.ts +1 -1
- package/src/delivery/handlers/set-preference.write.ts +1 -1
- package/src/delivery/jobs.ts +1 -1
- package/src/delivery/unsubscribe.ts +1 -1
- package/src/derivatives-sharp/__tests__/derivatives-sharp.integration.test.ts +1 -1
- package/src/document-ingest-foundation/events.ts +1 -1
- package/src/document-ingest-foundation/feature.ts +1 -1
- package/src/feature-toggles/__tests__/feature-toggles.integration.test.ts +1 -1
- package/src/feature-toggles/events.ts +1 -1
- package/src/feature-toggles/handlers/list.query.ts +1 -1
- package/src/feature-toggles/handlers/registered.query.ts +1 -1
- package/src/feature-toggles/handlers/set.write.ts +1 -1
- package/src/file-derivatives/handlers/public-variant.query.ts +1 -1
- package/src/file-foundation/__tests__/file-foundation.integration.test.ts +1 -1
- package/src/files-tenant-data/handlers/sweep-orphaned-derivatives.job.ts +1 -1
- package/src/folders/handlers/delete-folder.write.ts +1 -1
- package/src/folders/schemas.ts +1 -1
- package/src/form-draft/schemas.ts +1 -1
- package/src/inbound-mail-foundation/events.ts +1 -1
- package/src/inbound-mail-foundation/handlers/connect-account.write.ts +1 -1
- package/src/inbound-mail-foundation/handlers/disconnect-account.write.ts +1 -1
- package/src/inbound-mail-foundation/handlers/ingest-message.write.ts +1 -1
- package/src/inbound-mail-foundation/handlers/list-accounts.query.ts +1 -1
- package/src/inbound-mail-foundation/handlers/list-messages.query.ts +1 -1
- package/src/inbound-mail-foundation/handlers/update-account.write.ts +1 -1
- package/src/inbound-provider-imap/credential-document.ts +1 -1
- package/src/jobs/__tests__/jobs-catalog.integration.test.ts +1 -1
- package/src/jobs/__tests__/tenant-job-failures.integration.test.ts +1 -1
- package/src/jobs/events.ts +1 -1
- package/src/jobs/handlers/catalog.query.ts +1 -1
- package/src/jobs/handlers/detail.query.ts +1 -1
- package/src/jobs/handlers/list.query.ts +1 -1
- package/src/jobs/handlers/projection-rebuild.job.ts +1 -1
- package/src/jobs/handlers/reindex-entity.job.ts +1 -1
- package/src/jobs/handlers/retry.write.ts +1 -1
- package/src/jobs/handlers/tenant-failures.query.ts +1 -1
- package/src/jobs/handlers/trigger.write.ts +1 -1
- package/src/ledger/handlers/reports.query.ts +1 -1
- package/src/ledger/schemas.ts +1 -1
- package/src/mail-foundation/__tests__/mail-foundation.integration.test.ts +1 -1
- package/src/managed-pages/handlers/branding.query.ts +1 -1
- package/src/managed-pages/handlers/by-slug.query.ts +1 -1
- package/src/managed-pages/handlers/by-tenant-published.query.ts +1 -1
- package/src/managed-pages/handlers/set.write.ts +1 -1
- package/src/notes-history/changes.json +7 -0
- package/src/notes-history/schemas.ts +1 -1
- package/src/notes-history/web/notes-section.tsx +37 -36
- package/src/personal-access-tokens/feature.ts +10 -0
- package/src/personal-access-tokens/handlers/available-scopes.query.ts +1 -1
- package/src/personal-access-tokens/handlers/create.write.ts +1 -1
- package/src/personal-access-tokens/handlers/list.query.ts +1 -1
- package/src/personal-access-tokens/handlers/revoke.write.ts +18 -2
- package/src/personal-access-tokens/index.ts +7 -0
- package/src/personal-access-tokens/pat-revoked-event.ts +23 -0
- package/src/personal-access-tokens/revoke-for-user.ts +31 -0
- package/src/rate-limiting/__tests__/rate-limiting.integration.test.ts +1 -1
- package/src/rate-limiting/handlers/status.query.ts +1 -1
- package/src/readiness/handlers/status.query.ts +1 -1
- package/src/secrets/feature.ts +1 -1
- package/src/secrets/handlers/delete.write.ts +1 -1
- package/src/secrets/handlers/list.query.ts +1 -1
- package/src/secrets/handlers/set.write.ts +1 -1
- package/src/secrets/secrets-context.ts +1 -1
- package/src/seo/handlers/seo-config.query.ts +1 -1
- package/src/sessions/handlers/detail.query.ts +1 -1
- package/src/sessions/handlers/list.query.ts +1 -1
- package/src/sessions/handlers/mine.query.ts +1 -1
- package/src/sessions/handlers/revoke-all-for-user.write.ts +1 -1
- package/src/sessions/handlers/revoke-all-others.write.ts +2 -1
- package/src/sessions/handlers/revoke.write.ts +1 -1
- package/src/sessions/session-callbacks.ts +26 -1
- package/src/sessions/session-revoked-event.ts +9 -1
- package/src/shared/__tests__/row-bound-grant.integration.test.ts +1 -1
- package/src/step-dispatcher/mail-runner.ts +1 -1
- package/src/step-dispatcher/webhook-runner.ts +1 -1
- package/src/subscription-mollie/feature.ts +1 -1
- package/src/subscription-stripe/feature.ts +1 -1
- package/src/tags/schemas.ts +1 -1
- package/src/template-resolver/handlers/by-slug.query.ts +1 -1
- package/src/template-resolver/handlers/by-tenant.query.ts +1 -1
- package/src/template-resolver/handlers/collection-item.query.ts +1 -1
- package/src/template-resolver/handlers/collection-list.query.ts +1 -1
- package/src/template-resolver/handlers/collection-set.write.ts +1 -1
- package/src/template-resolver/handlers/find-by-id.query.ts +1 -1
- package/src/template-resolver/handlers/list.query.ts +1 -1
- package/src/template-resolver/handlers/set.write.ts +1 -1
- package/src/template-resolver/handlers/shared.ts +1 -1
- package/src/template-resolver/handlers/toggle-status.write.ts +1 -1
- package/src/template-resolver/handlers/upsert-tenant.write.ts +1 -1
- package/src/tenant/__tests__/tenant-timezone-boot.integration.test.ts +1 -1
- package/src/tenant/handlers/active-tenant-ids.query.ts +1 -1
- package/src/tenant/handlers/add-member.write.ts +1 -1
- package/src/tenant/handlers/cancel-invitation.write.ts +1 -1
- package/src/tenant/handlers/create.write.ts +1 -1
- package/src/tenant/handlers/invitations.query.ts +1 -1
- package/src/tenant/handlers/list.query.ts +1 -1
- package/src/tenant/handlers/me.query.ts +1 -1
- package/src/tenant/handlers/member-directory.query.ts +1 -1
- package/src/tenant/handlers/members.query.ts +1 -1
- package/src/tenant/handlers/memberships.query.ts +1 -1
- package/src/tenant/handlers/remove-member.write.ts +1 -1
- package/src/tenant/handlers/resolve-user-ids.query.ts +1 -1
- package/src/tenant/handlers/team-list.query.ts +1 -1
- package/src/tenant/handlers/tenant-directory.query.ts +1 -1
- package/src/tenant/handlers/toggle-enabled.write.ts +1 -1
- package/src/tenant/handlers/update-member-roles.write.ts +1 -1
- package/src/tenant/handlers/update.write.ts +1 -1
- package/src/tenant-handover/events.ts +1 -1
- package/src/tenant-handover/handlers/claim.write.ts +1 -1
- package/src/tenant-lifecycle/events.ts +1 -1
- package/src/tenant-lifecycle/handlers/cancel-destruction.write.ts +1 -1
- package/src/tenant-lifecycle/handlers/request-destruction.write.ts +1 -1
- package/src/tenant-settings/tenant-defaults.ts +1 -1
- package/src/tier-engine/__tests__/tier-resolver.integration.test.ts +1 -1
- package/src/tier-engine/feature.ts +1 -1
- package/src/tier-engine/handlers/active-tier.query.ts +1 -1
- package/src/tier-engine/handlers/get-tenant-tier.query.ts +1 -1
- package/src/tier-engine/handlers/set-tenant-tier.write.ts +1 -1
- package/src/user/__tests__/user-global-tenancy.integration.test.ts +1 -1
- package/src/user/handlers/create.write.ts +1 -1
- package/src/user/handlers/find-for-auth.query.ts +1 -1
- package/src/user/handlers/me.query.ts +1 -1
- package/src/user/handlers/update.write.ts +1 -1
- package/src/user/roles-input-schema.ts +1 -1
- package/src/user-data-rights/__tests__/boot-checks.test.ts +1 -1
- package/src/user-data-rights/changes.json +6 -0
- package/src/user-data-rights/feature.ts +1 -0
- package/src/user-data-rights/handlers/cancel-deletion.write.ts +1 -1
- package/src/user-data-rights/handlers/confirm-deletion-by-token.write.ts +1 -1
- package/src/user-data-rights/handlers/download-by-job.query.ts +1 -1
- package/src/user-data-rights/handlers/download-by-token.query.ts +1 -1
- package/src/user-data-rights/handlers/export-status.query.ts +1 -1
- package/src/user-data-rights/handlers/lift-restriction.write.ts +1 -1
- package/src/user-data-rights/handlers/list-download-attempts.query.ts +1 -1
- package/src/user-data-rights/handlers/my-audit-log.query.ts +1 -1
- package/src/user-data-rights/handlers/request-deletion-by-email.write.ts +1 -1
- package/src/user-data-rights/handlers/request-deletion.write.ts +1 -1
- package/src/user-data-rights/handlers/request-export.write.ts +1 -1
- package/src/user-data-rights/handlers/restrict-account.write.ts +1 -1
- package/src/user-data-rights/handlers/run-forget-cleanup.write.ts +1 -1
- package/src/user-profile/handlers/change-email.write.ts +1 -1
- package/src/workflow-runner/__tests__/pending-projection.integration.test.ts +1 -1
- package/src/workflow-runner/__tests__/workflow-runner.integration.test.ts +5 -0
- package/src/workflow-runner/handlers/resume-run.write.ts +1 -1
|
@@ -93,6 +93,9 @@ export async function enforceCap(
|
|
|
93
93
|
readonly periodStartIso: string;
|
|
94
94
|
readonly limit: number;
|
|
95
95
|
readonly profile: CapToleranceProfileName;
|
|
96
|
+
// Units the caller is about to book in one go (default 1), checked with
|
|
97
|
+
// the same outcome as booking them one by one.
|
|
98
|
+
readonly amount?: number;
|
|
96
99
|
},
|
|
97
100
|
): Promise<EnforceCapResult> {
|
|
98
101
|
if (!ctx.db) {
|
|
@@ -110,7 +113,9 @@ export async function enforceCap(
|
|
|
110
113
|
);
|
|
111
114
|
|
|
112
115
|
const row = rows[0];
|
|
113
|
-
const
|
|
116
|
+
const storedValue = row ? (row["value"] as number) : 0; // @cast-boundary db-row
|
|
117
|
+
// The last of `amount` units sees this value before its own increment.
|
|
118
|
+
const value = storedValue + (options.amount ?? 1) - 1;
|
|
114
119
|
|
|
115
120
|
if (value >= hardThreshold) {
|
|
116
121
|
throw new CapExceededError(options.capName, options.limit, value, tolerance);
|
|
@@ -285,6 +290,7 @@ export async function enforceCapAndMaybeNotify(
|
|
|
285
290
|
readonly limit: number;
|
|
286
291
|
readonly profile: CapToleranceProfileName;
|
|
287
292
|
readonly notify: SoftHitNotifier;
|
|
293
|
+
readonly amount?: number;
|
|
288
294
|
},
|
|
289
295
|
): Promise<EnforceCapResult> {
|
|
290
296
|
const result = await enforceCap(ctx, {
|
|
@@ -292,6 +298,7 @@ export async function enforceCapAndMaybeNotify(
|
|
|
292
298
|
periodStartIso: options.periodStartIso,
|
|
293
299
|
limit: options.limit,
|
|
294
300
|
profile: options.profile,
|
|
301
|
+
...(options.amount !== undefined && { amount: options.amount }),
|
|
295
302
|
});
|
|
296
303
|
|
|
297
304
|
if (result.state === "soft-hit" && result.crossed) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createEntityExecutor, type QueryHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
import { capCounterEntity } from "../entity";
|
|
4
4
|
|
|
5
5
|
const { table } = createEntityExecutor("cap-counter", capCounterEntity);
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// N Tage aus diesem Stream.
|
|
20
20
|
|
|
21
21
|
import type { WriteHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
22
|
-
import
|
|
22
|
+
import * as z from "zod";
|
|
23
23
|
import { rollingCapAggregateId } from "../aggregate-id";
|
|
24
24
|
import { CAP_COUNTER_ROLLING_AGGREGATE_TYPE, ROLLING_INCREMENTED_EVENT_QN } from "../constants";
|
|
25
25
|
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
type QueryHandlerDefinition,
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
8
8
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
9
|
-
import
|
|
9
|
+
import * as z from "zod";
|
|
10
10
|
import { tierAssignmentEntity } from "../../tier-engine";
|
|
11
11
|
import { MY_CAPS_ACCESS_ROLES } from "../access";
|
|
12
12
|
import type { CapSpec, CapUsageWithMeta } from "../types";
|
|
@@ -2,7 +2,7 @@ import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
|
2
2
|
import { buildEntityTable, decodeCursor, encodeCursor } from "@cosmicdrift/kumiko-framework/db";
|
|
3
3
|
import { definePagedQueryHandler, MAX_LIST_LIMIT } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
4
|
import { InternalError, ValidationError } from "@cosmicdrift/kumiko-framework/errors";
|
|
5
|
-
import
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
import { subscriptionsProjectionTable } from "../../billing-foundation";
|
|
7
7
|
import { tenantTable } from "../../tenant";
|
|
8
8
|
import { tierAssignmentEntity } from "../../tier-engine";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
|
-
import
|
|
4
|
+
import * as z from "zod";
|
|
5
5
|
import { tenantTable } from "../../tenant";
|
|
6
6
|
|
|
7
7
|
type TenantRow = { readonly id: string; readonly name: string };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import { inAppMessagesTable } from "../tables";
|
|
5
5
|
|
|
6
6
|
export const inboxQuery = defineQueryHandler({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { updateMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import { inAppMessagesTable } from "../tables";
|
|
5
5
|
|
|
6
6
|
export const markAllReadWrite = defineWriteHandler({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { updateMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { NotFoundError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
|
-
import
|
|
4
|
+
import * as z from "zod";
|
|
5
5
|
import { inAppMessagesTable } from "../tables";
|
|
6
6
|
|
|
7
7
|
export const markReadWrite = defineWriteHandler({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import { inAppMessagesTable } from "../tables";
|
|
5
5
|
|
|
6
6
|
export const unreadCountQuery = defineQueryHandler({
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
resolveComplianceProfile,
|
|
6
6
|
} from "@cosmicdrift/kumiko-framework/compliance";
|
|
7
7
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
8
|
-
import
|
|
8
|
+
import * as z from "zod";
|
|
9
9
|
import { parseComplianceProfileOverride } from "../_internal/parse-override";
|
|
10
10
|
import { tenantComplianceProfileTable } from "../schema/profile-selection";
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
SELECTABLE_PROFILE_KEYS,
|
|
6
6
|
} from "@cosmicdrift/kumiko-framework/compliance";
|
|
7
7
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
8
|
-
import
|
|
8
|
+
import * as z from "zod";
|
|
9
9
|
|
|
10
10
|
// Liefert alle waehlbaren Compliance-Profile fuer das Tenant-Onboarding.
|
|
11
11
|
// Pure In-Memory-Read der Constants — keine DB-Abfrage. Kein Caching
|
|
@@ -2,7 +2,7 @@ import { ROLES } from "@cosmicdrift/kumiko-framework/auth";
|
|
|
2
2
|
import { fetchOne } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
3
3
|
import type { ComplianceProfileKey } from "@cosmicdrift/kumiko-framework/compliance";
|
|
4
4
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
5
|
-
import
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
import { tenantComplianceProfileTable } from "../schema/profile-selection";
|
|
7
7
|
|
|
8
8
|
// Onboarding banner trigger for tenant admin.
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "@cosmicdrift/kumiko-framework/compliance";
|
|
7
7
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
8
8
|
import { getTemporal } from "@cosmicdrift/kumiko-framework/time";
|
|
9
|
-
import
|
|
9
|
+
import * as z from "zod";
|
|
10
10
|
|
|
11
11
|
// Public Sub-Processor-Liste — anonymous accessible (Memory:
|
|
12
12
|
// project_anonymous_access). Matched die DSGVO Art. 28(2) Pflicht
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ROLES } from "@cosmicdrift/kumiko-framework/auth";
|
|
2
2
|
import { defineQueryHandler, type TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
|
-
import
|
|
4
|
+
import * as z from "zod";
|
|
5
5
|
import { tenantComplianceProfileTable } from "../../compliance-profiles";
|
|
6
6
|
import { tenantTable } from "../../tenant";
|
|
7
7
|
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
TestUsers,
|
|
15
15
|
unsafePushTables,
|
|
16
16
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
17
|
-
import
|
|
17
|
+
import * as z from "zod";
|
|
18
18
|
import { createSecretsContext } from "../../secrets/secrets-context";
|
|
19
19
|
import { tenantSecretsTable } from "../../secrets/table";
|
|
20
20
|
import { ConfigHandlers, ConfigQueries } from "../constants";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
createTestEnvelopeCipher,
|
|
25
25
|
expectErrorIncludes,
|
|
26
26
|
} from "@cosmicdrift/kumiko-framework/testing";
|
|
27
|
-
import
|
|
27
|
+
import * as z from "zod";
|
|
28
28
|
import { ConfigHandlers, ConfigQueries } from "../constants";
|
|
29
29
|
import { createConfigAccessor, createConfigAccessorFactory, createConfigFeature } from "../feature";
|
|
30
30
|
import { type ConfigResolver, createConfigResolver, validateAppOverrides } from "../resolver";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type TestStack,
|
|
12
12
|
unsafePushTables,
|
|
13
13
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
14
|
-
import
|
|
14
|
+
import * as z from "zod";
|
|
15
15
|
import { createConfigAccessorFactory, createConfigFeature } from "../feature";
|
|
16
16
|
import { createConfigResolver } from "../resolver";
|
|
17
17
|
import { configValuesTable } from "../table";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
defineQueryHandler,
|
|
5
5
|
isEncryptedAtRest,
|
|
6
6
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
7
|
-
import
|
|
7
|
+
import * as z from "zod";
|
|
8
8
|
import { requireConfigResolver, requireSystemDb } from "../feature";
|
|
9
9
|
import { MASKED, redactInheritedCascade, shouldRedactInherited } from "../read-redaction";
|
|
10
10
|
import { hasConfigAccess } from "../write-helpers";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
type SessionUser,
|
|
8
8
|
toKebab,
|
|
9
9
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
10
|
-
import
|
|
10
|
+
import * as z from "zod";
|
|
11
11
|
import { requireConfigResolver, requireSystemDb } from "../feature";
|
|
12
12
|
import { hasConfigAccess } from "../write-helpers";
|
|
13
13
|
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
SYSTEM_TENANT_ID,
|
|
6
6
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
7
7
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
8
|
-
import
|
|
8
|
+
import * as z from "zod";
|
|
9
9
|
import { requireSystemDb } from "../feature";
|
|
10
10
|
import { configValueEntity, configValuesTable } from "../table";
|
|
11
11
|
import { findConfigRow, prepareConfigWrite } from "../write-helpers";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
UnprocessableError,
|
|
16
16
|
writeFailure,
|
|
17
17
|
} from "@cosmicdrift/kumiko-framework/errors";
|
|
18
|
-
import
|
|
18
|
+
import * as z from "zod";
|
|
19
19
|
import { requireConfigEncryption, requireSystemDb } from "../feature";
|
|
20
20
|
import { configValueEntity, configValuesTable } from "../table";
|
|
21
21
|
import {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
defineQueryHandler,
|
|
6
6
|
isEncryptedAtRest,
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
8
|
-
import
|
|
8
|
+
import * as z from "zod";
|
|
9
9
|
import { requireConfigResolver, requireSystemDb } from "../feature";
|
|
10
10
|
import { MASKED, redactInheritedCascade, shouldRedactInherited } from "../read-redaction";
|
|
11
11
|
import { hasConfigAccess } from "../write-helpers";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
import { append } from "@cosmicdrift/kumiko-framework/event-store";
|
|
31
31
|
import { purgeSearchDocumentsForSubject } from "@cosmicdrift/kumiko-framework/search";
|
|
32
32
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
33
|
-
import
|
|
33
|
+
import * as z from "zod";
|
|
34
34
|
import { revokeAllPatTokensForUser } from "../../personal-access-tokens";
|
|
35
35
|
import { USER_STATUS } from "../../user";
|
|
36
36
|
import {
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
TestUsers,
|
|
28
28
|
unsafeCreateEntityTable,
|
|
29
29
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
30
|
-
import
|
|
30
|
+
import * as z from "zod";
|
|
31
31
|
import { AuditQueries } from "../../audit/constants";
|
|
32
32
|
import { createAuditFeature } from "../../audit/feature";
|
|
33
33
|
import { createConfigFeature } from "../../config";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
testUserId,
|
|
29
29
|
unsafeCreateEntityTable,
|
|
30
30
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
31
|
-
import
|
|
31
|
+
import * as z from "zod";
|
|
32
32
|
import { fieldDefinitionEntity } from "../entity";
|
|
33
33
|
import { createCustomFieldsFeature } from "../feature";
|
|
34
34
|
import { customFieldsField, wireCustomFieldsFor } from "../wire-for-entity";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
testUserId,
|
|
25
25
|
unsafeCreateEntityTable,
|
|
26
26
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
27
|
-
import
|
|
27
|
+
import * as z from "zod";
|
|
28
28
|
import { fieldDefinitionEntity } from "../entity";
|
|
29
29
|
import { createCustomFieldsFeature } from "../feature";
|
|
30
30
|
import { customFieldsField, wireCustomFieldsFor } from "../wire-for-entity";
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
type TestStack,
|
|
32
32
|
unsafeCreateEntityTable,
|
|
33
33
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
34
|
-
import
|
|
34
|
+
import * as z from "zod";
|
|
35
35
|
import { fieldDefinitionEntity } from "../entity";
|
|
36
36
|
import { createCustomFieldsFeature } from "../feature";
|
|
37
37
|
import { customFieldsField, wireCustomFieldsFor } from "../wire-for-entity";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
type TestStack,
|
|
26
26
|
unsafeCreateEntityTable,
|
|
27
27
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
28
|
-
import
|
|
28
|
+
import * as z from "zod";
|
|
29
29
|
import { fieldDefinitionEntity } from "../entity";
|
|
30
30
|
import { createCustomFieldsFeature } from "../feature";
|
|
31
31
|
import { customFieldsField, wireCustomFieldsFor } from "../wire-for-entity";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
type TestStack,
|
|
22
22
|
unsafeCreateEntityTable,
|
|
23
23
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
24
|
-
import
|
|
24
|
+
import * as z from "zod";
|
|
25
25
|
import { fieldDefinitionEntity } from "../entity";
|
|
26
26
|
import { createCustomFieldsFeature } from "../feature";
|
|
27
27
|
import { customFieldsField, wireCustomFieldsFor } from "../wire-for-entity";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
unsafeCreateEntityTable,
|
|
27
27
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
28
28
|
import { getTemporal } from "@cosmicdrift/kumiko-framework/time";
|
|
29
|
-
import
|
|
29
|
+
import * as z from "zod";
|
|
30
30
|
import { applyRetentionRemovals, selectHostRowsWithCustomFields } from "../db/queries/retention";
|
|
31
31
|
import { fieldDefinitionEntity } from "../entity";
|
|
32
32
|
import { createCustomFieldsFeature } from "../feature";
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
41
41
|
import { seedRow } from "@cosmicdrift/kumiko-framework/testing";
|
|
42
42
|
import { getTemporal } from "@cosmicdrift/kumiko-framework/time";
|
|
43
|
-
import
|
|
43
|
+
import * as z from "zod";
|
|
44
44
|
import { createComplianceProfilesFeature } from "../../compliance-profiles";
|
|
45
45
|
import { createDataRetentionFeature, tenantRetentionOverrideEntity } from "../../data-retention";
|
|
46
46
|
import { tenantRetentionOverrideTable } from "../../data-retention/schema/tenant-retention-override";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WriteHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { failNotFound, failUnprocessable } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import { DEFAULT_VALUE_WRITE_ROLES } from "../constants";
|
|
5
5
|
import { customFieldsFeature } from "../feature";
|
|
6
6
|
import { checkFieldAccessForWrite } from "../lib/field-access";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WriteHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { failNotFound, failUnprocessable } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import { DEFAULT_VALUE_WRITE_ROLES } from "../constants";
|
|
5
5
|
import { customFieldsFeature } from "../feature";
|
|
6
6
|
import { fieldWriteAccessDeniedRoles, loadFieldDefinition } from "../lib/field-access";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
type FieldDefinition,
|
|
4
4
|
fieldToZod,
|
|
5
5
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
6
|
-
import type
|
|
6
|
+
import type * as z from "zod";
|
|
7
7
|
import { SUPPORTED_FIELD_TYPES } from "../constants";
|
|
8
8
|
|
|
9
9
|
// Builds a Zod schema that validates a custom-field VALUE against its
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fetchOne } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import { parseRetentionOverrideOrNull } from "../_internal/parse-override";
|
|
5
5
|
import { type EffectiveRetentionPolicy, resolveRetentionPolicy } from "../resolver";
|
|
6
6
|
import { tenantRetentionOverrideTable } from "../schema/tenant-retention-override";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
unsafePushTables,
|
|
29
29
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
30
30
|
import { resetPiiSubjectKmsForTests } from "@cosmicdrift/kumiko-framework/testing";
|
|
31
|
-
import
|
|
31
|
+
import * as z from "zod";
|
|
32
32
|
import { createChannelEmailFeature } from "../../channel-email/feature";
|
|
33
33
|
import { createInMemoryTransport } from "../../channel-email/types";
|
|
34
34
|
import { createConfigFeature } from "../../config/feature";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
testTenantId,
|
|
27
27
|
unsafePushTables,
|
|
28
28
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
29
|
-
import
|
|
29
|
+
import * as z from "zod";
|
|
30
30
|
import { createChannelEmailFeature } from "../../channel-email/feature";
|
|
31
31
|
import { createInMemoryTransport, type EmailMessage } from "../../channel-email/types";
|
|
32
32
|
import { InAppHandlers, InAppQueries } from "../../channel-in-app/constants";
|
package/src/delivery/events.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// delivery-service.ts (validates payloads before the low-level append()
|
|
4
4
|
// — out-of-dispatcher writes otherwise skip schema enforcement).
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import * as z from "zod";
|
|
7
7
|
import { DeliveryStatus } from "./constants";
|
|
8
8
|
|
|
9
9
|
export const deliveryAttemptSchema = z.object({
|
package/src/delivery/feature.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
9
9
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
10
10
|
import { Temporal } from "temporal-polyfill";
|
|
11
|
-
import
|
|
11
|
+
import * as z from "zod";
|
|
12
12
|
import { decryptStoredPii } from "../../shared";
|
|
13
13
|
import type { DeliveryStatusValue } from "../constants";
|
|
14
14
|
import { deliveryAttemptsTable } from "../tables";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
|
-
import
|
|
4
|
+
import * as z from "zod";
|
|
5
5
|
import { notificationPreferencesTable } from "../tables";
|
|
6
6
|
|
|
7
7
|
export const preferencesQuery = defineQueryHandler({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import { upsertPreference } from "../upsert-preference";
|
|
5
5
|
|
|
6
6
|
export const setPreferenceWrite = defineWriteHandler({
|
package/src/delivery/jobs.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
15
15
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
16
16
|
import type { JobRunner } from "@cosmicdrift/kumiko-framework/jobs";
|
|
17
|
-
import
|
|
17
|
+
import * as z from "zod";
|
|
18
18
|
import { appendAttemptEvent } from "./attempt-log";
|
|
19
19
|
import { buildChannelContext } from "./channel-context";
|
|
20
20
|
import { DeliveryJobs, deliveryPriorityRank } from "./constants";
|
|
@@ -2,7 +2,7 @@ import { createTenantDb, type DbConnection } from "@cosmicdrift/kumiko-framework
|
|
|
2
2
|
import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { Hono } from "hono";
|
|
4
4
|
import * as jose from "jose";
|
|
5
|
-
import
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
import { upsertPreference } from "./upsert-preference";
|
|
7
7
|
|
|
8
8
|
// Shape des verified-JWT-payloads. tenantId kommt als string aus jose und
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
patchFileInstanceofForBunTest,
|
|
19
19
|
} from "@cosmicdrift/kumiko-framework/testing";
|
|
20
20
|
import sharp from "sharp";
|
|
21
|
-
import
|
|
21
|
+
import * as z from "zod";
|
|
22
22
|
import { createConfigFeature } from "../../config";
|
|
23
23
|
import { fileDerivativesFeature } from "../../file-derivatives";
|
|
24
24
|
import { fileFoundationFeature } from "../../file-foundation";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
import { createLateBoundHolder, seedRow, waitFor } from "@cosmicdrift/kumiko-framework/testing";
|
|
30
30
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
31
31
|
import { Temporal } from "temporal-polyfill";
|
|
32
|
-
import
|
|
32
|
+
import * as z from "zod";
|
|
33
33
|
import { createFeatureTogglesFeature } from "../feature";
|
|
34
34
|
import { globalFeatureStateTable } from "../global-feature-state-table";
|
|
35
35
|
import { GlobalFeatureToggleRuntime } from "../toggle-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
import { FEATURE_TOGGLE_CROSS_TENANT_REASON } from "../constants";
|
|
4
4
|
import { globalFeatureStateTable } from "../global-feature-state-table";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineQueryHandler, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
import { FEATURE_TOGGLE_CROSS_TENANT_REASON } from "../constants";
|
|
4
4
|
import { globalFeatureStateTable } from "../global-feature-state-table";
|
|
5
5
|
|