@cosmicdrift/kumiko-bundled-features 0.307.0 → 0.309.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/__tests__/seed-admin-guarded.integration.test.ts +31 -0
- package/src/auth-email-password/changes.json +6 -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 +1 -1
- 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 +1 -1
- 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-email-password/seeding.ts +16 -3
- package/src/auth-mfa/__tests__/session-scoped-sse-revoke.integration.test.ts +1 -1
- package/src/auth-mfa/handlers/disable.write.ts +1 -1
- package/src/auth-mfa/handlers/enable-confirm-preauth.write.ts +1 -1
- 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 +1 -1
- 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__/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/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/__tests__/retention-cleanup-files.integration.test.ts +454 -0
- package/src/data-retention/changes.json +6 -0
- package/src/data-retention/feature.ts +1 -0
- package/src/data-retention/handlers/policy-for.query.ts +1 -1
- package/src/data-retention/override-schema.ts +1 -1
- package/src/data-retention/run-retention-cleanup.ts +312 -5
- 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 +1 -1
- package/src/sessions/handlers/revoke.write.ts +1 -1
- package/src/sessions/session-callbacks.ts +25 -1
- package/src/sessions/session-revoked-event.ts +6 -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/__tests__/tenant-lifecycle.integration.test.ts +8 -24
- 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/seeding.ts +29 -20
- 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-data-rights-defaults/hooks/file-ref.userdata-hook.ts +8 -61
- 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/handlers/resume-run.write.ts +1 -1
|
@@ -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";
|
|
@@ -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
|
|
@@ -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 /
|
|
@@ -27,6 +27,11 @@ export const sessionRevokedSchema = z.object({
|
|
|
27
27
|
// The caller's own session a "revoke all others" write spared. Optional so
|
|
28
28
|
// events appended before it existed still replay.
|
|
29
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(),
|
|
30
35
|
});
|
|
31
36
|
|
|
32
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";
|
|
@@ -16,8 +16,6 @@ import {
|
|
|
16
16
|
type TestStack,
|
|
17
17
|
TestUsers,
|
|
18
18
|
testTenantId,
|
|
19
|
-
unsafeCreateEntityTable,
|
|
20
|
-
unsafePushTables,
|
|
21
19
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
22
20
|
import {
|
|
23
21
|
createTestEnvelopeCipher,
|
|
@@ -27,18 +25,16 @@ import {
|
|
|
27
25
|
import { getTemporal } from "@cosmicdrift/kumiko-framework/time";
|
|
28
26
|
import {
|
|
29
27
|
createComplianceProfilesFeature,
|
|
30
|
-
tenantComplianceProfileEntity,
|
|
31
28
|
tenantComplianceProfileTable,
|
|
32
29
|
} from "../../compliance-profiles";
|
|
33
30
|
import { createConfigFeature } from "../../config";
|
|
34
31
|
import { createConfigResolver } from "../../config/resolver";
|
|
35
|
-
import { configValuesTable } from "../../config/table";
|
|
36
32
|
import { createSessionsFeature } from "../../sessions";
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
33
|
+
import { userSessionTable } from "../../sessions/schema/user-session";
|
|
34
|
+
import { tenantMembershipsTable } from "../../tenant";
|
|
39
35
|
import { TenantHandlers, TenantQueries } from "../../tenant/constants";
|
|
40
36
|
import { createTenantFeature } from "../../tenant/feature";
|
|
41
|
-
import {
|
|
37
|
+
import { tenantTable } from "../../tenant/schema/tenant";
|
|
42
38
|
import { seedTenantMembership } from "../../tenant/testing";
|
|
43
39
|
import { createUserFeature } from "../../user/feature";
|
|
44
40
|
import {
|
|
@@ -85,12 +81,6 @@ beforeAll(async () => {
|
|
|
85
81
|
} as import("@cosmicdrift/kumiko-framework/api").AuthRoutesConfig,
|
|
86
82
|
});
|
|
87
83
|
db = stack.db;
|
|
88
|
-
|
|
89
|
-
await unsafeCreateEntityTable(db, tenantEntity);
|
|
90
|
-
await unsafeCreateEntityTable(db, userSessionEntity);
|
|
91
|
-
await unsafeCreateEntityTable(db, tenantComplianceProfileEntity);
|
|
92
|
-
await unsafeCreateEntityTable(db, tenantMembershipEntity);
|
|
93
|
-
await unsafePushTables(db, { configValuesTable });
|
|
94
84
|
});
|
|
95
85
|
|
|
96
86
|
afterAll(async () => {
|
|
@@ -175,6 +165,11 @@ describe("tenant-lifecycle :: request / cancel / 410 gate", () => {
|
|
|
175
165
|
const err = await stack.http.writeErr(REQUEST, {}, member);
|
|
176
166
|
expect(err.httpStatus).toBe(403);
|
|
177
167
|
});
|
|
168
|
+
|
|
169
|
+
test("authenticated read against an unseeded tenant doesn't 500 on a missing read_tenants table (fw#3102)", async () => {
|
|
170
|
+
const res = await stack.http.query(TenantQueries.me, {}, tenantAdmin);
|
|
171
|
+
expect(res.status).toBe(200);
|
|
172
|
+
});
|
|
178
173
|
});
|
|
179
174
|
|
|
180
175
|
function createPoisonTenantDataFeature() {
|
|
@@ -210,9 +205,6 @@ describe("tenant-lifecycle :: pipeline abandon / destroyFailed", () => {
|
|
|
210
205
|
},
|
|
211
206
|
} as import("@cosmicdrift/kumiko-framework/api").AuthRoutesConfig,
|
|
212
207
|
});
|
|
213
|
-
await unsafeCreateEntityTable(poisonStack.db, tenantEntity);
|
|
214
|
-
await unsafeCreateEntityTable(poisonStack.db, tenantComplianceProfileEntity);
|
|
215
|
-
await unsafePushTables(poisonStack.db, { configValuesTable });
|
|
216
208
|
});
|
|
217
209
|
|
|
218
210
|
afterAll(async () => {
|
|
@@ -416,9 +408,6 @@ describe("tenant-lifecycle :: sweep isolates one tenant's failure from another's
|
|
|
416
408
|
],
|
|
417
409
|
extraContext: { configResolver: resolver, configEncryption: encryption },
|
|
418
410
|
});
|
|
419
|
-
await unsafeCreateEntityTable(isolationStack.db, tenantEntity);
|
|
420
|
-
await unsafeCreateEntityTable(isolationStack.db, tenantComplianceProfileEntity);
|
|
421
|
-
await unsafePushTables(isolationStack.db, { configValuesTable });
|
|
422
411
|
});
|
|
423
412
|
|
|
424
413
|
afterAll(async () => {
|
|
@@ -483,11 +472,6 @@ describe("tenant-lifecycle :: 410 gate derived from the mounted provider", () =>
|
|
|
483
472
|
],
|
|
484
473
|
extraContext: { configResolver: resolver, configEncryption: encryption },
|
|
485
474
|
});
|
|
486
|
-
await unsafeCreateEntityTable(derivedStack.db, tenantEntity);
|
|
487
|
-
await unsafeCreateEntityTable(derivedStack.db, userSessionEntity);
|
|
488
|
-
await unsafeCreateEntityTable(derivedStack.db, tenantComplianceProfileEntity);
|
|
489
|
-
await unsafeCreateEntityTable(derivedStack.db, tenantMembershipEntity);
|
|
490
|
-
await unsafePushTables(derivedStack.db, { configValuesTable });
|
|
491
475
|
});
|
|
492
476
|
|
|
493
477
|
afterAll(async () => {
|
|
@@ -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";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
type EntityDefinition,
|
|
16
16
|
type WriteHandlerDef,
|
|
17
17
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
18
|
-
import
|
|
18
|
+
import * as z from "zod";
|
|
19
19
|
import { TenantSettingsConfig } from "./constants";
|
|
20
20
|
|
|
21
21
|
const OPTIONAL_CURRENCY_MONEY = z.object({ amount: z.number(), currency: z.string().optional() });
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
unsafePushTables,
|
|
20
20
|
} from "@cosmicdrift/kumiko-framework/stack";
|
|
21
21
|
import { composeFeatures } from "@cosmicdrift/kumiko-server-runtime/compose-features";
|
|
22
|
-
import
|
|
22
|
+
import * as z from "zod";
|
|
23
23
|
import { tierAssignmentEntity } from "../entity";
|
|
24
24
|
import { tierEngineFeature } from "../feature";
|
|
25
25
|
import { createTierResolver } from "../tier-resolver";
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
65
65
|
import { getUnscopedAggregateStreamMaxVersion } from "@cosmicdrift/kumiko-framework/event-store";
|
|
66
66
|
import { getTemporal } from "@cosmicdrift/kumiko-framework/time";
|
|
67
|
-
import
|
|
67
|
+
import * as z from "zod";
|
|
68
68
|
import { tenantTable } from "../tenant";
|
|
69
69
|
import { tierAssignmentAggregateId } from "./aggregate-id";
|
|
70
70
|
import type { TierMap } from "./compose-app";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fetchOne } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import { buildEntityTable, createTenantDb } from "@cosmicdrift/kumiko-framework/db";
|
|
3
3
|
import { defineQueryHandler, type TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
|
-
import
|
|
4
|
+
import * as z from "zod";
|
|
5
5
|
import { type TierAssignmentRow, tierAssignmentEntity } from "../entity";
|
|
6
6
|
|
|
7
7
|
// Liest das Tier-Assignment eines BELIEBIGEN Tenants (cross-tenant) für den
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
createTenantDb,
|
|
6
6
|
} from "@cosmicdrift/kumiko-framework/db";
|
|
7
7
|
import { defineWriteHandler, type TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
8
|
-
import
|
|
8
|
+
import * as z from "zod";
|
|
9
9
|
import { tierAssignmentAggregateId } from "../aggregate-id";
|
|
10
10
|
import { type TierAssignmentRow, tierAssignmentEntity } from "../entity";
|
|
11
11
|
|