@cosmicdrift/kumiko-samples 0.350.0 → 0.351.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/bundled-features/package.json +1 -1
- package/packages/bundled-features/src/audit/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/email-templates.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept-with-login.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/invite-create.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/signup-request.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/token-request-handler.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/reset-token.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/unlock-token.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/verification-token.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm-preauth.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/hmac-token-codec.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/mfa-challenge-token.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/mfa-preauth-setup-token.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/mfa-setup-token.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/constants.ts +3 -17
- package/packages/bundled-features/src/billing-foundation/consumer-protection/confirmation-mail.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-mail.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/feature.ts +2 -9
- package/packages/bundled-features/src/billing-foundation/handlers/sync-subscription.write.ts +3 -11
- package/packages/bundled-features/src/cap-counter/book-cap-usage.ts +1 -1
- package/packages/bundled-features/src/cap-counter/enforce-cap.ts +1 -9
- package/packages/bundled-features/src/delivery/handlers/log.query.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/handlers/set.write.ts +1 -1
- package/packages/bundled-features/src/form-draft/db/queries/cleanup.ts +1 -1
- package/packages/bundled-features/src/form-draft/db/queries/owned-file-refs.ts +1 -1
- package/packages/bundled-features/src/form-draft/lookup.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/ingest-message.write.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/oauth-access-token.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/oauth-state.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/watch-supervisor.ts +1 -1
- package/packages/bundled-features/src/inbound-provider-imap/feature.ts +1 -1
- package/packages/bundled-features/src/inbound-provider-imap/imap-client.ts +1 -1
- package/packages/bundled-features/src/jobs/job-instant.ts +1 -1
- package/packages/bundled-features/src/metrics/compute.ts +1 -1
- package/packages/bundled-features/src/metrics/feature.ts +1 -1
- package/packages/bundled-features/src/metrics/types.ts +1 -1
- package/packages/bundled-features/src/metrics/window.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/expiry.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/handlers/revoke.write.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/revoke-for-user.ts +1 -1
- package/packages/bundled-features/src/sessions/handlers/revoke-all-for-user.write.ts +1 -1
- package/packages/bundled-features/src/sessions/handlers/revoke-all-others.write.ts +1 -1
- package/packages/bundled-features/src/sessions/handlers/revoke.write.ts +1 -1
- package/packages/bundled-features/src/sessions/session-callbacks.ts +1 -1
- package/packages/bundled-features/src/shared/grace-period.ts +3 -10
- package/packages/bundled-features/src/shared/row-bound-grant.ts +1 -1
- package/packages/bundled-features/src/shared/signed-token.ts +1 -1
- package/packages/bundled-features/src/subscription-mollie/verify-webhook.ts +1 -1
- package/packages/bundled-features/src/subscription-stripe/verify-webhook.ts +1 -1
- package/packages/bundled-features/src/template-resolver/api.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-shared.ts +1 -1
- package/packages/bundled-features/src/template-resolver/table.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/team-list.query.ts +1 -1
- package/packages/bundled-features/src/tenant/invited-membership.ts +1 -1
- package/packages/bundled-features/src/tenant-handover/grant.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/db/queries/export-jobs.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/db/queries/forget-cleanup.ts +3 -9
- package/packages/bundled-features/src/user-data-rights/deletion-token.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/email-templates.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/list-download-attempts.query.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/my-audit-log.query.ts +1 -1
- package/packages/bundled-features/src/waitlist/handlers/invite.write.ts +1 -1
- package/packages/bundled-features/src/waitlist/handlers/submit.write.ts +1 -1
- package/samples/apps/marketing-demo/package.json +1 -0
- package/samples/apps/marketing-demo/src/app/seed.ts +1 -1
- package/samples/apps/use-all-bundled/package.json +1 -0
- package/samples/apps/use-all-bundled/src/app/seed.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-samples",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.351.0",
|
|
4
4
|
"description": "Source trees of the Kumiko sample recipes, sample apps and bundled features in repo layout, for tooling such as few-shot corpus builds.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-bundled-features",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.351.0",
|
|
4
4
|
"description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { selectMany, type WhereObject } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
18
18
|
import { access, defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
19
19
|
import { eventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
20
|
-
import { Temporal } from "temporal
|
|
20
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
21
21
|
import * as z from "zod";
|
|
22
22
|
import { AUDIT_SCOPE_VALUES } from "../constants.js";
|
|
23
23
|
import { resolveAuditScopeFilter } from "./resolve-audit-tenant.js";
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// (localeDe() / localeEs() call registerMailTranslations).
|
|
10
10
|
|
|
11
11
|
import { mailT, registerMailTranslations } from "@cosmicdrift/kumiko-framework/i18n";
|
|
12
|
-
import { Temporal } from "temporal
|
|
12
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
13
13
|
|
|
14
14
|
export type AuthMailLocale = string;
|
|
15
15
|
|
package/packages/bundled-features/src/auth-email-password/handlers/invite-accept-with-login.write.ts
CHANGED
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
type TenantId,
|
|
32
32
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
33
33
|
import { InternalError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
34
|
-
import type { Temporal } from "temporal
|
|
34
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
35
35
|
import * as z from "zod";
|
|
36
36
|
import { decryptStoredPii, sessionLocaleField, sessionTimezoneField } from "../../shared/index.js";
|
|
37
37
|
// kumiko-lint-ignore cross-feature-import invite-flow
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
type TenantId,
|
|
24
24
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
25
25
|
import { InternalError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
26
|
-
import type { Temporal } from "temporal
|
|
26
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
27
27
|
import * as z from "zod";
|
|
28
28
|
import { decryptStoredPii } from "../../shared/index.js";
|
|
29
29
|
// kumiko-lint-ignore cross-feature-import invite-flow lebt in auth-email-password (Magic-Link), DB-row-owner ist tenant-feature
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
type WriteFailure,
|
|
33
33
|
writeFailure,
|
|
34
34
|
} from "@cosmicdrift/kumiko-framework/errors";
|
|
35
|
-
import { Temporal } from "temporal
|
|
35
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
36
36
|
import * as z from "zod";
|
|
37
37
|
// kumiko-lint-ignore cross-feature-import invite-flow lebt in auth-email-password (Magic-Link-Pattern), DB-row-owner ist tenant-feature
|
|
38
38
|
import {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
import { generateToken } from "@cosmicdrift/kumiko-framework/api";
|
|
25
25
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
26
26
|
import { InternalError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
27
|
-
import { Temporal } from "temporal
|
|
27
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
28
28
|
import * as z from "zod";
|
|
29
29
|
import { findSignupHandoverProvider, type SignupHandoverBinding } from "../../shared/index.js";
|
|
30
30
|
import { AUTH_SIGNUP_DEFAULT_TTL_MINUTES } from "../constants.js";
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import { createSystemUser, defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
16
16
|
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
17
17
|
import { isValidIanaTimeZone } from "@cosmicdrift/kumiko-framework/time";
|
|
18
|
-
import type { Temporal } from "temporal
|
|
18
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
19
19
|
import * as z from "zod";
|
|
20
20
|
import { UserQueries } from "../../user/index.js";
|
|
21
21
|
import { type AuthUserRow, parseAuthUserRow } from "../auth-user-row.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// the shared HMAC logic lives in one place. verification-token.ts mirrors
|
|
4
4
|
// this pattern with purpose="verify".
|
|
5
5
|
|
|
6
|
-
import type { Temporal } from "temporal
|
|
6
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
7
7
|
import { signToken, TokenPurpose, verifyToken } from "./signed-token.js";
|
|
8
8
|
|
|
9
9
|
export type VerifyResult =
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Thin wrapper around signed-token.ts pinning the purpose to "unlock".
|
|
2
2
|
// Mirrors reset-token.ts / verification-token.ts.
|
|
3
3
|
|
|
4
|
-
import type { Temporal } from "temporal
|
|
4
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
5
5
|
import { signToken, TokenPurpose, verifyToken } from "./signed-token.js";
|
|
6
6
|
|
|
7
7
|
export type VerifyResult =
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Mirrors reset-token.ts so callers can import a flow-specific helper
|
|
3
3
|
// without knowing the underlying HMAC scheme.
|
|
4
4
|
|
|
5
|
-
import type { Temporal } from "temporal
|
|
5
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
6
6
|
import { signToken, TokenPurpose, verifyToken } from "./signed-token.js";
|
|
7
7
|
|
|
8
8
|
export type VerifyResult =
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
8
8
|
import { InternalError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
9
9
|
import { parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
10
|
-
import { Temporal } from "temporal
|
|
10
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
11
11
|
import * as z from "zod";
|
|
12
12
|
import { burnToken, sessionLocaleField, sessionTimezoneField } from "../../shared/index.js";
|
|
13
13
|
import { USER_STATUS, UserQueries } from "../../user/index.js";
|
|
@@ -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, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
|
-
import { Temporal } from "temporal
|
|
4
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { burnToken } from "../../shared/index.js";
|
|
7
7
|
import { base32Decode } from "../base32.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
2
|
-
import { Temporal } from "temporal
|
|
2
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
3
3
|
|
|
4
4
|
function hmacSign(input: string, secret: string): string {
|
|
5
5
|
return createHmac("sha256", secret).update(input).digest("base64url");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { Temporal } from "temporal
|
|
2
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
3
3
|
import { createHmacTokenCodec, type HmacTokenVerifyResult } from "./hmac-token-codec.js";
|
|
4
4
|
|
|
5
5
|
export type MfaChallengePayload = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { Temporal } from "temporal
|
|
2
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
3
3
|
import { createHmacTokenCodec, type HmacTokenVerifyResult } from "./hmac-token-codec.js";
|
|
4
4
|
|
|
5
5
|
export type MfaPreauthSetupPayload = {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// signed-token.ts (userId-only payload) because setup needs to carry
|
|
11
11
|
// generated secret material, not just re-derive it from a lookup.
|
|
12
12
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
13
|
-
import { Temporal } from "temporal
|
|
13
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
14
14
|
|
|
15
15
|
export type MfaSetupPayload = {
|
|
16
16
|
readonly userId: string;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
/// <reference types="temporal-polyfill/global" preserve="true" />
|
|
2
2
|
// @runtime client
|
|
3
|
-
|
|
4
|
-
// module), so importing it here doesn't break browser bundles. Aliased —
|
|
5
|
-
// same reason as event-store.ts's own import: the un-aliased name would
|
|
6
|
-
// shadow the ambient global `Temporal` TYPE every `Temporal.Instant`
|
|
7
|
-
// annotation in this file (and its callers, e.g. StoredEvent.createdAt)
|
|
8
|
-
// resolves against, see #1438.
|
|
9
|
-
import { Temporal as TemporalPolyfill } from "temporal-polyfill";
|
|
3
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
10
4
|
|
|
11
5
|
// Feature name
|
|
12
6
|
export const BILLING_FOUNDATION_FEATURE = "billing-foundation" as const;
|
|
@@ -185,7 +179,7 @@ export function isTerminalSubscriptionStatus(status: string): boolean {
|
|
|
185
179
|
// after roughly 23 hours; without a matching staleness cutoff on our side, a
|
|
186
180
|
// stale incomplete row would block that tenant from ever starting a new
|
|
187
181
|
// checkout, since the projection has no expiry-triggered event of its own.
|
|
188
|
-
export const STALE_INCOMPLETE_AFTER =
|
|
182
|
+
export const STALE_INCOMPLETE_AFTER = Temporal.Duration.from({ hours: 24 });
|
|
189
183
|
|
|
190
184
|
/** Time-aware terminal check for the checkout gate: a canceled subscription
|
|
191
185
|
* is terminal (see `isTerminalSubscriptionStatus`), and so is an
|
|
@@ -199,15 +193,7 @@ export function isSubscriptionBlockingCheckout(
|
|
|
199
193
|
if (isTerminalSubscriptionStatus(sub.status)) return false;
|
|
200
194
|
if (sub.status !== SubscriptionStatuses.incomplete) return true;
|
|
201
195
|
const staleAt = sub.lastChangedAt.add(STALE_INCOMPLETE_AFTER);
|
|
202
|
-
|
|
203
|
-
// at runtime — row types resolve against ambient Temporal; polyfill Instant
|
|
204
|
-
// is a separate nominal type across the two .d.ts sources.
|
|
205
|
-
return (
|
|
206
|
-
TemporalPolyfill.Instant.compare(
|
|
207
|
-
now as unknown as InstanceType<typeof TemporalPolyfill.Instant>,
|
|
208
|
-
staleAt as unknown as InstanceType<typeof TemporalPolyfill.Instant>,
|
|
209
|
-
) < 0
|
|
210
|
-
);
|
|
196
|
+
return Temporal.Instant.compare(now, staleAt) < 0;
|
|
211
197
|
}
|
|
212
198
|
|
|
213
199
|
// A subscription in one of these statuses can be switched to a different
|
package/packages/bundled-features/src/billing-foundation/consumer-protection/confirmation-mail.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Temporal } from "temporal
|
|
1
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
2
2
|
import type { CheckoutConsentRecordedPayload } from "../events.js";
|
|
3
3
|
import { CONSENT_TEXTS, type ConsentLocale, resolveConsentLocale } from "./consent-text.js";
|
|
4
4
|
|
|
@@ -55,10 +55,7 @@ import {
|
|
|
55
55
|
EXT_TENANT_DATA,
|
|
56
56
|
type FeatureDefinition,
|
|
57
57
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
58
|
-
|
|
59
|
-
// `Temporal` TYPE `ResolvedBillingFoundationOptions.now`'s return type
|
|
60
|
-
// resolves against, see event-store.ts's own import comment (#1438).
|
|
61
|
-
import { Temporal as TemporalPolyfill } from "temporal-polyfill";
|
|
58
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
62
59
|
import {
|
|
63
60
|
BILLING_FOUNDATION_FEATURE,
|
|
64
61
|
SUBSCRIPTION_PROVIDER_EXTENSION,
|
|
@@ -131,11 +128,7 @@ export function createBillingFoundationFeature<TTier extends string = string>(
|
|
|
131
128
|
// ever calls `Temporal.Now.instant` itself.
|
|
132
129
|
const widened: ResolvedBillingFoundationOptions = {
|
|
133
130
|
...options,
|
|
134
|
-
|
|
135
|
-
// at runtime — `now` is typed against the ambient Temporal global;
|
|
136
|
-
// TemporalPolyfill.Now.instant() returns the polyfill's own nominal
|
|
137
|
-
// Instant type across the two .d.ts sources.
|
|
138
|
-
now: options.now ?? (() => TemporalPolyfill.Now.instant() as unknown as Temporal.Instant),
|
|
131
|
+
now: options.now ?? (() => Temporal.Now.instant()),
|
|
139
132
|
...(options.baseUrl !== undefined && {
|
|
140
133
|
baseUrl: options.baseUrl.endsWith("/") ? options.baseUrl.slice(0, -1) : options.baseUrl,
|
|
141
134
|
}),
|
package/packages/bundled-features/src/billing-foundation/handlers/sync-subscription.write.ts
CHANGED
|
@@ -15,10 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
import { createHash } from "node:crypto";
|
|
17
17
|
import { SYSTEM_ROLE, type WriteHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
18
|
-
|
|
19
|
-
// `Temporal` TYPE `SubscriptionView.currentPeriodEnd`/`.cancelAt` resolve
|
|
20
|
-
// against, same reasoning as constants.ts's own import.
|
|
21
|
-
import { Temporal as TemporalPolyfill } from "temporal-polyfill";
|
|
18
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
22
19
|
import * as z from "zod";
|
|
23
20
|
import { findProviderPlugin } from "../checkout-core.js";
|
|
24
21
|
import { isTerminalSubscriptionStatus, SubscriptionEventTypes } from "../constants.js";
|
|
@@ -37,18 +34,13 @@ export type SyncSubscriptionResult =
|
|
|
37
34
|
| { readonly synced: true }
|
|
38
35
|
| { readonly synced: false; readonly reason: SyncSubscriptionSkipReason };
|
|
39
36
|
|
|
40
|
-
// Parses both sides fresh via
|
|
37
|
+
// Parses both sides fresh via Temporal before comparing — tolerant of a
|
|
41
38
|
// provider snapshot's ISO string using a different (but equivalent)
|
|
42
39
|
// representation than `Temporal.Instant#toString()`'s canonical form
|
|
43
40
|
// (offset spelling, sub-second precision, ...), unlike a plain `===` on the
|
|
44
41
|
// raw strings.
|
|
45
42
|
function isoInstantsEqual(a: string, b: string): boolean {
|
|
46
|
-
return (
|
|
47
|
-
TemporalPolyfill.Instant.compare(
|
|
48
|
-
TemporalPolyfill.Instant.from(a),
|
|
49
|
-
TemporalPolyfill.Instant.from(b),
|
|
50
|
-
) === 0
|
|
51
|
-
);
|
|
43
|
+
return Temporal.Instant.compare(Temporal.Instant.from(a), Temporal.Instant.from(b)) === 0;
|
|
52
44
|
}
|
|
53
45
|
|
|
54
46
|
// Deterministic per (snapshot-content, current stream head) — not per-call.
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
type WriteResult,
|
|
9
9
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
10
10
|
import { eventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
11
|
-
import { Temporal } from "temporal
|
|
11
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
12
12
|
import * as z from "zod";
|
|
13
13
|
import { capCounterAggregateId, rollingCapAggregateId } from "./aggregate-id.js";
|
|
14
14
|
import { CAP_COUNTER_ROLLING_AGGREGATE_TYPE, ROLLING_INCREMENTED_EVENT_QN } from "./constants.js";
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
/// <reference types="temporal-polyfill/global" preserve="true" />
|
|
2
1
|
import { createEntityExecutor, type HandlerContext } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
2
|
import { KumikoError, reraiseAsKumikoError } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
4
4
|
import { markCapSoftWarned, readRollingCapUsage } from "./book-cap-usage.js";
|
|
5
5
|
import { capCounterEntity } from "./entity.js";
|
|
6
6
|
|
|
7
|
-
// Temporal globally provided by the framework's polyfill init
|
|
8
|
-
// (ensureTemporalPolyfill() in time/polyfill.ts, called from
|
|
9
|
-
// setupTestStack/boot). Importing from "temporal-polyfill" gives us
|
|
10
|
-
// the polyfill-package types which don't quite match drizzle's
|
|
11
|
-
// `instant()`-customType (temporal-spec narrowing of `until(...).sign`).
|
|
12
|
-
// Mirror the audit-handler pattern: rely on the global ambient
|
|
13
|
-
// declaration from temporal-spec.
|
|
14
|
-
|
|
15
7
|
const { table } = createEntityExecutor("cap-counter", capCounterEntity);
|
|
16
8
|
|
|
17
9
|
// =============================================================================
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
SYSTEM_USER_ID,
|
|
17
17
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
18
18
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
19
|
-
import { Temporal } from "temporal
|
|
19
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
20
20
|
import * as z from "zod";
|
|
21
21
|
import { decryptStoredPii } from "../../shared/index.js";
|
|
22
22
|
import { resolveUserDisplayNames, USER_FEATURE } from "../../user/index.js";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
VersionConflictError,
|
|
6
6
|
writeFailure,
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/errors";
|
|
8
|
-
import { Temporal } from "temporal
|
|
8
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
9
9
|
import * as z from "zod";
|
|
10
10
|
import {
|
|
11
11
|
FEATURE_TOGGLE_AGGREGATE_TYPE,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { unsafeReadRetrying } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
|
|
3
3
|
import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
|
-
import { Temporal } from "temporal
|
|
4
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
5
5
|
import type { FormDraftBlob } from "../../schemas.js";
|
|
6
6
|
|
|
7
7
|
export type StaleDraftRow = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { unsafeReadRetrying } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import type { DbRunner } from "@cosmicdrift/kumiko-framework/db";
|
|
3
3
|
import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
|
-
import type { Temporal } from "temporal
|
|
4
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
5
5
|
|
|
6
6
|
// Narrows a draft blob's raw FileRef-shaped storageKeys (collectDraftFileRefKeys
|
|
7
7
|
// output — extracted from free-form, client-supplied JSON, issue #1889) down to
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fetchOne, selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import type { TenantDb } from "@cosmicdrift/kumiko-framework/db";
|
|
3
3
|
import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
|
-
import type { Temporal } from "temporal
|
|
4
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
5
5
|
import { formDraftTable } from "./executor.js";
|
|
6
6
|
import type { FormDraftBlob } from "./schemas.js";
|
|
7
7
|
|
package/packages/bundled-features/src/inbound-mail-foundation/handlers/ingest-message.write.ts
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import { acquireNamespacedAdvisoryLock } from "@cosmicdrift/kumiko-framework/db";
|
|
29
29
|
import type { WriteHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
30
30
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
31
|
-
import { Temporal } from "temporal
|
|
31
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
32
32
|
import * as z from "zod";
|
|
33
33
|
import { inboundMessageAggregateId, mailThreadAggregateId } from "../aggregate-id.js";
|
|
34
34
|
import {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import { transaction } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
20
20
|
import { acquireNamespacedAdvisoryLock, type DbConnection } from "@cosmicdrift/kumiko-framework/db";
|
|
21
21
|
import type { SecretsContext } from "@cosmicdrift/kumiko-framework/secrets";
|
|
22
|
-
import { Temporal } from "temporal
|
|
22
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
23
23
|
import { InboundMailAuthMethods, inboundCredentialSecretKey } from "./constants.js";
|
|
24
24
|
import {
|
|
25
25
|
InboundAuthError,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// HMAC-Input, timing-safe compare, Expiry im Klartext-Segment).
|
|
12
12
|
|
|
13
13
|
import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
14
|
-
import { Temporal } from "temporal
|
|
14
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
15
15
|
|
|
16
16
|
const STATE_PURPOSE = "inbound-mail-oauth-connect";
|
|
17
17
|
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
} from "@cosmicdrift/kumiko-framework/crypto";
|
|
52
52
|
import type { DbConnection, EntityTableMeta } from "@cosmicdrift/kumiko-framework/db";
|
|
53
53
|
import type { DistributedLock } from "@cosmicdrift/kumiko-framework/pipeline";
|
|
54
|
-
import { Temporal } from "temporal
|
|
54
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
55
55
|
import { InboundMailAccountStatuses, InboundMailFoundationHandlers } from "./constants.js";
|
|
56
56
|
import { MAIL_ACCOUNT_PII_FIELDS, syncCursorTable } from "./entities.js";
|
|
57
57
|
import {
|
|
@@ -36,8 +36,8 @@ import {
|
|
|
36
36
|
import { requireSecretsContext } from "@cosmicdrift/kumiko-bundled-features/secrets";
|
|
37
37
|
import { defineFeature } from "@cosmicdrift/kumiko-framework/engine";
|
|
38
38
|
import { instantToLegacyDate } from "@cosmicdrift/kumiko-framework/time";
|
|
39
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
39
40
|
import type { ImapFlow, MailboxObject } from "imapflow";
|
|
40
|
-
import { Temporal } from "temporal-polyfill";
|
|
41
41
|
import { type ImapCredentialDocument, parseImapCredentialDocument } from "./credential-document.js";
|
|
42
42
|
import {
|
|
43
43
|
assertUidValidity,
|
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
} from "@cosmicdrift/kumiko-bundled-features/inbound-mail-foundation";
|
|
18
18
|
import { createFallbackLogger } from "@cosmicdrift/kumiko-framework/logging";
|
|
19
19
|
import { legacyDateToInstant } from "@cosmicdrift/kumiko-framework/time";
|
|
20
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
20
21
|
import { ImapFlow } from "imapflow";
|
|
21
22
|
import { type AddressObject, type ParsedMail, simpleParser } from "mailparser";
|
|
22
|
-
import { Temporal } from "temporal-polyfill";
|
|
23
23
|
import type { ImapCredentialDocument } from "./credential-document.js";
|
|
24
24
|
|
|
25
25
|
export const IMAP_MAILBOX = "INBOX";
|
|
@@ -4,8 +4,8 @@ import type {
|
|
|
4
4
|
AggregateKey,
|
|
5
5
|
AggregateRow,
|
|
6
6
|
} from "@cosmicdrift/kumiko-types/aggregate-types";
|
|
7
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
7
8
|
import type { TenantDb } from "@cosmicdrift/kumiko-types/tenant-db-types";
|
|
8
|
-
import type { Temporal } from "temporal-polyfill";
|
|
9
9
|
import { MAX_GROUP_ROWS, type MetricRange } from "./constants.js";
|
|
10
10
|
import type {
|
|
11
11
|
MetricDefinition,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
type QueryHandlerDefinition,
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
8
8
|
import { InternalError, ValidationError } from "@cosmicdrift/kumiko-framework/errors";
|
|
9
|
-
import { Temporal } from "temporal
|
|
9
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
10
10
|
import * as z from "zod";
|
|
11
11
|
import { runMetric } from "./compute.js";
|
|
12
12
|
import {
|
|
@@ -5,8 +5,8 @@ import type {
|
|
|
5
5
|
AggregateTimeBucket,
|
|
6
6
|
} from "@cosmicdrift/kumiko-types/aggregate-types";
|
|
7
7
|
import type { SchemaTable } from "@cosmicdrift/kumiko-types/schema-table-types";
|
|
8
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
8
9
|
import type { WhereObject } from "@cosmicdrift/kumiko-types/where-clause-types";
|
|
9
|
-
import type { Temporal } from "temporal-polyfill";
|
|
10
10
|
import type { MetricRange, MetricScope } from "./constants.js";
|
|
11
11
|
|
|
12
12
|
/** Maps a payload value (e.g. a folder id) to the values `column` may have (e.g. the folder and its subfolders' loan ids). Runs with the tenant handler context, so reads stay tenant-scoped; the result only narrows. An empty result yields no rows. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AggregateTimeBucket } from "@cosmicdrift/kumiko-types/aggregate-types";
|
|
2
|
-
import { Temporal } from "temporal
|
|
2
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
3
3
|
import type { MetricRange } from "./constants.js";
|
|
4
4
|
import type { MetricDefinition } from "./types.js";
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} 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 { Temporal } from "temporal
|
|
10
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
11
11
|
import * as z from "zod";
|
|
12
12
|
import { encryptForDirectWrite, verifyPassword } from "../../shared/index.js";
|
|
13
13
|
import { UserQueries } from "../../user/index.js";
|
|
@@ -2,7 +2,7 @@ import { updateMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
|
2
2
|
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
|
-
import { Temporal } from "temporal
|
|
5
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
6
6
|
import * as z from "zod";
|
|
7
7
|
import { API_TOKEN_ENTITY_NAME, PatErrors } from "../constants.js";
|
|
8
8
|
import { PAT_REVOKED_AGGREGATE_TYPE, PAT_REVOKED_EVENT_QN } from "../pat-revoked-event.js";
|
|
@@ -3,7 +3,7 @@ import type { DbRunner } from "@cosmicdrift/kumiko-framework/db";
|
|
|
3
3
|
import { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
4
|
import { append } from "@cosmicdrift/kumiko-framework/event-store";
|
|
5
5
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
6
|
-
import { Temporal } from "temporal
|
|
6
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
7
7
|
import {
|
|
8
8
|
PAT_REVOKED_AGGREGATE_TYPE,
|
|
9
9
|
PAT_REVOKED_EVENT_QN,
|
|
@@ -4,7 +4,7 @@ import { access, defineWriteHandler, SYSTEM_TENANT_ID } from "@cosmicdrift/kumik
|
|
|
4
4
|
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
5
5
|
import { append } from "@cosmicdrift/kumiko-framework/event-store";
|
|
6
6
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
7
|
-
import { Temporal } from "temporal
|
|
7
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
8
8
|
import * as z from "zod";
|
|
9
9
|
import { userSessionTable } from "../schema/user-session.js";
|
|
10
10
|
import {
|
|
@@ -2,7 +2,7 @@ import { updateMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
|
2
2
|
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
|
-
import { Temporal } from "temporal
|
|
5
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
6
6
|
import * as z from "zod";
|
|
7
7
|
import { SessionErrors } from "../constants.js";
|
|
8
8
|
import { userSessionTable } from "../schema/user-session.js";
|
|
@@ -2,7 +2,7 @@ import { fetchOne, updateMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
|
2
2
|
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
|
-
import { Temporal } from "temporal
|
|
5
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
6
6
|
import * as z from "zod";
|
|
7
7
|
import { SessionErrors, USER_SESSION_ENTITY_NAME } from "../constants.js";
|
|
8
8
|
import { userSessionTable } from "../schema/user-session.js";
|
|
@@ -15,7 +15,7 @@ import type { SessionUser, TenantId } from "@cosmicdrift/kumiko-framework/engine
|
|
|
15
15
|
import { buildSessionRoles, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
16
16
|
import { append } from "@cosmicdrift/kumiko-framework/event-store";
|
|
17
17
|
import { generateId, parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
18
|
-
import { Temporal } from "temporal
|
|
18
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
19
19
|
import { encryptForDirectWrite } from "../shared/index.js";
|
|
20
20
|
import { tenantMembershipsTable } from "../tenant/index.js";
|
|
21
21
|
import { isPrincipalBlocked, type UserStatus, userTable } from "../user/index.js";
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
/// <reference types="temporal-polyfill/global" preserve="true" />
|
|
2
2
|
/** Shared grace-period check for user-data-rights + tenant-lifecycle cancel flows. */
|
|
3
3
|
|
|
4
|
-
import { Temporal
|
|
4
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* True when `gracePeriodEnd` is still in the future.
|
|
8
|
-
* Uses the
|
|
8
|
+
* Uses the module's Temporal so callers don't depend on `globalThis.Temporal`.
|
|
9
9
|
*/
|
|
10
10
|
export function isWithinGracePeriod(gracePeriodEnd: Temporal.Instant | null): boolean {
|
|
11
|
-
// @cast-boundary temporal-polyfill-vs-ambient: same TC39 Temporal.Instant
|
|
12
|
-
// at runtime — row types resolve against ambient Temporal; polyfill Instant
|
|
13
|
-
// is a separate nominal type across the two .d.ts sources.
|
|
14
11
|
return (
|
|
15
|
-
gracePeriodEnd != null &&
|
|
16
|
-
TemporalPolyfill.Instant.compare(
|
|
17
|
-
gracePeriodEnd as unknown as InstanceType<typeof TemporalPolyfill.Instant>,
|
|
18
|
-
TemporalPolyfill.Now.instant(),
|
|
19
|
-
) > 0
|
|
12
|
+
gracePeriodEnd != null && Temporal.Instant.compare(gracePeriodEnd, Temporal.Now.instant()) > 0
|
|
20
13
|
);
|
|
21
14
|
}
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
// (single-use-token-store) instead.
|
|
32
32
|
|
|
33
33
|
import { createFallbackLogger } from "@cosmicdrift/kumiko-framework/logging";
|
|
34
|
-
import type { Temporal } from "temporal
|
|
34
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
35
35
|
import { peekTokenSubject, signToken, verifyToken } from "./signed-token.js";
|
|
36
36
|
|
|
37
37
|
export type RowBoundGrantResult =
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// signal through a short-circuit.
|
|
14
14
|
|
|
15
15
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
16
|
-
import { Temporal } from "temporal
|
|
16
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
17
17
|
|
|
18
18
|
export type VerifyResult =
|
|
19
19
|
| { readonly ok: true; readonly userId: string; readonly expiresAtMs: number }
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
SubscriptionStatuses,
|
|
24
24
|
} from "@cosmicdrift/kumiko-bundled-features/billing-foundation";
|
|
25
25
|
import { createFallbackLogger } from "@cosmicdrift/kumiko-framework/logging";
|
|
26
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
26
27
|
import type {
|
|
27
28
|
Payment as MolliePayment,
|
|
28
29
|
Subscription as MollieSubscription,
|
|
29
30
|
} from "@mollie/api-client";
|
|
30
|
-
import { Temporal } from "temporal-polyfill";
|
|
31
31
|
import { MOLLIE_PROVIDER_NAME } from "./constants.js";
|
|
32
32
|
import type { MolliePriceConfig } from "./plugin-methods.js";
|
|
33
33
|
|
|
@@ -47,8 +47,8 @@ import {
|
|
|
47
47
|
import { ExtraRouteRejection } from "@cosmicdrift/kumiko-framework/api";
|
|
48
48
|
import { createFallbackLogger } from "@cosmicdrift/kumiko-framework/logging";
|
|
49
49
|
import type { SecretsContext } from "@cosmicdrift/kumiko-framework/secrets";
|
|
50
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
50
51
|
import Stripe from "stripe";
|
|
51
|
-
import { Temporal } from "temporal-polyfill";
|
|
52
52
|
import { STRIPE_PROVIDER_NAME, StripeEventTypes } from "./constants.js";
|
|
53
53
|
import type { StripeWebhookRuntime } from "./runtime.js";
|
|
54
54
|
|
|
@@ -6,7 +6,7 @@ import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
|
6
6
|
import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
|
|
7
7
|
import type { SessionUser, TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
8
8
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
9
|
-
import type { Temporal } from "temporal
|
|
9
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
10
10
|
import type { ContentFormat, TemplateKind } from "./constants.js";
|
|
11
11
|
import { FALLBACK_LOCALE, SYSTEM_TENANT_ID } from "./constants.js";
|
|
12
12
|
import { type TemplateResourceRow, templateResourcesTable } from "./table.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
crossTenantOverrideDenied,
|
|
5
5
|
defineQueryHandler,
|
|
6
6
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
7
|
-
import type { Temporal } from "temporal
|
|
7
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
8
8
|
import * as z from "zod";
|
|
9
9
|
import { TEXT_BLOCK_KIND } from "../constants.js";
|
|
10
10
|
import { type TemplateResourceRow, templateResourcesTable } from "../table.js";
|
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
TenantId,
|
|
8
8
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
9
9
|
import { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
10
|
-
import type { Temporal } from "temporal
|
|
10
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
11
11
|
import { templateResourceEntity, templateResourcesTable } from "../table.js";
|
|
12
12
|
import { userContentEntriesTable, userContentEntryEntity } from "../user-content-table.js";
|
|
13
13
|
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
createSelectField,
|
|
6
6
|
createTextField,
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
8
|
-
import type { Temporal } from "temporal
|
|
8
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
9
9
|
import {
|
|
10
10
|
CONTENT_FORMATS,
|
|
11
11
|
TEMPLATE_KINDS,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
7
7
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
8
8
|
import { parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
9
|
-
import { Temporal } from "temporal
|
|
9
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
10
10
|
import * as z from "zod";
|
|
11
11
|
import { userSessionTable } from "../../sessions/index.js";
|
|
12
12
|
import { decryptStoredPii, mapWithConcurrency } from "../../shared/index.js";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { createSystemUser, type TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
8
8
|
import { ConflictError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
9
9
|
import { parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
10
|
-
import { Temporal } from "temporal
|
|
10
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
11
11
|
import { TenantErrors } from "./constants.js";
|
|
12
12
|
import { findForbiddenMembershipRole, reservedMembershipRoleError } from "./membership-roles.js";
|
|
13
13
|
import { tenantMembershipEntity, tenantMembershipsTable } from "./membership-table.js";
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// put in a URL, logged, or emailed. The run's own photos may show plates —
|
|
13
13
|
// the grant must stay exactly where the anonymous flow minted it.
|
|
14
14
|
|
|
15
|
-
import type { Temporal } from "temporal
|
|
15
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
16
16
|
import { signRowBoundGrant } from "../shared/index.js";
|
|
17
17
|
|
|
18
18
|
const HANDOVER_PURPOSE_PREFIX = "tenant-handover";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
|
|
3
3
|
import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
|
-
import type { Temporal } from "temporal
|
|
4
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
5
5
|
import { exportJobsTable } from "../../schema/export-job.js";
|
|
6
6
|
|
|
7
7
|
export type ExportJobCleanupCandidate = {
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
|
|
3
|
-
|
|
4
|
-
// `Temporal` TYPE that gracePeriodEndCutoff's parameter type resolves
|
|
5
|
-
// against (same #1438 dual-package-hazard pattern as event-store.ts).
|
|
6
|
-
import { Temporal as TemporalPolyfill } from "temporal-polyfill";
|
|
3
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
7
4
|
import { userTable } from "../../../user/index.js";
|
|
8
5
|
|
|
9
6
|
export async function selectUsersDueForForgetCleanup(
|
|
10
7
|
db: DbConnection,
|
|
11
8
|
status: string,
|
|
12
|
-
gracePeriodEndCutoff:
|
|
9
|
+
gracePeriodEndCutoff: Temporal.Instant | string,
|
|
13
10
|
): Promise<readonly { id: string }[]> {
|
|
14
|
-
// @cast-boundary temporal-polyfill-vs-ambient: same TC39 Temporal.Instant
|
|
15
|
-
// at runtime, distinct nominal types across the two .d.ts sources (see
|
|
16
|
-
// event-store.ts). Only ever consumed via the `lte` comparison below.
|
|
17
11
|
const cutoff =
|
|
18
12
|
typeof gracePeriodEndCutoff === "string"
|
|
19
|
-
?
|
|
13
|
+
? Temporal.Instant.from(gracePeriodEndCutoff)
|
|
20
14
|
: gracePeriodEndCutoff;
|
|
21
15
|
return selectMany<{ id: string }>(db, userTable, {
|
|
22
16
|
status,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// The purpose string and the anchoring are unchanged from the hand-rolled
|
|
8
8
|
// version this replaced, so tokens stay byte-compatible.
|
|
9
9
|
|
|
10
|
-
import type { Temporal } from "temporal
|
|
10
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
11
11
|
import {
|
|
12
12
|
type RowBoundGrantResult,
|
|
13
13
|
redeemRowBoundGrant,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { mailT, registerMailTranslations } from "@cosmicdrift/kumiko-framework/i18n";
|
|
7
7
|
import { escapeHtml, escapeHtmlAttr } from "@cosmicdrift/kumiko-headless";
|
|
8
|
-
import { Temporal } from "temporal
|
|
8
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
9
9
|
|
|
10
10
|
export type GdprMailLocale = string;
|
|
11
11
|
|
package/packages/bundled-features/src/user-data-rights/handlers/list-download-attempts.query.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { selectMany, type WhereObject } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
-
import { Temporal } from "temporal
|
|
3
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
import { downloadAttemptsTable } from "../schema/download-attempt.js";
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { selectMany, type WhereObject } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { eventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
4
|
-
import { Temporal } from "temporal
|
|
4
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
|
|
7
7
|
// DSGVO Art. 15 Selbstauskunft — User reads HIS OWN audit-log.
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
type WriteFailure,
|
|
14
14
|
writeFailure,
|
|
15
15
|
} from "@cosmicdrift/kumiko-framework/errors";
|
|
16
|
-
import { Temporal } from "temporal
|
|
16
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
17
17
|
import { AuthErrors, AuthHandlers } from "../../auth-email-password/index.js";
|
|
18
18
|
import { TenantHandlers, tenantTable } from "../../tenant/index.js";
|
|
19
19
|
import { DEFAULT_OWN_TENANT_INVITE_ROLE, WAITLIST_STATUS, WaitlistErrors } from "../constants.js";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
type WriteResult,
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
8
8
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
9
|
-
import { Temporal } from "temporal
|
|
9
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
10
10
|
import { WAITLIST_NOTIFICATION_TYPES, WAITLIST_STATUS } from "../constants.js";
|
|
11
11
|
import { normalizeEmail, platformActor, waitlistDb, waitlistExecutor } from "../lib.js";
|
|
12
12
|
import {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"@cosmicdrift/kumiko-framework": "workspace:*",
|
|
16
16
|
"@cosmicdrift/kumiko-headless": "workspace:*",
|
|
17
17
|
"@cosmicdrift/kumiko-renderer-web": "workspace:*",
|
|
18
|
+
"@cosmicdrift/kumiko-types": "workspace:*",
|
|
18
19
|
"react": "^19.2.6",
|
|
19
20
|
"react-dom": "^19.2.6",
|
|
20
21
|
"@cosmicdrift/kumiko-locale-de": "workspace:*"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import type { SeedFn } from "@cosmicdrift/kumiko-dev-server";
|
|
12
12
|
import { TestUsers } from "@cosmicdrift/kumiko-framework/stack";
|
|
13
|
-
import { Temporal } from "temporal
|
|
13
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
14
14
|
import { countAssetsForTenant, countTicketsForTenant } from "../db/queries/seed-counts";
|
|
15
15
|
import { ASSET_STATUSES } from "../features/assets/schema";
|
|
16
16
|
import { TICKET_SEVERITIES, TICKET_STATUSES } from "../features/helpdesk/schema";
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"@cosmicdrift/kumiko-headless": "workspace:*",
|
|
23
23
|
"@cosmicdrift/kumiko-renderer-web": "workspace:*",
|
|
24
24
|
"@cosmicdrift/kumiko-server-runtime": "workspace:*",
|
|
25
|
+
"@cosmicdrift/kumiko-types": "workspace:*",
|
|
25
26
|
"react": "^19.2.6",
|
|
26
27
|
"react-dom": "^19.2.6",
|
|
27
28
|
"zod": "^4.4.3",
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
35
35
|
import { TestUsers, unsafeCreateEntityTable } from "@cosmicdrift/kumiko-framework/stack";
|
|
36
36
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
37
|
-
import { Temporal } from "temporal
|
|
37
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
38
38
|
import { ADMIN_EMAIL, BETA_TENANT_ID, DEMO_NOTE_ID, DEV_TENANT_ID } from "./auth-constants";
|
|
39
39
|
import { noteEntity } from "./notes-feature";
|
|
40
40
|
|