@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { UnprocessableError } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import { RateLimitErrors } from "../constants";
|
|
5
5
|
import { bucketAccessDenied } from "./bucket-access";
|
|
6
6
|
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "@cosmicdrift/kumiko-bundled-features/config";
|
|
5
5
|
import { requireSecretsContext } from "@cosmicdrift/kumiko-bundled-features/secrets";
|
|
6
6
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
7
|
-
import
|
|
7
|
+
import * as z from "zod";
|
|
8
8
|
import { ReadinessQueries } from "../constants";
|
|
9
9
|
|
|
10
10
|
export type ReadinessMissingSecret = { readonly key: string };
|
package/src/secrets/feature.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
8
8
|
import { SETTINGS_HUB_I18N } from "@cosmicdrift/kumiko-framework/i18n";
|
|
9
9
|
import type { SecretsContext } from "@cosmicdrift/kumiko-framework/secrets";
|
|
10
|
-
import
|
|
10
|
+
import * as z from "zod";
|
|
11
11
|
import { DEFAULT_SECRETS_ACCESS } from "./constants";
|
|
12
12
|
import { createDeleteHandler } from "./handlers/delete.write";
|
|
13
13
|
import { createListHandler } from "./handlers/list.query";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AccessRule, defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { failNotFound } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import { DEFAULT_SECRETS_ACCESS } from "../constants";
|
|
5
5
|
import { requireSecretsContext } from "../feature";
|
|
6
6
|
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
withDekCache,
|
|
35
35
|
} from "@cosmicdrift/kumiko-framework/secrets";
|
|
36
36
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
37
|
-
import
|
|
37
|
+
import * as z from "zod";
|
|
38
38
|
import { selectTenantSecretEnvelope } from "./db/queries/read";
|
|
39
39
|
import {
|
|
40
40
|
type StoredEnvelope,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fetchOne } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import { access, defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import { decryptStoredPii } from "../../shared";
|
|
5
5
|
import { userSessionTable } from "../schema/user-session";
|
|
6
6
|
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
definePagedQueryHandler,
|
|
5
5
|
MAX_LIST_LIMIT,
|
|
6
6
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
7
|
-
import
|
|
7
|
+
import * as z from "zod";
|
|
8
8
|
import { decryptStoredPii } from "../../shared";
|
|
9
9
|
import { userSessionTable } from "../schema/user-session";
|
|
10
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import { definePagedQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import { decryptStoredPii } from "../../shared";
|
|
5
5
|
import { userSessionTable } from "../schema/user-session";
|
|
6
6
|
|
|
@@ -5,7 +5,7 @@ import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/
|
|
|
5
5
|
import { append } from "@cosmicdrift/kumiko-framework/event-store";
|
|
6
6
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
7
7
|
import { Temporal } from "temporal-polyfill";
|
|
8
|
-
import
|
|
8
|
+
import * as z from "zod";
|
|
9
9
|
import { userSessionTable } from "../schema/user-session";
|
|
10
10
|
import {
|
|
11
11
|
SESSION_REVOKED_AGGREGATE_TYPE,
|
|
@@ -3,7 +3,7 @@ import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
|
3
3
|
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
5
5
|
import { Temporal } from "temporal-polyfill";
|
|
6
|
-
import
|
|
6
|
+
import * as z from "zod";
|
|
7
7
|
import { SessionErrors } from "../constants";
|
|
8
8
|
import { userSessionTable } from "../schema/user-session";
|
|
9
9
|
import { SESSION_REVOKED_AGGREGATE_TYPE, SESSION_REVOKED_EVENT_QN } from "../session-revoked-event";
|
|
@@ -55,6 +55,7 @@ export const revokeAllOthersWrite = defineWriteHandler({
|
|
|
55
55
|
payload: {
|
|
56
56
|
userId: event.user.id,
|
|
57
57
|
sessionIds: updated.map((row) => row.id),
|
|
58
|
+
keptSessionId: keepSid,
|
|
58
59
|
},
|
|
59
60
|
});
|
|
60
61
|
}
|
|
@@ -3,7 +3,7 @@ import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
|
3
3
|
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
5
5
|
import { Temporal } from "temporal-polyfill";
|
|
6
|
-
import
|
|
6
|
+
import * as z from "zod";
|
|
7
7
|
import { SessionErrors } from "../constants";
|
|
8
8
|
import { userSessionTable } from "../schema/user-session";
|
|
9
9
|
import { SESSION_REVOKED_AGGREGATE_TYPE, SESSION_REVOKED_EVENT_QN } from "../session-revoked-event";
|
|
@@ -97,12 +97,36 @@ export function createSessionCallbacks(opts: SessionCallbacksOptions): SessionCa
|
|
|
97
97
|
// original timestamp. Double-revoke races land here via logout +
|
|
98
98
|
// switch-tenant on the same sid. (Password-change uses a different
|
|
99
99
|
// callback — sessionMassRevoker — and isn't in scope for this guard.)
|
|
100
|
-
await updateMany(
|
|
100
|
+
const result = await updateMany<{ userId: string }>(
|
|
101
101
|
db,
|
|
102
102
|
userSessionTable,
|
|
103
103
|
{ revokedAt: Temporal.Now.instant() },
|
|
104
104
|
{ id: sid, revokedAt: null },
|
|
105
105
|
);
|
|
106
|
+
|
|
107
|
+
// This is the ONLY caller of sessionRevoker — logout and tenant-switch
|
|
108
|
+
// — so it's also the only source of streamScope: "revoked-sessions".
|
|
109
|
+
// Without this append, a live SSE stream on this exact sid outlives its
|
|
110
|
+
// own logout because the access-invalidation consumer never hears
|
|
111
|
+
// about it — same gap sessionMassRevoker closed for
|
|
112
|
+
// password-change.
|
|
113
|
+
const revoked = result[0];
|
|
114
|
+
if (revoked) {
|
|
115
|
+
const payload = sessionRevokedSchema.parse({
|
|
116
|
+
userId: revoked.userId,
|
|
117
|
+
sessionIds: [sid],
|
|
118
|
+
streamScope: "revoked-sessions",
|
|
119
|
+
});
|
|
120
|
+
await append(db, {
|
|
121
|
+
aggregateId: generateId(),
|
|
122
|
+
aggregateType: SESSION_REVOKED_AGGREGATE_TYPE,
|
|
123
|
+
tenantId: SYSTEM_TENANT_ID,
|
|
124
|
+
expectedVersion: 0,
|
|
125
|
+
type: SESSION_REVOKED_EVENT_QN,
|
|
126
|
+
payload,
|
|
127
|
+
metadata: { userId: revoked.userId },
|
|
128
|
+
});
|
|
129
|
+
}
|
|
106
130
|
},
|
|
107
131
|
|
|
108
132
|
// kumiko-lint-ignore complexity-budget session check + lastSeen refresh on hot path
|
|
@@ -244,6 +268,7 @@ export function createSessionCallbacks(opts: SessionCallbacksOptions): SessionCa
|
|
|
244
268
|
const payload = sessionRevokedSchema.parse({
|
|
245
269
|
userId,
|
|
246
270
|
sessionIds: result.map((row: { id: string }) => row.id),
|
|
271
|
+
keptSessionId: currentSid,
|
|
247
272
|
});
|
|
248
273
|
await append(db, {
|
|
249
274
|
aggregateId: generateId(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
|
|
3
3
|
// Lightweight custom event appended alongside the direct-write
|
|
4
4
|
// updateMany() in revoke.write.ts / revoke-all-others.write.ts /
|
|
@@ -24,6 +24,14 @@ export const SESSION_REVOKED_AGGREGATE_TYPE = "user-session-revocation" as const
|
|
|
24
24
|
export const sessionRevokedSchema = z.object({
|
|
25
25
|
userId: z.string().min(1),
|
|
26
26
|
sessionIds: z.array(z.uuid()).min(1),
|
|
27
|
+
// The caller's own session a "revoke all others" write spared. Optional so
|
|
28
|
+
// events appended before it existed still replay.
|
|
29
|
+
keptSessionId: z.uuid().optional(),
|
|
30
|
+
// Set only by the raw sessionRevoker callback (logout / tenant-switch) —
|
|
31
|
+
// tells the access-invalidation consumer to close exactly `sessionIds`
|
|
32
|
+
// instead of the userwide default every other source keeps using.
|
|
33
|
+
// Optional so events appended before it existed still replay unscoped.
|
|
34
|
+
streamScope: z.literal("revoked-sessions").optional(),
|
|
27
35
|
});
|
|
28
36
|
|
|
29
37
|
export type SessionRevokedPayload = z.infer<typeof sessionRevokedSchema>;
|
|
@@ -10,7 +10,7 @@ import { executeRawQuery } from "@cosmicdrift/kumiko-framework/db";
|
|
|
10
10
|
import { defineFeature } from "@cosmicdrift/kumiko-framework/engine";
|
|
11
11
|
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
12
12
|
import { setupTestStack, type TestStack, testTenantId } from "@cosmicdrift/kumiko-framework/stack";
|
|
13
|
-
import
|
|
13
|
+
import * as z from "zod";
|
|
14
14
|
import { redeemRowBoundGrant, signRowBoundGrant } from "../row-bound-grant";
|
|
15
15
|
|
|
16
16
|
const TABLE = "row_bound_grant_demo";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Production wiring (mail-foundation transport) is a follow-up; the
|
|
3
3
|
// default impl throws so a missing setMailRunner is loud, not silent.
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
|
|
7
7
|
export const mailSpecSchema = z.object({
|
|
8
8
|
to: z.union([z.string(), z.array(z.string())]),
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
import type { SubscriptionProviderPlugin } from "@cosmicdrift/kumiko-bundled-features/billing-foundation";
|
|
43
43
|
import { defineFeature, type FeatureDefinition } from "@cosmicdrift/kumiko-framework/engine";
|
|
44
44
|
import { createMollieClient } from "@mollie/api-client";
|
|
45
|
-
import
|
|
45
|
+
import * as z from "zod";
|
|
46
46
|
import { MOLLIE_PROVIDER_NAME, SUBSCRIPTION_MOLLIE_FEATURE } from "./constants";
|
|
47
47
|
import { createMollieCheckoutSession, type MolliePriceConfig } from "./plugin-methods";
|
|
48
48
|
import { type MollieClientShape, verifyAndParseMollieWebhook } from "./verify-webhook";
|
package/src/tags/schemas.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
crossTenantOverrideDenied,
|
|
4
4
|
defineQueryHandler,
|
|
5
5
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
6
|
-
import
|
|
6
|
+
import * as z from "zod";
|
|
7
7
|
import { TEXT_BLOCK_KIND } from "../constants";
|
|
8
8
|
import { type TemplateResourceRow, templateResourcesTable } from "../table";
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
crossTenantOverrideDenied,
|
|
5
5
|
defineQueryHandler,
|
|
6
6
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
7
|
-
import
|
|
7
|
+
import * as z from "zod";
|
|
8
8
|
import { TEXT_BLOCK_KIND } from "../constants";
|
|
9
9
|
import { type TemplateResourceRow, templateResourcesTable } from "../table";
|
|
10
10
|
|
|
@@ -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 { type TemplateResourceRow, templateResourcesTable } from "../table";
|
|
5
5
|
|
|
6
6
|
// Admin-Lookup für UI-Edit-Flow. Returnt das raw Template inkl. draft/
|
|
@@ -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 { RENDER_KINDS, TEMPLATE_STATUSES } from "../constants";
|
|
5
5
|
import { type TemplateResourceRow, templateResourcesTable } from "../table";
|
|
6
6
|
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
type TenantId,
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
8
8
|
import { writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
9
|
-
import
|
|
9
|
+
import * as z from "zod";
|
|
10
10
|
import { TEMPLATE_KINDS, TEXT_BLOCK_KIND } from "../constants";
|
|
11
11
|
import { type TemplateResourceRow, templateResourcesTable } from "../table";
|
|
12
12
|
import { contentFormatSchema, executor, folderSchema, localeSchema, slugSchema } from "./shared";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createEventStoreExecutor } from "@cosmicdrift/kumiko-framework/db";
|
|
2
|
-
import
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
import { CONTENT_FORMATS, TEMPLATE_STATUSES, UPSERT_KINDS } from "../constants";
|
|
4
4
|
import { templateResourceEntity, templateResourcesTable } from "../table";
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fetchOne } 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 type { TemplateResourceRow } from "../table";
|
|
6
6
|
import { templateResourcesTable } from "../table";
|
|
7
7
|
import { executor } from "./shared";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
type TenantId,
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
8
8
|
import { AccessDeniedError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
9
|
-
import
|
|
9
|
+
import * as z from "zod";
|
|
10
10
|
import type { TemplateResourceRow } from "../table";
|
|
11
11
|
import { templateResourcesTable } from "../table";
|
|
12
12
|
import { executor, upsertPayloadSchema } from "./shared";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
testTenantId,
|
|
14
14
|
unsafePushTables,
|
|
15
15
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
16
|
-
import
|
|
16
|
+
import * as z from "zod";
|
|
17
17
|
import { createConfigAccessorFactory, createConfigFeature } from "../../config/feature";
|
|
18
18
|
import { createConfigResolver } from "../../config/resolver";
|
|
19
19
|
import { configValuesTable } from "../../config/table";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
type TenantId,
|
|
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 { tenantTable } from "../schema/tenant";
|
|
10
10
|
|
|
11
11
|
export const activeTenantIdsQuery = defineQueryHandler({
|
|
@@ -2,7 +2,7 @@ import { fetchOne } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
|
2
2
|
import { createEventStoreExecutor } from "@cosmicdrift/kumiko-framework/db";
|
|
3
3
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
4
|
import { ConflictError, InternalError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
5
|
-
import
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
import { TenantErrors } from "../constants";
|
|
7
7
|
import { findForbiddenMembershipRole, reservedMembershipRoleError } from "../membership-roles";
|
|
8
8
|
import { tenantMembershipEntity, tenantMembershipsTable } from "../membership-table";
|
|
@@ -14,7 +14,7 @@ import { fetchOne } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
|
14
14
|
import { createEventStoreExecutor } from "@cosmicdrift/kumiko-framework/db";
|
|
15
15
|
import { access, defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
16
16
|
import { InternalError, NotFoundError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
17
|
-
import
|
|
17
|
+
import * as z from "zod";
|
|
18
18
|
// kumiko-lint-ignore cross-feature-import cancel needs invite-token-store for Redis cleanup
|
|
19
19
|
import { invalidateExistingInviteToken } from "../../auth-email-password/invite-token-store";
|
|
20
20
|
import {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createEventStoreExecutor } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler } 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 { tenantEntity, tenantTable } from "../schema/tenant";
|
|
6
6
|
|
|
7
7
|
const crud = createEventStoreExecutor(tenantTable, tenantEntity, { entityName: "tenant" });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import { access, 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 { decryptStoredPii, mapWithConcurrency } from "../../shared";
|
|
6
6
|
import { INVITATION_STATUS, tenantInvitationsTable } from "../invitation-table";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createEventStoreExecutor } from "@cosmicdrift/kumiko-framework/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 { tenantEntity, tenantTable } from "../schema/tenant";
|
|
6
6
|
|
|
7
7
|
const crud = createEventStoreExecutor(tenantTable, tenantEntity, { entityName: "tenant" });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fetchOne } 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 "../schema/tenant";
|
|
6
6
|
|
|
7
7
|
// Direct query — query handlers don't have a tenant-crud handle. A direct
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
MAX_LIST_LIMIT,
|
|
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 { decryptStoredPii, mapWithConcurrency } from "../../shared";
|
|
11
11
|
import { userTable } from "../../user";
|
|
12
12
|
import { tenantMembershipsTable } from "../membership-table";
|
|
@@ -2,7 +2,7 @@ import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
|
2
2
|
import { access, defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import { parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
5
|
-
import
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
import { decryptStoredPii, mapWithConcurrency } from "../../shared";
|
|
7
7
|
import { userTable } from "../../user";
|
|
8
8
|
import { tenantMembershipsTable } from "../membership-table";
|
|
@@ -2,7 +2,7 @@ import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
|
2
2
|
import { defineQueryHandler, SYSTEM_ROLE } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import { parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
5
|
-
import
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
import { tenantMembershipsTable } from "../membership-table";
|
|
7
7
|
import { tenantTable } from "../schema/tenant";
|
|
8
8
|
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
8
8
|
import { InternalError, NotFoundError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
9
9
|
import { parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
10
|
-
import
|
|
10
|
+
import * as z from "zod";
|
|
11
11
|
import { assertNotLastTenantAdmin } from "../last-tenant-admin";
|
|
12
12
|
import { tenantMembershipEntity, tenantMembershipsTable } from "../membership-table";
|
|
13
13
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import { defineQueryHandler, SYSTEM_ROLE } 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 { tenantMembershipsTable } from "../membership-table";
|
|
6
6
|
|
|
7
7
|
// Cross-feature query: resolve user IDs by tenantId or userId.
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
8
8
|
import { parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
9
9
|
import { Temporal } from "temporal-polyfill";
|
|
10
|
-
import
|
|
10
|
+
import * as z from "zod";
|
|
11
11
|
import { userSessionTable } from "../../sessions";
|
|
12
12
|
import { decryptStoredPii, mapWithConcurrency } from "../../shared";
|
|
13
13
|
import { userTable } from "../../user";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
MAX_LIST_LIMIT,
|
|
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 { tenantTable } from "../schema/tenant";
|
|
10
10
|
import { isSystemAdmin } from "./is-system-admin";
|
|
11
11
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createEventStoreExecutor } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler } 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 { tenantEntity, tenantTable } from "../schema/tenant";
|
|
6
6
|
|
|
7
7
|
const crud = createEventStoreExecutor(tenantTable, tenantEntity, { entityName: "tenant" });
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
writeFailure,
|
|
15
15
|
} from "@cosmicdrift/kumiko-framework/errors";
|
|
16
16
|
import { parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
17
|
-
import
|
|
17
|
+
import * as z from "zod";
|
|
18
18
|
import { assertNotLastTenantAdmin } from "../last-tenant-admin";
|
|
19
19
|
import {
|
|
20
20
|
findForbiddenMembershipRole,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
NotFoundError,
|
|
7
7
|
writeFailure,
|
|
8
8
|
} from "@cosmicdrift/kumiko-framework/errors";
|
|
9
|
-
import
|
|
9
|
+
import * as z from "zod";
|
|
10
10
|
import { tenantEntity, tenantTable } from "../schema/tenant";
|
|
11
11
|
|
|
12
12
|
const crud = createEventStoreExecutor(tenantTable, tenantEntity, { entityName: "tenant" });
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
8
8
|
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
9
9
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
10
|
-
import
|
|
10
|
+
import * as z from "zod";
|
|
11
11
|
import { redeemRowBoundGrant } from "../../shared";
|
|
12
12
|
import { TENANT_HANDOVER_CLAIM_AGGREGATE_TYPE, TENANT_HANDOVER_CLAIMED_EVENT_QN } from "../events";
|
|
13
13
|
import { tenantHandoverPurpose } from "../grant";
|
|
@@ -2,7 +2,7 @@ import { fetchOne } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
|
2
2
|
import { createEventStoreExecutor } from "@cosmicdrift/kumiko-framework/db";
|
|
3
3
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
4
|
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
5
|
-
import
|
|
5
|
+
import * as z from "zod";
|
|
6
6
|
import { isWithinGracePeriod } from "../../shared";
|
|
7
7
|
import { type TenantLifecycleStatus, tenantEntity, tenantTable } from "../../tenant";
|
|
8
8
|
import { DESTRUCTION_CANCELLED_EVENT_QN } from "../constants";
|
|
@@ -4,7 +4,7 @@ import { createEventStoreExecutor } from "@cosmicdrift/kumiko-framework/db";
|
|
|
4
4
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
5
5
|
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
6
6
|
import { getTemporal } from "@cosmicdrift/kumiko-framework/time";
|
|
7
|
-
import
|
|
7
|
+
import * as z from "zod";
|
|
8
8
|
import { resolveProfileForTenant } from "../../compliance-profiles";
|
|
9
9
|
import { type TenantLifecycleStatus, tenantEntity, tenantTable } from "../../tenant";
|
|
10
10
|
import { DESTRUCTION_REQUESTED_EVENT_QN } from "../constants";
|