@cosmicdrift/kumiko-bundled-features 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.
Files changed (88) hide show
  1. package/dist/audit/handlers/list.query.js +1 -1
  2. package/dist/auth-email-password/email-templates.js +1 -1
  3. package/dist/auth-email-password/handlers/invite-create.write.js +1 -1
  4. package/dist/auth-email-password/handlers/signup-request.write.js +1 -1
  5. package/dist/auth-email-password/handlers/token-request-handler.d.ts +1 -1
  6. package/dist/auth-email-password/reset-token.d.ts +1 -1
  7. package/dist/auth-email-password/unlock-token.d.ts +1 -1
  8. package/dist/auth-email-password/verification-token.d.ts +1 -1
  9. package/dist/auth-mfa/handlers/enable-confirm-preauth.write.js +1 -1
  10. package/dist/auth-mfa/handlers/enable-confirm.write.js +1 -1
  11. package/dist/auth-mfa/hmac-token-codec.d.ts +1 -1
  12. package/dist/auth-mfa/hmac-token-codec.js +1 -1
  13. package/dist/auth-mfa/mfa-challenge-token.d.ts +1 -1
  14. package/dist/auth-mfa/mfa-challenge-token.js +1 -1
  15. package/dist/auth-mfa/mfa-preauth-setup-token.d.ts +1 -1
  16. package/dist/auth-mfa/mfa-preauth-setup-token.js +1 -1
  17. package/dist/auth-mfa/mfa-setup-token.d.ts +1 -1
  18. package/dist/auth-mfa/mfa-setup-token.js +1 -1
  19. package/dist/billing-foundation/constants.d.ts +2 -2
  20. package/dist/billing-foundation/constants.js +3 -12
  21. package/dist/billing-foundation/consumer-protection/confirmation-mail.js +1 -1
  22. package/dist/billing-foundation/consumer-protection/termination-mail.js +1 -1
  23. package/dist/billing-foundation/feature.js +2 -9
  24. package/dist/billing-foundation/handlers/sync-subscription.write.js +3 -6
  25. package/dist/cap-counter/book-cap-usage.js +1 -1
  26. package/dist/cap-counter/enforce-cap.d.ts +1 -1
  27. package/dist/cap-counter/enforce-cap.js +1 -8
  28. package/dist/delivery/handlers/log.query.d.ts +1 -2
  29. package/dist/delivery/handlers/log.query.js +1 -1
  30. package/dist/feature-toggles/handlers/set.write.js +1 -1
  31. package/dist/form-draft/db/queries/cleanup.d.ts +1 -1
  32. package/dist/form-draft/db/queries/cleanup.js +1 -1
  33. package/dist/form-draft/db/queries/owned-file-refs.d.ts +1 -1
  34. package/dist/form-draft/lookup.d.ts +1 -1
  35. package/dist/inbound-mail-foundation/handlers/ingest-message.write.js +1 -1
  36. package/dist/inbound-mail-foundation/oauth-access-token.d.ts +1 -1
  37. package/dist/inbound-mail-foundation/oauth-access-token.js +1 -1
  38. package/dist/inbound-mail-foundation/oauth-state.d.ts +1 -1
  39. package/dist/inbound-mail-foundation/oauth-state.js +1 -1
  40. package/dist/inbound-mail-foundation/watch-supervisor.js +1 -1
  41. package/dist/inbound-provider-imap/feature.js +1 -1
  42. package/dist/inbound-provider-imap/imap-client.js +1 -1
  43. package/dist/jobs/job-instant.d.ts +1 -1
  44. package/dist/jobs/job-instant.js +1 -1
  45. package/dist/metrics/compute.d.ts +1 -1
  46. package/dist/metrics/feature.js +1 -1
  47. package/dist/metrics/types.d.ts +1 -1
  48. package/dist/metrics/window.d.ts +1 -1
  49. package/dist/metrics/window.js +1 -1
  50. package/dist/personal-access-tokens/expiry.js +1 -1
  51. package/dist/personal-access-tokens/handlers/create.write.js +1 -1
  52. package/dist/personal-access-tokens/handlers/revoke.write.js +1 -1
  53. package/dist/personal-access-tokens/revoke-for-user.js +1 -1
  54. package/dist/sessions/handlers/revoke-all-for-user.write.js +1 -1
  55. package/dist/sessions/handlers/revoke-all-others.write.js +1 -1
  56. package/dist/sessions/handlers/revoke.write.js +1 -1
  57. package/dist/sessions/session-callbacks.js +1 -1
  58. package/dist/shared/grace-period.d.ts +2 -1
  59. package/dist/shared/grace-period.js +3 -7
  60. package/dist/shared/row-bound-grant.d.ts +1 -1
  61. package/dist/shared/signed-token.d.ts +1 -1
  62. package/dist/shared/signed-token.js +1 -1
  63. package/dist/subscription-mollie/verify-webhook.js +1 -1
  64. package/dist/subscription-stripe/verify-webhook.js +1 -1
  65. package/dist/template-resolver/api.d.ts +1 -1
  66. package/dist/template-resolver/handlers/by-slug.query.d.ts +1 -1
  67. package/dist/template-resolver/handlers/by-tenant.query.d.ts +2 -2
  68. package/dist/template-resolver/handlers/collection-item.query.d.ts +1 -1
  69. package/dist/template-resolver/handlers/collection-list.query.d.ts +1 -1
  70. package/dist/template-resolver/handlers/collection-shared.d.ts +2 -2
  71. package/dist/template-resolver/handlers/find-by-id.query.d.ts +1 -1
  72. package/dist/template-resolver/handlers/list.query.d.ts +1 -1
  73. package/dist/template-resolver/table.d.ts +1 -1
  74. package/dist/tenant/handlers/team-list.query.d.ts +1 -1
  75. package/dist/tenant/handlers/team-list.query.js +1 -1
  76. package/dist/tenant/invited-membership.d.ts +1 -1
  77. package/dist/tenant/invited-membership.js +1 -1
  78. package/dist/tenant-handover/grant.d.ts +1 -1
  79. package/dist/user-data-rights/db/queries/export-jobs.d.ts +1 -1
  80. package/dist/user-data-rights/db/queries/forget-cleanup.d.ts +2 -2
  81. package/dist/user-data-rights/db/queries/forget-cleanup.js +2 -8
  82. package/dist/user-data-rights/deletion-token.d.ts +1 -1
  83. package/dist/user-data-rights/email-templates.js +1 -1
  84. package/dist/user-data-rights/handlers/list-download-attempts.query.js +1 -1
  85. package/dist/user-data-rights/handlers/my-audit-log.query.js +1 -1
  86. package/dist/waitlist/handlers/invite.write.js +1 -1
  87. package/dist/waitlist/handlers/submit.write.js +1 -1
  88. package/package.json +9 -9
@@ -16,7 +16,7 @@
16
16
  import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
17
17
  import { access, defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
18
18
  import { eventsTable } from "@cosmicdrift/kumiko-framework/event-store";
19
- import { Temporal } from "temporal-polyfill";
19
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
20
20
  import * as z from "zod";
21
21
  import { AUDIT_SCOPE_VALUES } from "../constants.js";
22
22
  import { resolveAuditScopeFilter } from "./resolve-audit-tenant.js";
@@ -8,7 +8,7 @@
8
8
  // English ships here. Other languages register via @cosmicdrift/kumiko-locale-*
9
9
  // (localeDe() / localeEs() call registerMailTranslations).
10
10
  import { mailT, registerMailTranslations } from "@cosmicdrift/kumiko-framework/i18n";
11
- import { Temporal } from "temporal-polyfill";
11
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
12
12
  export const AUTH_MAIL_EN = {
13
13
  "auth.mail.appNameDefault": "Account",
14
14
  "auth.mail.reset.subject": "{app} — Reset your password",
@@ -20,7 +20,7 @@ import { generateToken } from "@cosmicdrift/kumiko-framework/api";
20
20
  import { createEventStoreExecutor } from "@cosmicdrift/kumiko-framework/db";
21
21
  import { access, assignableAppRolesOf, defineWriteHandler, } from "@cosmicdrift/kumiko-framework/engine";
22
22
  import { InternalError, writeFailure, } from "@cosmicdrift/kumiko-framework/errors";
23
- import { Temporal } from "temporal-polyfill";
23
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
24
24
  import * as z from "zod";
25
25
  // kumiko-lint-ignore cross-feature-import invite-flow lebt in auth-email-password (Magic-Link-Pattern), DB-row-owner ist tenant-feature
26
26
  import { INVITATION_STATUS, tenantInvitationEntity, tenantInvitationsTable, } from "../../tenant/invitation-table.js";
@@ -23,7 +23,7 @@
23
23
  import { generateToken } from "@cosmicdrift/kumiko-framework/api";
24
24
  import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
25
25
  import { InternalError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
26
- import { Temporal } from "temporal-polyfill";
26
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
27
27
  import * as z from "zod";
28
28
  import { findSignupHandoverProvider } from "../../shared/index.js";
29
29
  import { AUTH_SIGNUP_DEFAULT_TTL_MINUTES } from "../constants.js";
@@ -1,4 +1,4 @@
1
- import type { Temporal } from "temporal-polyfill";
1
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  import * as z from "zod";
3
3
  import { type AuthUserRow } from "../auth-user-row.js";
4
4
  import type { AuthMailContent, AuthMailLocale, RenderTokenContentArgs } from "../email-templates.js";
@@ -1,4 +1,4 @@
1
- import type { Temporal } from "temporal-polyfill";
1
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  export type VerifyResult = {
3
3
  readonly ok: true;
4
4
  readonly userId: string;
@@ -1,4 +1,4 @@
1
- import type { Temporal } from "temporal-polyfill";
1
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  export type VerifyResult = {
3
3
  readonly ok: true;
4
4
  readonly userId: string;
@@ -1,4 +1,4 @@
1
- import type { Temporal } from "temporal-polyfill";
1
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  export type VerifyResult = {
3
3
  readonly ok: true;
4
4
  readonly userId: string;
@@ -2,7 +2,7 @@ import { createEventStoreExecutor, createTenantDb } from "@cosmicdrift/kumiko-fr
2
2
  import { buildSessionRoles, createSystemUser, defineWriteHandler, } from "@cosmicdrift/kumiko-framework/engine";
3
3
  import { InternalError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
4
4
  import { parseRoles } from "@cosmicdrift/kumiko-framework/utils";
5
- import { Temporal } from "temporal-polyfill";
5
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
6
6
  import * as z from "zod";
7
7
  import { burnToken, sessionLocaleField, sessionTimezoneField } from "../../shared/index.js";
8
8
  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-polyfill";
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,4 +1,4 @@
1
- import { Temporal } from "temporal-polyfill";
1
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  export type HmacTokenVerifyResult<TPayload> = {
3
3
  readonly ok: true;
4
4
  readonly payload: TPayload;
@@ -1,5 +1,5 @@
1
1
  import { createHmac, timingSafeEqual } from "node:crypto";
2
- import { Temporal } from "temporal-polyfill";
2
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
3
3
  function hmacSign(input, secret) {
4
4
  return createHmac("sha256", secret).update(input).digest("base64url");
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
2
- import { Temporal } from "temporal-polyfill";
2
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
3
3
  import { type HmacTokenVerifyResult } from "./hmac-token-codec.js";
4
4
  export type MfaChallengePayload = {
5
5
  readonly userId: string;
@@ -1,4 +1,4 @@
1
- import { Temporal } from "temporal-polyfill";
1
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  import { createHmacTokenCodec } from "./hmac-token-codec.js";
3
3
  function isPayload(value) {
4
4
  if (typeof value !== "object" || value === null)
@@ -1,5 +1,5 @@
1
1
  import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
2
- import { Temporal } from "temporal-polyfill";
2
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
3
3
  import { type HmacTokenVerifyResult } from "./hmac-token-codec.js";
4
4
  export type MfaPreauthSetupPayload = {
5
5
  readonly userId: string;
@@ -1,4 +1,4 @@
1
- import { Temporal } from "temporal-polyfill";
1
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  import { createHmacTokenCodec } from "./hmac-token-codec.js";
3
3
  function isPayload(value) {
4
4
  if (typeof value !== "object" || value === null)
@@ -1,4 +1,4 @@
1
- import { Temporal } from "temporal-polyfill";
1
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  export type MfaSetupPayload = {
3
3
  readonly userId: string;
4
4
  readonly totpSecretBase32: string;
@@ -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-polyfill";
13
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
14
14
  function sign(input, secret) {
15
15
  return createHmac("sha256", secret).update(input).digest("base64url");
16
16
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="temporal-polyfill/global" preserve="true" />
2
- import { Temporal as TemporalPolyfill } from "temporal-polyfill";
2
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
3
3
  export declare const BILLING_FOUNDATION_FEATURE: "billing-foundation";
4
4
  export declare const SUBSCRIPTION_PROVIDER_EXTENSION: "subscriptionProvider";
5
5
  /** delivery notification type of the § 312f contract confirmation mail. */
@@ -119,7 +119,7 @@ export declare const BillingPlanActions: {
119
119
  export type BillingPlanAction = (typeof BillingPlanActions)[keyof typeof BillingPlanActions];
120
120
  export declare const TERMINAL_SUBSCRIPTION_STATUSES: ReadonlySet<string>;
121
121
  export declare function isTerminalSubscriptionStatus(status: string): boolean;
122
- export declare const STALE_INCOMPLETE_AFTER: TemporalPolyfill.Duration;
122
+ export declare const STALE_INCOMPLETE_AFTER: globalThis.Temporal.Duration;
123
123
  /** Time-aware terminal check for the checkout gate: a canceled subscription
124
124
  * is terminal (see `isTerminalSubscriptionStatus`), and so is an
125
125
  * `incomplete` one once it's older than `STALE_INCOMPLETE_AFTER` — every
@@ -1,12 +1,6 @@
1
1
  /// <reference types="temporal-polyfill/global" preserve="true" />
2
2
  // @runtime client
3
- // temporal-polyfill is a plain npm dependency (not a framework runtime
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
  // Feature name
11
5
  export const BILLING_FOUNDATION_FEATURE = "billing-foundation";
12
6
  // Extension-point name fuer Provider-Plugins (subscription-stripe,
@@ -158,7 +152,7 @@ export function isTerminalSubscriptionStatus(status) {
158
152
  // after roughly 23 hours; without a matching staleness cutoff on our side, a
159
153
  // stale incomplete row would block that tenant from ever starting a new
160
154
  // checkout, since the projection has no expiry-triggered event of its own.
161
- export const STALE_INCOMPLETE_AFTER = TemporalPolyfill.Duration.from({ hours: 24 });
155
+ export const STALE_INCOMPLETE_AFTER = Temporal.Duration.from({ hours: 24 });
162
156
  /** Time-aware terminal check for the checkout gate: a canceled subscription
163
157
  * is terminal (see `isTerminalSubscriptionStatus`), and so is an
164
158
  * `incomplete` one once it's older than `STALE_INCOMPLETE_AFTER` — every
@@ -170,10 +164,7 @@ export function isSubscriptionBlockingCheckout(sub, now) {
170
164
  if (sub.status !== SubscriptionStatuses.incomplete)
171
165
  return true;
172
166
  const staleAt = sub.lastChangedAt.add(STALE_INCOMPLETE_AFTER);
173
- // @cast-boundary temporal-polyfill-vs-ambient: same TC39 Temporal.Instant
174
- // at runtime — row types resolve against ambient Temporal; polyfill Instant
175
- // is a separate nominal type across the two .d.ts sources.
176
- return (TemporalPolyfill.Instant.compare(now, staleAt) < 0);
167
+ return Temporal.Instant.compare(now, staleAt) < 0;
177
168
  }
178
169
  // A subscription in one of these statuses can be switched to a different
179
170
  // plan tier via the provider's confirmation page (Stripe portal
@@ -1,4 +1,4 @@
1
- import { Temporal } from "temporal-polyfill";
1
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  import { CONSENT_TEXTS, resolveConsentLocale } from "./consent-text.js";
3
3
  const LABELS = {
4
4
  de: {
@@ -1,4 +1,4 @@
1
- import { Temporal } from "temporal-polyfill";
1
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  import { TERMINATION_TEXTS } from "./termination-texts.js";
3
3
  const TIME_ZONE_BY_LOCALE = {
4
4
  de: "Europe/Berlin",
@@ -50,10 +50,7 @@
50
50
  // (z.B. für analytics: "wie viele Wechsel im Monat?"), kommt ein
51
51
  // `subscription-provider-changed`-event-type später.
52
52
  import { defineFeature, EXT_TENANT_DATA, } from "@cosmicdrift/kumiko-framework/engine";
53
- // Aliased — an un-aliased `Temporal` would shadow the ambient global
54
- // `Temporal` TYPE `ResolvedBillingFoundationOptions.now`'s return type
55
- // resolves against, see event-store.ts's own import comment (#1438).
56
- import { Temporal as TemporalPolyfill } from "temporal-polyfill";
53
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
57
54
  import { BILLING_FOUNDATION_FEATURE, SUBSCRIPTION_PROVIDER_EXTENSION, SubscriptionFoundationHandlers, } from "./constants.js";
58
55
  import { registerConsumerProtection } from "./consumer-protection/register-consent.js";
59
56
  import { paymentEntity, subscriptionEntity } from "./entities.js";
@@ -87,11 +84,7 @@ export function createBillingFoundationFeature(options = {}) {
87
84
  // ever calls `Temporal.Now.instant` itself.
88
85
  const widened = {
89
86
  ...options,
90
- // @cast-boundary temporal-polyfill-vs-ambient: same TC39 Temporal.Instant
91
- // at runtime — `now` is typed against the ambient Temporal global;
92
- // TemporalPolyfill.Now.instant() returns the polyfill's own nominal
93
- // Instant type across the two .d.ts sources.
94
- now: options.now ?? (() => TemporalPolyfill.Now.instant()),
87
+ now: options.now ?? (() => Temporal.Now.instant()),
95
88
  ...(options.baseUrl !== undefined && {
96
89
  baseUrl: options.baseUrl.endsWith("/") ? options.baseUrl.slice(0, -1) : options.baseUrl,
97
90
  }),
@@ -14,23 +14,20 @@
14
14
  // the same reason. A human SystemAdmin can still dispatch this directly.
15
15
  import { createHash } from "node:crypto";
16
16
  import { SYSTEM_ROLE } from "@cosmicdrift/kumiko-framework/engine";
17
- // Aliased — an un-aliased `Temporal` would shadow the ambient global
18
- // `Temporal` TYPE `SubscriptionView.currentPeriodEnd`/`.cancelAt` resolve
19
- // against, same reasoning as constants.ts's own import.
20
- import { Temporal as TemporalPolyfill } from "temporal-polyfill";
17
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
21
18
  import * as z from "zod";
22
19
  import { findProviderPlugin } from "../checkout-core.js";
23
20
  import { isTerminalSubscriptionStatus, SubscriptionEventTypes } from "../constants.js";
24
21
  import { getSubscriptionForTenant } from "../get-subscription-for-tenant.js";
25
22
  import { appendSubscriptionEvent } from "./process-event.write.js";
26
23
  export const syncSubscriptionSchema = z.object({}).strict();
27
- // Parses both sides fresh via the polyfill before comparing — tolerant of a
24
+ // Parses both sides fresh via Temporal before comparing — tolerant of a
28
25
  // provider snapshot's ISO string using a different (but equivalent)
29
26
  // representation than `Temporal.Instant#toString()`'s canonical form
30
27
  // (offset spelling, sub-second precision, ...), unlike a plain `===` on the
31
28
  // raw strings.
32
29
  function isoInstantsEqual(a, b) {
33
- return (TemporalPolyfill.Instant.compare(TemporalPolyfill.Instant.from(a), TemporalPolyfill.Instant.from(b)) === 0);
30
+ return Temporal.Instant.compare(Temporal.Instant.from(a), Temporal.Instant.from(b)) === 0;
34
31
  }
35
32
  // Deterministic per (snapshot-content, current stream head) — not per-call.
36
33
  // Folding in `lastChangedAt` (not just the snapshot's own fields) closes a
@@ -2,7 +2,7 @@
2
2
  import { runInOwnTransaction } from "@cosmicdrift/kumiko-framework/db";
3
3
  import { createEntityExecutor, } from "@cosmicdrift/kumiko-framework/engine";
4
4
  import { eventsTable } from "@cosmicdrift/kumiko-framework/event-store";
5
- import { Temporal } from "temporal-polyfill";
5
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
6
6
  import * as z from "zod";
7
7
  import { capCounterAggregateId, rollingCapAggregateId } from "./aggregate-id.js";
8
8
  import { CAP_COUNTER_ROLLING_AGGREGATE_TYPE, ROLLING_INCREMENTED_EVENT_QN } from "./constants.js";
@@ -1,6 +1,6 @@
1
- /// <reference types="temporal-polyfill/global" preserve="true" />
2
1
  import { type HandlerContext } from "@cosmicdrift/kumiko-framework/engine";
3
2
  import { KumikoError } from "@cosmicdrift/kumiko-framework/errors";
3
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
4
4
  /**
5
5
  * Cap-Toleranz-Profile — pro Cap-Typ asymmetrisch. Quelle: Memory
6
6
  * `project_pricing_byok_caps` §3 + `docs/plans/marketing/produkt/
@@ -1,15 +1,8 @@
1
- /// <reference types="temporal-polyfill/global" preserve="true" />
2
1
  import { createEntityExecutor } 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
- // Temporal globally provided by the framework's polyfill init
7
- // (ensureTemporalPolyfill() in time/polyfill.ts, called from
8
- // setupTestStack/boot). Importing from "temporal-polyfill" gives us
9
- // the polyfill-package types which don't quite match drizzle's
10
- // `instant()`-customType (temporal-spec narrowing of `until(...).sign`).
11
- // Mirror the audit-handler pattern: rely on the global ambient
12
- // declaration from temporal-spec.
13
6
  const { table } = createEntityExecutor("cap-counter", capCounterEntity);
14
7
  export const CAP_TOLERANCES = {
15
8
  /** Mails / Tokens — billig, BYOK ab Pro. Burst-Buffer großzügig. */
@@ -1,5 +1,4 @@
1
1
  import { type DeliveryErrorCode, type NotifyPriority } from "@cosmicdrift/kumiko-framework/engine";
2
- import { Temporal } from "temporal-polyfill";
3
2
  import * as z from "zod";
4
3
  import type { DeliveryStatusValue } from "../constants.js";
5
4
  export declare const logQuery: import("@cosmicdrift/kumiko-framework/engine").PagedQueryHandlerDefinition<"log", z.ZodObject<{
@@ -22,5 +21,5 @@ export declare const logQuery: import("@cosmicdrift/kumiko-framework/engine").Pa
22
21
  error: DeliveryErrorCode | null;
23
22
  priority: NotifyPriority;
24
23
  confirmed: boolean | null;
25
- createdAt: Temporal.Instant;
24
+ createdAt: globalThis.Temporal.Instant;
26
25
  }, import("@cosmicdrift/kumiko-types/event-type-map").KumikoEventTypeMap>;
@@ -2,7 +2,7 @@ import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
2
2
  import { decodeKeysetCursor, encodeKeysetCursor, } from "@cosmicdrift/kumiko-framework/db";
3
3
  import { access, definePagedQueryHandler, isDeliveryErrorCode, isUuid, MAX_LIST_LIMIT, SYSTEM_USER_ID, } from "@cosmicdrift/kumiko-framework/engine";
4
4
  import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
5
- import { Temporal } from "temporal-polyfill";
5
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
6
6
  import * as z from "zod";
7
7
  import { decryptStoredPii } from "../../shared/index.js";
8
8
  import { resolveUserDisplayNames, USER_FEATURE } from "../../user/index.js";
@@ -1,7 +1,7 @@
1
1
  import { insertOne, selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
2
2
  import { defineWriteHandler, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
3
3
  import { UnprocessableError, VersionConflictError, writeFailure, } from "@cosmicdrift/kumiko-framework/errors";
4
- import { Temporal } from "temporal-polyfill";
4
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
5
5
  import * as z from "zod";
6
6
  import { FEATURE_TOGGLE_AGGREGATE_TYPE, FEATURE_TOGGLE_CROSS_TENANT_REASON, FEATURE_TOGGLE_SET_EVENT_NAME, FeatureToggleErrors, } from "../constants.js";
7
7
  import { globalFeatureStateTable } from "../global-feature-state-table.js";
@@ -1,6 +1,6 @@
1
1
  import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
2
2
  import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
3
- import { Temporal } from "temporal-polyfill";
3
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
4
4
  import type { FormDraftBlob } from "../../schemas.js";
5
5
  export type StaleDraftRow = {
6
6
  readonly id: string;
@@ -1,5 +1,5 @@
1
1
  import { unsafeReadRetrying } from "@cosmicdrift/kumiko-framework/bun-db";
2
- import { Temporal } from "temporal-polyfill";
2
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
3
3
  // COALESCE(modified_at, inserted_at) — a draft's "last touched" timestamp is
4
4
  // modified_at once the upsert path (save.write.ts) has updated it at least
5
5
  // once; a draft saved exactly once (create, never updated) has no
@@ -1,6 +1,6 @@
1
1
  import type { DbRunner } from "@cosmicdrift/kumiko-framework/db";
2
2
  import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
3
- import type { Temporal } from "temporal-polyfill";
3
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
4
4
  export declare function filterOwnedStorageKeys(db: DbRunner, tenantId: TenantId, ownerId: string, candidateKeys: readonly string[], draftInsertedAt: Temporal.Instant, isCreateMode: boolean): Promise<readonly string[]>;
5
5
  export type OwnedFileRef = {
6
6
  readonly id: string;
@@ -1,6 +1,6 @@
1
1
  import type { TenantDb } from "@cosmicdrift/kumiko-framework/db";
2
2
  import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
3
- import type { Temporal } from "temporal-polyfill";
3
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
4
4
  import type { FormDraftBlob } from "./schemas.js";
5
5
  export type FormDraftRow = {
6
6
  readonly id: string;
@@ -23,7 +23,7 @@ import { countWhere } from "@cosmicdrift/kumiko-framework/bun-db";
23
23
  import { configuredPiiSubjectKms, encryptPiiFieldValues, } from "@cosmicdrift/kumiko-framework/crypto";
24
24
  import { acquireNamespacedAdvisoryLock } from "@cosmicdrift/kumiko-framework/db";
25
25
  import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
26
- import { Temporal } from "temporal-polyfill";
26
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
27
27
  import * as z from "zod";
28
28
  import { inboundMessageAggregateId, mailThreadAggregateId } from "../aggregate-id.js";
29
29
  import { INBOUND_MESSAGE_PII_FIELDS, inboundMessageEntity, MAIL_THREAD_PII_FIELDS, mailThreadEntity, seenMessageTable, } from "../entities.js";
@@ -1,6 +1,6 @@
1
1
  import { type DbConnection } from "@cosmicdrift/kumiko-framework/db";
2
2
  import type { SecretsContext } from "@cosmicdrift/kumiko-framework/secrets";
3
- import { Temporal } from "temporal-polyfill";
3
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
4
4
  import { type InboundMailContext, type InboundMailProviderPlugin, type MailAccountRecord, type OAuthTokenSet } from "./types.js";
5
5
  /** Shared by the OAuth callback and the refresh path so both write the slot identically. */
6
6
  export declare function inboundRefreshTokenSecretOptions(accountId: string): {
@@ -17,7 +17,7 @@
17
17
  // so the read always reflects the latest committed write.
18
18
  import { transaction } from "@cosmicdrift/kumiko-framework/bun-db";
19
19
  import { acquireNamespacedAdvisoryLock } from "@cosmicdrift/kumiko-framework/db";
20
- import { Temporal } from "temporal-polyfill";
20
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
21
21
  import { InboundMailAuthMethods, inboundCredentialSecretKey } from "./constants.js";
22
22
  import { InboundAuthError, } from "./types.js";
23
23
  // 'inoa' as ASCII — disjoint from the other fixed advisory-lock namespaces.
@@ -1,4 +1,4 @@
1
- import { Temporal } from "temporal-polyfill";
1
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  export type OAuthStatePayload = {
3
3
  readonly tenantId: string;
4
4
  /** null = shared-Postfach, sonst persönliches Postfach dieses Users. */
@@ -10,7 +10,7 @@
10
10
  // Muster: auth-email-password/signed-token.ts (HMAC-SHA256, purpose im
11
11
  // HMAC-Input, timing-safe compare, Expiry im Klartext-Segment).
12
12
  import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
13
- import { Temporal } from "temporal-polyfill";
13
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
14
14
  const STATE_PURPOSE = "inbound-mail-oauth-connect";
15
15
  function sign(input, secret) {
16
16
  return createHmac("sha256", secret).update(input).digest("base64url");
@@ -45,7 +45,7 @@
45
45
  // exceeded) tears down the local watcher instead of racing a new holder.
46
46
  import { fetchOne, insertOne, selectMany, updateMany } from "@cosmicdrift/kumiko-framework/bun-db";
47
47
  import { configuredPiiSubjectKms, decryptPiiFieldValues, } from "@cosmicdrift/kumiko-framework/crypto";
48
- import { Temporal } from "temporal-polyfill";
48
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
49
49
  import { InboundMailAccountStatuses, InboundMailFoundationHandlers } from "./constants.js";
50
50
  import { MAIL_ACCOUNT_PII_FIELDS, syncCursorTable } from "./entities.js";
51
51
  import { createOAuthAccessTokenManager, usesFoundationManagedOAuth, } from "./oauth-access-token.js";
@@ -26,7 +26,7 @@ import { INBOUND_MAIL_PROVIDER_EXTENSION, InboundAuthError, inboundCredentialSec
26
26
  import { requireSecretsContext } from "@cosmicdrift/kumiko-bundled-features/secrets";
27
27
  import { defineFeature } from "@cosmicdrift/kumiko-framework/engine";
28
28
  import { instantToLegacyDate } from "@cosmicdrift/kumiko-framework/time";
29
- import { Temporal } from "temporal-polyfill";
29
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
30
30
  import { parseImapCredentialDocument } from "./credential-document.js";
31
31
  import { assertUidValidity, coerceDate, createImapClient, IMAP_MAILBOX, imapMailHostGuard, mapImapError, parseImapCursor, toRawInboundMessage, } from "./imap-client.js";
32
32
  const FEATURE_NAME = "inbound-provider-imap";
@@ -5,9 +5,9 @@ import { BlockedHostError, readAllowedPrivateMailHostsFromEnv, resolveMailConnec
5
5
  import { InboundAuthError, InboundCursorInvalidError, InboundTransientError, } from "@cosmicdrift/kumiko-bundled-features/inbound-mail-foundation";
6
6
  import { createFallbackLogger } from "@cosmicdrift/kumiko-framework/logging";
7
7
  import { legacyDateToInstant } from "@cosmicdrift/kumiko-framework/time";
8
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
8
9
  import { ImapFlow } from "imapflow";
9
10
  import { simpleParser } from "mailparser";
10
- import { Temporal } from "temporal-polyfill";
11
11
  export const IMAP_MAILBOX = "INBOX";
12
12
  const SNIPPET_MAX = 300;
13
13
  const log = createFallbackLogger("inbound-provider-imap");
@@ -1,2 +1,2 @@
1
- import { Temporal } from "temporal-polyfill";
1
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  export declare function parseJobInstant(iso: string): Temporal.Instant;
@@ -1,4 +1,4 @@
1
- import { Temporal } from "temporal-polyfill";
1
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  // kumiko-framework#1525: the five value-position Temporal.Instant.from
3
3
  // call sites in feature.ts live inside defineApply callbacks with no
4
4
  // exported seam, so this thin wrapper gives the ambient-global-independence
@@ -1,6 +1,6 @@
1
1
  import type { WhereObject } from "@cosmicdrift/kumiko-framework/bun-db";
2
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
3
  import type { TenantDb } from "@cosmicdrift/kumiko-types/tenant-db-types";
3
- import type { Temporal } from "temporal-polyfill";
4
4
  import { type MetricRange } from "./constants.js";
5
5
  import type { MetricDefinition, MetricResult } from "./types.js";
6
6
  export type MetricRunParams = {
@@ -1,6 +1,6 @@
1
1
  import { access, defineFeature, defineQueryHandler, } from "@cosmicdrift/kumiko-framework/engine";
2
2
  import { InternalError, ValidationError } from "@cosmicdrift/kumiko-framework/errors";
3
- import { Temporal } from "temporal-polyfill";
3
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
4
4
  import * as z from "zod";
5
5
  import { runMetric } from "./compute.js";
6
6
  import { METRIC_RANGES, METRICS_FEATURE, METRICS_SYSTEM_FEATURE, } from "./constants.js";
@@ -2,8 +2,8 @@ import type { EntityTableMeta } from "@cosmicdrift/kumiko-framework/db";
2
2
  import type { HandlerContext } from "@cosmicdrift/kumiko-framework/engine";
3
3
  import type { AggregateMeasure, AggregateTimeBucket } from "@cosmicdrift/kumiko-types/aggregate-types";
4
4
  import type { SchemaTable } from "@cosmicdrift/kumiko-types/schema-table-types";
5
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
5
6
  import type { WhereObject } from "@cosmicdrift/kumiko-types/where-clause-types";
6
- import type { Temporal } from "temporal-polyfill";
7
7
  import type { MetricRange, MetricScope } from "./constants.js";
8
8
  /** 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. */
9
9
  export type MetricFilterResolver = {
@@ -1,5 +1,5 @@
1
1
  import type { AggregateTimeBucket } from "@cosmicdrift/kumiko-types/aggregate-types";
2
- import { Temporal } from "temporal-polyfill";
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
  export type MetricWindow = {
@@ -1,4 +1,4 @@
1
- import { Temporal } from "temporal-polyfill";
1
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  const RANGE_HOURS = {
3
3
  "24h": 24,
4
4
  "7d": 7 * 24,
@@ -1,4 +1,4 @@
1
- import { Temporal } from "temporal-polyfill";
1
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  export function isExpiredAt(expiresAt) {
3
3
  return (expiresAt !== null && expiresAt.epochMilliseconds <= Temporal.Now.instant().epochMilliseconds);
4
4
  }
@@ -2,7 +2,7 @@ import { insertOne } from "@cosmicdrift/kumiko-framework/bun-db";
2
2
  import { createSystemUser, 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-polyfill";
5
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
6
6
  import * as z from "zod";
7
7
  import { encryptForDirectWrite, verifyPassword } from "../../shared/index.js";
8
8
  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-polyfill";
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";
@@ -2,7 +2,7 @@ import { transaction, updateMany } from "@cosmicdrift/kumiko-framework/bun-db";
2
2
  import { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
3
3
  import { append } from "@cosmicdrift/kumiko-framework/event-store";
4
4
  import { generateId } from "@cosmicdrift/kumiko-framework/utils";
5
- import { Temporal } from "temporal-polyfill";
5
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
6
6
  import { PAT_REVOKED_AGGREGATE_TYPE, PAT_REVOKED_EVENT_QN, patRevokedSchema, } from "./pat-revoked-event.js";
7
7
  import { apiTokenTable } from "./schema/api-token.js";
8
8
  // A pool has begin(); a tx/savepoint handle does not and is already atomic.
@@ -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-polyfill";
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 { SESSION_REVOKED_AGGREGATE_TYPE, SESSION_REVOKED_EVENT_QN, sessionRevokedSchema, } from "../session-revoked-event.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-polyfill";
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-polyfill";
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";
@@ -2,7 +2,7 @@ import { fetchOne, insertOne, transaction, updateMany } from "@cosmicdrift/kumik
2
2
  import { buildSessionRoles, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
3
3
  import { append } from "@cosmicdrift/kumiko-framework/event-store";
4
4
  import { generateId, parseRoles } from "@cosmicdrift/kumiko-framework/utils";
5
- import { Temporal } from "temporal-polyfill";
5
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
6
6
  import { encryptForDirectWrite } from "../shared/index.js";
7
7
  import { tenantMembershipsTable } from "../tenant/index.js";
8
8
  import { isPrincipalBlocked, userTable } from "../user/index.js";
@@ -1,7 +1,8 @@
1
1
  /** Shared grace-period check for user-data-rights + tenant-lifecycle cancel flows. */
2
2
  /// <reference types="temporal-polyfill/global" preserve="true" />
3
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
3
4
  /**
4
5
  * True when `gracePeriodEnd` is still in the future.
5
- * Uses the polyfill Instant API so callers don't depend on `globalThis.Temporal`.
6
+ * Uses the module's Temporal so callers don't depend on `globalThis.Temporal`.
6
7
  */
7
8
  export declare function isWithinGracePeriod(gracePeriodEnd: Temporal.Instant | null): boolean;
@@ -1,14 +1,10 @@
1
1
  /// <reference types="temporal-polyfill/global" preserve="true" />
2
2
  /** Shared grace-period check for user-data-rights + tenant-lifecycle cancel flows. */
3
- import { Temporal as TemporalPolyfill } from "temporal-polyfill";
3
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
4
4
  /**
5
5
  * True when `gracePeriodEnd` is still in the future.
6
- * Uses the polyfill Instant API so callers don't depend on `globalThis.Temporal`.
6
+ * Uses the module's Temporal so callers don't depend on `globalThis.Temporal`.
7
7
  */
8
8
  export function isWithinGracePeriod(gracePeriodEnd) {
9
- // @cast-boundary temporal-polyfill-vs-ambient: same TC39 Temporal.Instant
10
- // at runtime — row types resolve against ambient Temporal; polyfill Instant
11
- // is a separate nominal type across the two .d.ts sources.
12
- return (gracePeriodEnd != null &&
13
- TemporalPolyfill.Instant.compare(gracePeriodEnd, TemporalPolyfill.Now.instant()) > 0);
9
+ return (gracePeriodEnd != null && Temporal.Instant.compare(gracePeriodEnd, Temporal.Now.instant()) > 0);
14
10
  }
@@ -1,4 +1,4 @@
1
- import type { Temporal } from "temporal-polyfill";
1
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  export type RowBoundGrantResult = {
3
3
  readonly ok: true;
4
4
  readonly subject: string;
@@ -1,4 +1,4 @@
1
- import { Temporal } from "temporal-polyfill";
1
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  export type VerifyResult = {
3
3
  readonly ok: true;
4
4
  readonly userId: string;
@@ -12,7 +12,7 @@
12
12
  // Timing-safe comparison on verify so a valid-length forgery can't leak
13
13
  // signal through a short-circuit.
14
14
  import { createHmac, timingSafeEqual } from "node:crypto";
15
- import { Temporal } from "temporal-polyfill";
15
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
16
16
  function sign(input, secret) {
17
17
  return createHmac("sha256", secret).update(input).digest("base64url");
18
18
  }
@@ -15,7 +15,7 @@
15
15
  // Created-Event mit subscription-id bekommt.
16
16
  import { parseProviderConsentId, SubscriptionEventTypes, SubscriptionStatuses, } from "@cosmicdrift/kumiko-bundled-features/billing-foundation";
17
17
  import { createFallbackLogger } from "@cosmicdrift/kumiko-framework/logging";
18
- import { Temporal } from "temporal-polyfill";
18
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
19
19
  import { MOLLIE_PROVIDER_NAME } from "./constants.js";
20
20
  const log = createFallbackLogger("subscription-mollie");
21
21
  export function verifyAndParseMollieWebhook(client, options) {
@@ -34,8 +34,8 @@
34
34
  import { BillingEventKinds, parseProviderConsentId, SubscriptionEventTypes, SubscriptionStatuses, } from "@cosmicdrift/kumiko-bundled-features/billing-foundation";
35
35
  import { ExtraRouteRejection } from "@cosmicdrift/kumiko-framework/api";
36
36
  import { createFallbackLogger } from "@cosmicdrift/kumiko-framework/logging";
37
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
37
38
  import Stripe from "stripe";
38
- import { Temporal } from "temporal-polyfill";
39
39
  import { STRIPE_PROVIDER_NAME, StripeEventTypes } from "./constants.js";
40
40
  const log = createFallbackLogger("subscription-stripe");
41
41
  export function isResourceMissingStripeError(error) {
@@ -1,6 +1,6 @@
1
1
  import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
2
2
  import type { SessionUser, TenantId } from "@cosmicdrift/kumiko-framework/engine";
3
- import type { Temporal } from "temporal-polyfill";
3
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
4
4
  import type { ContentFormat, TemplateKind } from "./constants.js";
5
5
  export type TemplateResource = {
6
6
  readonly id: string;
@@ -10,5 +10,5 @@ export declare const bySlugQuery: import("@cosmicdrift/kumiko-types/define-handl
10
10
  content: string | null;
11
11
  contentFormat: string;
12
12
  folder: string | null;
13
- modifiedAt: import("temporal-spec").Temporal.Instant | null;
13
+ modifiedAt: Temporal.Instant | null;
14
14
  } | null, import("@cosmicdrift/kumiko-types/event-type-map").KumikoEventTypeMap>;
@@ -1,4 +1,4 @@
1
- import type { Temporal } from "temporal-polyfill";
1
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  import * as z from "zod";
3
3
  export type TextBlockSummary = {
4
4
  readonly slug: string;
@@ -17,6 +17,6 @@ export declare const byTenantQuery: import("@cosmicdrift/kumiko-types/define-han
17
17
  title: string | null;
18
18
  content: string | null;
19
19
  folder: string | null;
20
- modifiedAt: Temporal.Instant | null;
20
+ modifiedAt: globalThis.Temporal.Instant | null;
21
21
  }[];
22
22
  }, import("@cosmicdrift/kumiko-types/event-type-map").KumikoEventTypeMap>;
@@ -11,5 +11,5 @@ export declare function makeCollectionItemQuery(collection: ContentCollectionDef
11
11
  content: string | null;
12
12
  contentFormat: string;
13
13
  folder: string | null;
14
- modifiedAt: import("temporal-spec").Temporal.Instant | null;
14
+ modifiedAt: Temporal.Instant | null;
15
15
  } | null, import("@cosmicdrift/kumiko-types/event-type-map").KumikoEventTypeMap>;
@@ -10,6 +10,6 @@ export declare function makeCollectionListQuery(collection: ContentCollectionDef
10
10
  content: string | null;
11
11
  contentFormat: string;
12
12
  folder: string | null;
13
- modifiedAt: import("temporal-spec").Temporal.Instant | null;
13
+ modifiedAt: Temporal.Instant | null;
14
14
  }[];
15
15
  }, import("@cosmicdrift/kumiko-types/event-type-map").KumikoEventTypeMap>;
@@ -1,6 +1,6 @@
1
1
  import type { EventStoreExecutor } from "@cosmicdrift/kumiko-framework/db";
2
2
  import type { AccessRule, ContentCollectionDefinition, SessionUser, TenantId } from "@cosmicdrift/kumiko-framework/engine";
3
- import type { Temporal } from "temporal-polyfill";
3
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
4
4
  import { templateResourcesTable } from "../table.js";
5
5
  import { userContentEntriesTable } from "../user-content-table.js";
6
6
  export declare const DEFAULT_COLLECTION_ACCESS: AccessRule;
@@ -31,5 +31,5 @@ export declare function toCollectionEntry(row: CollectionEntryRow): {
31
31
  content: string | null;
32
32
  contentFormat: string;
33
33
  folder: string | null;
34
- modifiedAt: Temporal.Instant | null;
34
+ modifiedAt: globalThis.Temporal.Instant | null;
35
35
  };
@@ -15,5 +15,5 @@ export declare const findByIdQuery: import("@cosmicdrift/kumiko-types/define-han
15
15
  scope: string;
16
16
  parentTemplateId: string | null;
17
17
  status: string;
18
- modifiedAt: import("temporal-spec").Temporal.Instant | null;
18
+ modifiedAt: Temporal.Instant | null;
19
19
  } | null, import("@cosmicdrift/kumiko-types/event-type-map").KumikoEventTypeMap>;
@@ -22,5 +22,5 @@ export declare const listQuery: import("@cosmicdrift/kumiko-types/define-handler
22
22
  scope: string;
23
23
  status: string;
24
24
  contentFormat: string;
25
- modifiedAt: import("temporal-spec").Temporal.Instant | null;
25
+ modifiedAt: Temporal.Instant | null;
26
26
  }[], import("@cosmicdrift/kumiko-types/event-type-map").KumikoEventTypeMap>;
@@ -1,4 +1,4 @@
1
- import type { Temporal } from "temporal-polyfill";
1
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  export declare const templateResourceEntity: import("@cosmicdrift/kumiko-types/fields").EntityDefinition<{
3
3
  slug: {
4
4
  readonly type: "text";
@@ -1,4 +1,4 @@
1
- import { Temporal } from "temporal-polyfill";
1
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  import * as z from "zod";
3
3
  type TeamStatus = "active" | "pending";
4
4
  type TeamRow = {
@@ -2,7 +2,7 @@ import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
2
2
  import { access, definePagedQueryHandler, MAX_LIST_LIMIT, } 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 { Temporal } from "temporal-polyfill";
5
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
6
6
  import * as z from "zod";
7
7
  import { userSessionTable } from "../../sessions/index.js";
8
8
  import { decryptStoredPii, mapWithConcurrency } from "../../shared/index.js";
@@ -1,6 +1,6 @@
1
1
  import { type DbRunner } from "@cosmicdrift/kumiko-framework/db";
2
2
  import { type TenantId } from "@cosmicdrift/kumiko-framework/engine";
3
- import { Temporal } from "temporal-polyfill";
3
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
4
4
  export type InvitedMembershipOptions = {
5
5
  readonly userId: string;
6
6
  readonly tenantId: TenantId;
@@ -3,7 +3,7 @@ import { createEventStoreExecutor, createTenantDb, } from "@cosmicdrift/kumiko-f
3
3
  import { createSystemUser } from "@cosmicdrift/kumiko-framework/engine";
4
4
  import { ConflictError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
5
5
  import { parseRoles } from "@cosmicdrift/kumiko-framework/utils";
6
- import { Temporal } from "temporal-polyfill";
6
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
7
7
  import { TenantErrors } from "./constants.js";
8
8
  import { findForbiddenMembershipRole, reservedMembershipRoleError } from "./membership-roles.js";
9
9
  import { tenantMembershipEntity, tenantMembershipsTable } from "./membership-table.js";
@@ -1,4 +1,4 @@
1
- import type { Temporal } from "temporal-polyfill";
1
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  export declare function tenantHandoverPurpose(entityType: string): string;
3
3
  export declare function signTenantHandoverGrant(args: {
4
4
  readonly entityType: string;
@@ -1,6 +1,6 @@
1
1
  import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
2
2
  import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
3
- import type { Temporal } from "temporal-polyfill";
3
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
4
4
  export type ExportJobCleanupCandidate = {
5
5
  readonly id: string;
6
6
  readonly version: number;
@@ -1,5 +1,5 @@
1
1
  import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
2
- import { Temporal as TemporalPolyfill } from "temporal-polyfill";
3
- export declare function selectUsersDueForForgetCleanup(db: DbConnection, status: string, gracePeriodEndCutoff: InstanceType<typeof TemporalPolyfill.Instant> | string): Promise<readonly {
2
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
3
+ export declare function selectUsersDueForForgetCleanup(db: DbConnection, status: string, gracePeriodEndCutoff: Temporal.Instant | string): Promise<readonly {
4
4
  id: string;
5
5
  }[]>;
@@ -1,15 +1,9 @@
1
1
  import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
2
- // Value-only import, aliased to avoid shadowing the ambient global
3
- // `Temporal` TYPE that gracePeriodEndCutoff's parameter type resolves
4
- // against (same #1438 dual-package-hazard pattern as event-store.ts).
5
- import { Temporal as TemporalPolyfill } from "temporal-polyfill";
2
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
6
3
  import { userTable } from "../../../user/index.js";
7
4
  export async function selectUsersDueForForgetCleanup(db, status, gracePeriodEndCutoff) {
8
- // @cast-boundary temporal-polyfill-vs-ambient: same TC39 Temporal.Instant
9
- // at runtime, distinct nominal types across the two .d.ts sources (see
10
- // event-store.ts). Only ever consumed via the `lte` comparison below.
11
5
  const cutoff = typeof gracePeriodEndCutoff === "string"
12
- ? TemporalPolyfill.Instant.from(gracePeriodEndCutoff)
6
+ ? Temporal.Instant.from(gracePeriodEndCutoff)
13
7
  : gracePeriodEndCutoff;
14
8
  return selectMany(db, userTable, {
15
9
  status,
@@ -1,4 +1,4 @@
1
- import type { Temporal } from "temporal-polyfill";
1
+ import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
2
2
  import { type RowBoundGrantResult } from "../shared/index.js";
3
3
  export declare function signDeletionToken(userId: string, requestId: string, ttlMinutes: number, secret: string, now?: Temporal.Instant): {
4
4
  readonly token: string;
@@ -4,7 +4,7 @@
4
4
  // branding pass send*Email callbacks and these defaults do not run.
5
5
  import { mailT, registerMailTranslations } from "@cosmicdrift/kumiko-framework/i18n";
6
6
  import { escapeHtml, escapeHtmlAttr } from "@cosmicdrift/kumiko-headless";
7
- import { Temporal } from "temporal-polyfill";
7
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
8
8
  export function normalizeGdprMailLocale(raw) {
9
9
  if (!raw)
10
10
  return undefined;
@@ -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 { Temporal } from "temporal-polyfill";
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
  // Operator-Query: invalid Download-Attempts (S2.U7).
@@ -1,7 +1,7 @@
1
1
  import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
2
2
  import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
3
3
  import { eventsTable } from "@cosmicdrift/kumiko-framework/event-store";
4
- import { Temporal } from "temporal-polyfill";
4
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
5
5
  import * as z from "zod";
6
6
  // DSGVO Art. 15 Selbstauskunft — User reads HIS OWN audit-log.
7
7
  // WHERE createdBy = ctx.user.id ist hard-coded (kein userId-Param,
@@ -1,7 +1,7 @@
1
1
  import { fetchOne } from "@cosmicdrift/kumiko-framework/bun-db";
2
2
  import { createSystemUser, defineWriteHandler, parseTenantId, } from "@cosmicdrift/kumiko-framework/engine";
3
3
  import { InternalError, NotFoundError, UnprocessableError, writeFailure, } from "@cosmicdrift/kumiko-framework/errors";
4
- import { Temporal } from "temporal-polyfill";
4
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
5
5
  import { AuthErrors, AuthHandlers } from "../../auth-email-password/index.js";
6
6
  import { TenantHandlers, tenantTable } from "../../tenant/index.js";
7
7
  import { DEFAULT_OWN_TENANT_INVITE_ROLE, WAITLIST_STATUS, WaitlistErrors } from "../constants.js";
@@ -1,7 +1,7 @@
1
1
  import { acquireNamespacedAdvisoryLock } from "@cosmicdrift/kumiko-framework/db";
2
2
  import { access, defineWriteHandler, } from "@cosmicdrift/kumiko-framework/engine";
3
3
  import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
4
- import { Temporal } from "temporal-polyfill";
4
+ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
5
5
  import { WAITLIST_NOTIFICATION_TYPES, WAITLIST_STATUS } from "../constants.js";
6
6
  import { normalizeEmail, platformActor, waitlistDb, waitlistExecutor } from "../lib.js";
7
7
  import { renderWaitlistAdminNoticeEmail, renderWaitlistConfirmationEmail, resolveWaitlistAdminMailLocale, resolveWaitlistMailLocale, } from "../mail.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-bundled-features",
3
- "version": "0.350.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>",
@@ -503,12 +503,12 @@
503
503
  }
504
504
  },
505
505
  "dependencies": {
506
- "@cosmicdrift/kumiko-dispatcher-live": "0.350.0",
507
- "@cosmicdrift/kumiko-framework": "0.350.0",
508
- "@cosmicdrift/kumiko-headless": "0.350.0",
509
- "@cosmicdrift/kumiko-renderer": "0.350.0",
510
- "@cosmicdrift/kumiko-renderer-web": "0.350.0",
511
- "@cosmicdrift/kumiko-types": "0.350.0",
506
+ "@cosmicdrift/kumiko-dispatcher-live": "0.351.0",
507
+ "@cosmicdrift/kumiko-framework": "0.351.0",
508
+ "@cosmicdrift/kumiko-headless": "0.351.0",
509
+ "@cosmicdrift/kumiko-renderer": "0.351.0",
510
+ "@cosmicdrift/kumiko-renderer-web": "0.351.0",
511
+ "@cosmicdrift/kumiko-types": "0.351.0",
512
512
  "@mollie/api-client": "^4.5.0",
513
513
  "@node-rs/argon2": "^2.0.2",
514
514
  "@types/mailparser": "^3.4.6",
@@ -1025,8 +1025,8 @@
1025
1025
  ],
1026
1026
  "devDependencies": {
1027
1027
  "@testing-library/user-event": "^14.6.1",
1028
- "@cosmicdrift/kumiko-locale-de": "0.350.0",
1029
- "@cosmicdrift/kumiko-locale-es": "0.350.0",
1028
+ "@cosmicdrift/kumiko-locale-de": "0.351.0",
1029
+ "@cosmicdrift/kumiko-locale-es": "0.351.0",
1030
1030
  "jsqr": "^1.4.0"
1031
1031
  }
1032
1032
  }