@cosmicdrift/kumiko-bundled-features 0.374.0 → 0.378.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/dist/account-security/constants.d.ts +1 -0
- package/dist/account-security/constants.js +1 -0
- package/dist/account-security/index.d.ts +1 -1
- package/dist/account-security/index.js +1 -1
- package/dist/admin-shell/web/client-plugin.d.ts +1 -1
- package/dist/audit/web/client-plugin.d.ts +1 -1
- package/dist/auth-email-password/mail-notifications.js +1 -1
- package/dist/auth-email-password/web/auth-client.js +1 -1
- package/dist/auth-email-password/web/auth-form-primitives.js +1 -1
- package/dist/auth-email-password/web/default-topbar-actions.js +1 -1
- package/dist/auth-email-password/web/index.js +1 -1
- package/dist/auth-email-password/web/session.js +1 -1
- package/dist/auth-email-password/web/tenant-menu-items.js +1 -1
- package/dist/auth-email-password/web/tenant-switcher.js +1 -1
- package/dist/auth-email-password/web/user-menu.js +1 -1
- package/dist/auth-foundation/env.d.ts +9 -0
- package/dist/auth-foundation/env.js +21 -0
- package/dist/auth-foundation/index.d.ts +1 -0
- package/dist/auth-foundation/index.js +1 -0
- package/dist/auth-mfa/schema/user-mfa.d.ts +6 -6
- package/dist/billing-foundation/consumer-protection/confirmation-mail.js +1 -1
- package/dist/billing-foundation/consumer-protection/termination-pages.js +1 -1
- package/dist/billing-foundation/contact-card.d.ts +2 -0
- package/dist/billing-foundation/contact-card.js +16 -0
- package/dist/billing-foundation/entities.d.ts +8 -8
- package/dist/billing-foundation/handlers/billing-plans.query.js +1 -1
- package/dist/billing-foundation/index.d.ts +1 -1
- package/dist/billing-foundation/plan-catalog.js +1 -0
- package/dist/billing-foundation/projection.d.ts +8 -8
- package/dist/billing-foundation/types.d.ts +11 -0
- package/dist/billing-foundation/validate-options.js +13 -0
- package/dist/billing-foundation/web/billing-contact-plan.d.ts +5 -0
- package/dist/billing-foundation/web/billing-contact-plan.js +17 -0
- package/dist/billing-foundation/web/billing-plans-panel.js +5 -13
- package/dist/billing-foundation/web/cancel-contract-dialog.js +2 -2
- package/dist/billing-foundation/web/checkout-consent-dialog.d.ts +1 -1
- package/dist/billing-foundation/web/checkout-consent-dialog.js +1 -0
- package/dist/billing-foundation/web/client-plugin.d.ts +1 -1
- package/dist/billing-foundation/web/localized-params.d.ts +1 -0
- package/dist/billing-foundation/web/localized-params.js +11 -0
- package/dist/cap-counter/entity.d.ts +1 -1
- package/dist/cap-counter/stock-cap-guard.js +8 -0
- package/dist/cap-overview/web/cap-cards-panel.js +3 -3
- package/dist/cap-overview/web/client-plugin.d.ts +1 -1
- package/dist/channel-email/email-channel.d.ts +2 -1
- package/dist/compliance-profiles/web/client-plugin.d.ts +1 -1
- package/dist/config/feature.js +2 -2
- package/dist/config/table.d.ts +6 -6
- package/dist/config/web/i18n.js +1 -0
- package/dist/custom-fields/entity.d.ts +4 -4
- package/dist/custom-fields/web/client-plugin.d.ts +1 -1
- package/dist/data-retention/schema/tenant-retention-override.d.ts +4 -4
- package/dist/delivery/tables.d.ts +6 -6
- package/dist/delivery/unsubscribe-page.js +1 -1
- package/dist/delivery/web/client-plugin.d.ts +1 -1
- package/dist/delivery/web/delivery-status-cell.js +1 -1
- package/dist/document-ingest-foundation/entity.d.ts +4 -4
- package/dist/feature-toggles/web/client-plugin.d.ts +1 -1
- package/dist/file-provider-s3/env-named-feature.d.ts +17 -0
- package/dist/file-provider-s3/env-named-feature.js +23 -0
- package/dist/file-provider-s3/env-schema.d.ts +7 -0
- package/dist/file-provider-s3/env-schema.js +15 -10
- package/dist/file-provider-s3/index.d.ts +1 -0
- package/dist/file-provider-s3/index.js +1 -0
- package/dist/folders/entity.d.ts +8 -8
- package/dist/folders/web/client-plugin.d.ts +1 -1
- package/dist/form-draft/entity.d.ts +2 -2
- package/dist/host-routing/constants.d.ts +2 -0
- package/dist/host-routing/constants.js +3 -0
- package/dist/host-routing/dispatch.d.ts +1 -1
- package/dist/host-routing/dispatch.js +35 -25
- package/dist/host-routing/feature.js +100 -27
- package/dist/host-routing/host.d.ts +9 -0
- package/dist/host-routing/host.js +24 -2
- package/dist/host-routing/index.d.ts +2 -1
- package/dist/host-routing/index.js +1 -0
- package/dist/host-routing/options.d.ts +14 -0
- package/dist/host-routing/redirects.d.ts +6 -0
- package/dist/host-routing/redirects.js +27 -0
- package/dist/host-routing/tenant-lookup.d.ts +7 -0
- package/dist/host-routing/tenant-lookup.js +39 -0
- package/dist/host-routing/validate-options.js +34 -1
- package/dist/inbound-mail-foundation/entities.d.ts +25 -25
- package/dist/inbound-mail-foundation/feature.js +7 -0
- package/dist/inbound-mail-foundation/handlers/list-accounts.query.d.ts +1 -1
- package/dist/inbound-mail-foundation/handlers/list-accounts.query.js +11 -3
- package/dist/inbound-mail-foundation/i18n.d.ts +3 -0
- package/dist/inbound-mail-foundation/i18n.js +35 -0
- package/dist/inbound-mail-foundation/index.d.ts +1 -0
- package/dist/inbound-mail-foundation/index.js +1 -0
- package/dist/inbound-mail-foundation/projection.d.ts +20 -20
- package/dist/inbound-mail-foundation/screens.d.ts +7 -0
- package/dist/inbound-mail-foundation/screens.js +86 -0
- package/dist/inbound-mail-foundation/types.d.ts +2 -2
- package/dist/jobs/job-run-table.d.ts +6 -6
- package/dist/jobs/web/client-plugin.d.ts +1 -1
- package/dist/ledger/entity.d.ts +13 -13
- package/dist/legal-pages/feature.js +11 -1
- package/dist/legal-pages/layout.d.ts +2 -2
- package/dist/legal-pages/layout.js +4 -4
- package/dist/legal-pages/web/client-plugin.d.ts +1 -1
- package/dist/mail-foundation/feature.d.ts +20 -21
- package/dist/mail-foundation/feature.js +1 -1
- package/dist/mail-foundation/i18n.d.ts +5 -2
- package/dist/mail-foundation/i18n.js +3 -2
- package/dist/mail-transport-smtp/i18n.d.ts +1 -1
- package/dist/mail-transport-smtp/i18n.js +1 -1
- package/dist/managed-pages/table.d.ts +12 -12
- package/dist/managed-pages/web/client-plugin.d.ts +1 -1
- package/dist/notes-history/entity.d.ts +12 -12
- package/dist/notes-history/web/client-plugin.d.ts +1 -1
- package/dist/page-render/branding.js +1 -1
- package/dist/page-render/layout.d.ts +1 -1
- package/dist/page-render/layout.js +2 -2
- package/dist/page-render/markdown.js +1 -1
- package/dist/personal-access-tokens/i18n.js +1 -1
- package/dist/personal-access-tokens/schema/api-token.d.ts +6 -6
- package/dist/personal-access-tokens/screens.js +1 -1
- package/dist/secrets/feature.d.ts +1 -1
- package/dist/secrets/feature.js +3 -3
- package/dist/secrets/table.d.ts +1 -1
- package/dist/seo/sitemap.js +1 -1
- package/dist/sessions/schema/user-session.d.ts +4 -4
- package/dist/shared/mail-template-body.js +1 -1
- package/dist/shared/purge-files-reaching-subject.js +98 -3
- package/dist/tags/entity.d.ts +9 -9
- package/dist/tags/web/client-plugin.d.ts +1 -1
- package/dist/template-resolver/compile-document-body.d.ts +3 -0
- package/dist/template-resolver/compile-document-body.js +50 -3
- package/dist/template-resolver/constants.d.ts +3 -0
- package/dist/template-resolver/constants.js +2 -0
- package/dist/template-resolver/document-blocks.d.ts +5 -0
- package/dist/template-resolver/document-blocks.js +22 -0
- package/dist/template-resolver/document-images.d.ts +2 -0
- package/dist/template-resolver/document-images.js +28 -0
- package/dist/template-resolver/document-ops.d.ts +167 -0
- package/dist/template-resolver/document-ops.js +390 -0
- package/dist/template-resolver/document-sanitizer.d.ts +4 -1
- package/dist/template-resolver/document-sanitizer.js +26 -0
- package/dist/template-resolver/document-schema.d.ts +2 -1
- package/dist/template-resolver/document-schema.js +4 -0
- package/dist/template-resolver/feature.d.ts +11 -0
- package/dist/template-resolver/feature.js +60 -31
- package/dist/template-resolver/handlers/bundle-import.js +1 -0
- package/dist/template-resolver/handlers/collection-item.query.js +2 -1
- package/dist/template-resolver/handlers/collection-list.query.js +2 -1
- package/dist/template-resolver/handlers/collection-set.write.js +2 -2
- package/dist/template-resolver/handlers/collection-shared.d.ts +1 -2
- package/dist/template-resolver/handlers/collection-shared.js +0 -4
- package/dist/template-resolver/handlers/copy-locale.write.d.ts +2 -1
- package/dist/template-resolver/handlers/copy-locale.write.js +67 -63
- package/dist/template-resolver/handlers/discard-draft.write.d.ts +3 -2
- package/dist/template-resolver/handlers/discard-draft.write.js +18 -6
- package/dist/template-resolver/handlers/document-base.d.ts +23 -0
- package/dist/template-resolver/handlers/document-base.js +55 -0
- package/dist/template-resolver/handlers/document-blocks.query.d.ts +22 -0
- package/dist/template-resolver/handlers/document-blocks.query.js +46 -0
- package/dist/template-resolver/handlers/export-bundle.query.d.ts +1 -0
- package/dist/template-resolver/handlers/export-bundle.query.js +9 -2
- package/dist/template-resolver/handlers/import-bundle-system.write.d.ts +1 -0
- package/dist/template-resolver/handlers/import-bundle.write.d.ts +3 -1
- package/dist/template-resolver/handlers/import-bundle.write.js +30 -25
- package/dist/template-resolver/handlers/overview.query.d.ts +2 -1
- package/dist/template-resolver/handlers/overview.query.js +46 -42
- package/dist/template-resolver/handlers/patch-draft.write.d.ts +67 -0
- package/dist/template-resolver/handlers/patch-draft.write.js +111 -0
- package/dist/template-resolver/handlers/preview.query.d.ts +1 -0
- package/dist/template-resolver/handlers/preview.query.js +2 -1
- package/dist/template-resolver/handlers/reset-to-system.write.d.ts +2 -1
- package/dist/template-resolver/handlers/reset-to-system.write.js +51 -44
- package/dist/template-resolver/handlers/resource-link-pdf.write.d.ts +2 -1
- package/dist/template-resolver/handlers/resource-link-pdf.write.js +34 -28
- package/dist/template-resolver/handlers/resource-remove.write.d.ts +2 -1
- package/dist/template-resolver/handlers/resource-remove.write.js +39 -33
- package/dist/template-resolver/handlers/resource-upload.write.d.ts +2 -1
- package/dist/template-resolver/handlers/resource-upload.write.js +104 -96
- package/dist/template-resolver/handlers/send-test-shared.d.ts +5 -0
- package/dist/template-resolver/handlers/send-test-shared.js +19 -0
- package/dist/template-resolver/handlers/send-test-status.query.d.ts +9 -0
- package/dist/template-resolver/handlers/send-test-status.query.js +18 -0
- package/dist/template-resolver/handlers/send-test.write.d.ts +3 -1
- package/dist/template-resolver/handlers/send-test.write.js +87 -88
- package/dist/template-resolver/handlers/set.write.d.ts +2 -1
- package/dist/template-resolver/handlers/set.write.js +94 -90
- package/dist/template-resolver/handlers/template-write.d.ts +2 -0
- package/dist/template-resolver/handlers/template-write.js +14 -2
- package/dist/template-resolver/handlers/toggle-status.write.d.ts +6 -7
- package/dist/template-resolver/handlers/toggle-status.write.js +28 -10
- package/dist/template-resolver/handlers/upsert-tenant.write.d.ts +2 -1
- package/dist/template-resolver/handlers/upsert-tenant.write.js +30 -24
- package/dist/template-resolver/handlers/validate.query.d.ts +10 -4
- package/dist/template-resolver/handlers/validate.query.js +12 -7
- package/dist/template-resolver/index.d.ts +4 -2
- package/dist/template-resolver/index.js +3 -1
- package/dist/template-resolver/{web/placeholder-text.js → placeholder-text.js} +1 -1
- package/dist/template-resolver/qualified-names.d.ts +4 -0
- package/dist/template-resolver/qualified-names.js +4 -0
- package/dist/template-resolver/seeding.d.ts +1 -0
- package/dist/template-resolver/seeding.js +2 -1
- package/dist/template-resolver/table.d.ts +10 -10
- package/dist/template-resolver/template-bundle.d.ts +1 -0
- package/dist/template-resolver/template-bundle.js +6 -1
- package/dist/template-resolver/template-edit-policy.d.ts +22 -0
- package/dist/template-resolver/template-edit-policy.js +45 -0
- package/dist/template-resolver/template-preview.d.ts +4 -1
- package/dist/template-resolver/template-preview.js +23 -5
- package/dist/template-resolver/template-validation.d.ts +2 -1
- package/dist/template-resolver/template-validation.js +34 -14
- package/dist/template-resolver/user-content-table.d.ts +10 -10
- package/dist/template-resolver/web/client-plugin.d.ts +1 -1
- package/dist/template-resolver/web/client-plugin.js +3 -3
- package/dist/template-resolver/web/document-editor-extensions.d.ts +1 -0
- package/dist/template-resolver/web/document-editor-extensions.js +21 -1
- package/dist/template-resolver/web/document-tiptap-editor.d.ts +1 -1
- package/dist/template-resolver/web/document-tiptap-editor.js +23 -7
- package/dist/template-resolver/web/document-toolbar-blocks.d.ts +4 -5
- package/dist/template-resolver/web/document-toolbar-blocks.js +1 -21
- package/dist/template-resolver/web/i18n.js +18 -0
- package/dist/template-resolver/web/placeholder-line-editor.js +2 -2
- package/dist/tenant/invitation-table.d.ts +6 -6
- package/dist/tenant/membership-table.d.ts +4 -4
- package/dist/tenant/schema/tenant.d.ts +6 -6
- package/dist/tenant/web/client-plugin.d.ts +1 -1
- package/dist/tenant/web/member-status-cell.js +1 -1
- package/dist/tier-engine/entity.d.ts +1 -1
- package/dist/tier-engine/tier-resolver.d.ts +1 -1
- package/dist/tier-engine/web/client-plugin.d.ts +1 -1
- package/dist/user/schema/user.d.ts +12 -12
- package/dist/user-data-rights/env.d.ts +5 -0
- package/dist/user-data-rights/env.js +11 -0
- package/dist/user-data-rights/feature.js +4 -2
- package/dist/user-data-rights/index.d.ts +1 -0
- package/dist/user-data-rights/index.js +1 -0
- package/dist/user-data-rights/lib/mail-transport-resolver.js +1 -1
- package/dist/user-data-rights/lib/storage-provider-resolver.js +1 -1
- package/dist/user-data-rights/mail-notifications.js +1 -1
- package/dist/user-data-rights/schema/download-attempt.d.ts +14 -14
- package/dist/user-data-rights/schema/download-token.d.ts +8 -8
- package/dist/user-data-rights/schema/export-job.d.ts +6 -6
- package/dist/user-data-rights/web/client-plugin.d.ts +1 -1
- package/dist/user-data-rights/web/privacy-center-screen.js +2 -2
- package/dist/waitlist/entity.d.ts +14 -14
- package/dist/waitlist/legacy-migrate.d.ts +2 -0
- package/dist/waitlist/legacy-migrate.js +38 -3
- package/package.json +16 -11
- package/src/account-security/changes.json +6 -0
- package/src/auth-foundation/changes.json +6 -0
- package/src/billing-foundation/changes.json +6 -0
- package/src/cap-counter/changes.json +12 -0
- package/src/channel-email/changes.json +6 -0
- package/src/crypto-shredding/changes.json +6 -0
- package/src/file-provider-s3/changes.json +6 -0
- package/src/host-routing/changes.json +6 -0
- package/src/inbound-mail-foundation/changes.json +13 -0
- package/src/legal-pages/changes.json +6 -0
- package/src/mail-foundation/changes.json +6 -0
- package/src/template-resolver/changes.json +38 -0
- package/src/user-data-rights/changes.json +6 -0
- package/src/waitlist/changes.json +6 -0
- /package/dist/template-resolver/{web/placeholder-text.d.ts → placeholder-text.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TranslationsByLocale } from "@cosmicdrift/kumiko-renderer";
|
|
2
|
-
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer
|
|
2
|
+
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
3
3
|
export type BillingFoundationClientOptions = {
|
|
4
4
|
readonly translations?: TranslationsByLocale;
|
|
5
5
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function localizedParams(params: Readonly<Record<string, string | number>> | undefined, locale: string): Readonly<Record<string, string>> | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @runtime client
|
|
2
|
+
export function localizedParams(params, locale) {
|
|
3
|
+
if (params === undefined)
|
|
4
|
+
return undefined;
|
|
5
|
+
const localized = {};
|
|
6
|
+
for (const [key, value] of Object.entries(params)) {
|
|
7
|
+
localized[key] =
|
|
8
|
+
typeof value === "number" ? new Intl.NumberFormat(locale).format(value) : value;
|
|
9
|
+
}
|
|
10
|
+
return localized;
|
|
11
|
+
}
|
|
@@ -13,7 +13,7 @@ export declare const capCounterEntity: import("@cosmicdrift/kumiko-types/fields"
|
|
|
13
13
|
readonly sensitive?: boolean;
|
|
14
14
|
readonly writeOnly?: boolean;
|
|
15
15
|
readonly readAsInstruction?: boolean;
|
|
16
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
16
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
17
17
|
readonly default?: string;
|
|
18
18
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
19
19
|
readonly multiline?: boolean | {
|
|
@@ -4,8 +4,12 @@
|
|
|
4
4
|
// tenant, so both are now factory parameters.
|
|
5
5
|
import { UnprocessableError, writeFailure, } from "@cosmicdrift/kumiko-framework/errors";
|
|
6
6
|
import { enforceStockCap } from "./enforce-cap.js";
|
|
7
|
+
// pg_advisory_xact_lock namespace (int4): 'scap' as ASCII, disjoint from the
|
|
8
|
+
// framework's other fixed advisory-lock keys.
|
|
9
|
+
const STOCK_CAP_LOCK_NAMESPACE = 0x73636170;
|
|
7
10
|
export function createStockCapGuard(resolveTierCaps) {
|
|
8
11
|
async function checkStockCap(db, spec, context = {}) {
|
|
12
|
+
// Lock-free on its own: a direct call outside withStockCap is not atomic.
|
|
9
13
|
const caps = await resolveTierCaps(db, context);
|
|
10
14
|
const current = await db.count(spec.table, { ...spec.where, tenantId: db.tenantId });
|
|
11
15
|
const { state, limit } = enforceStockCap({
|
|
@@ -24,6 +28,10 @@ export function createStockCapGuard(resolveTierCaps) {
|
|
|
24
28
|
return {
|
|
25
29
|
...handler,
|
|
26
30
|
handler: async (event, ctx) => {
|
|
31
|
+
// ctx.db is the handler's transaction, so the xact lock releases with its commit or
|
|
32
|
+
// rollback. A handler wrapped in several caps must list them in the same order
|
|
33
|
+
// everywhere; Postgres aborts one side of an inverse order with a deadlock error.
|
|
34
|
+
await ctx.db.advisoryXactLock(STOCK_CAP_LOCK_NAMESPACE, spec.code);
|
|
27
35
|
const failure = await checkStockCap(ctx.db, spec, { config: ctx.config });
|
|
28
36
|
return failure ?? handler.handler(event, ctx);
|
|
29
37
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { EMPTY_VALUE_PLACEHOLDER } from "@cosmicdrift/kumiko-headless";
|
|
3
2
|
import { usePrimitives, useQuery, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
4
|
-
import {
|
|
3
|
+
import { EMPTY_VALUE_PLACEHOLDER } from "@cosmicdrift/kumiko-renderer/headless";
|
|
4
|
+
import { EmptyState, StatCard, StatusBadge, } from "@cosmicdrift/kumiko-renderer/web";
|
|
5
5
|
import { Database, FileText, Gauge, Hash, Mail, Users } from "lucide-react";
|
|
6
6
|
import { CapOverviewQueries } from "../constants.js";
|
|
7
7
|
import { CapUsageBar } from "./cap-usage-bar.js";
|
|
@@ -44,7 +44,7 @@ export function CapCardsPanel({ filterParams }) {
|
|
|
44
44
|
}
|
|
45
45
|
return (_jsxs("div", {
|
|
46
46
|
// Arbitrary bracket values (grid-cols-[repeat(...)]) never compiled:
|
|
47
|
-
// styles.css's Tailwind v4 @source scan only covers renderer
|
|
47
|
+
// styles.css's Tailwind v4 @source scan only covers renderer/web/src,
|
|
48
48
|
// renderer/src and samples/**/src (see its comment) — bundled-features
|
|
49
49
|
// isn't scanned, so a class unique to this file has no generated rule
|
|
50
50
|
// and silently no-ops (the grid fell back to one implicit column,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TranslationsByLocale } from "@cosmicdrift/kumiko-renderer";
|
|
2
|
-
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer
|
|
2
|
+
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
3
3
|
export type CapOverviewClientOptions = {
|
|
4
4
|
readonly translations?: TranslationsByLocale;
|
|
5
5
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TenantDb } from "@cosmicdrift/kumiko-framework/db";
|
|
1
2
|
import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
3
|
import { type ChannelContext, type DeliveryChannel, type EmailAttachmentRef } from "../delivery/index.ts";
|
|
3
4
|
import type { EmailTransport } from "./types.ts";
|
|
@@ -16,7 +17,7 @@ type EmailChannelTransports = {
|
|
|
16
17
|
};
|
|
17
18
|
export type EmailChannelOptions = EmailChannelTransports & {
|
|
18
19
|
readonly resolveEmail: (userId: string, ctx: {
|
|
19
|
-
db:
|
|
20
|
+
db: TenantDb;
|
|
20
21
|
tenantId: TenantId;
|
|
21
22
|
}) => Promise<string | null>;
|
|
22
23
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TranslationsByLocale } from "@cosmicdrift/kumiko-renderer";
|
|
2
|
-
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer
|
|
2
|
+
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
3
3
|
export type ComplianceProfilesClientOptions = {
|
|
4
4
|
readonly translations?: TranslationsByLocale;
|
|
5
5
|
};
|
package/dist/config/feature.js
CHANGED
|
@@ -53,7 +53,7 @@ export function createConfigAccessor(registry, resolver, tenantId, userId, db, s
|
|
|
53
53
|
}
|
|
54
54
|
return configAccessor;
|
|
55
55
|
}
|
|
56
|
-
// Pass to the test-stack / server-boot as `
|
|
56
|
+
// Pass to the test-stack / server-boot as `configAccessorFactory` —
|
|
57
57
|
// `buildHandlerContext` mints a per-user `ctx.config` from this.
|
|
58
58
|
export function createConfigAccessorFactory(registry, resolver) {
|
|
59
59
|
return ({ user, db, secrets }) => createConfigAccessor(registry, resolver, user.tenantId, user.id, db, secrets);
|
|
@@ -67,7 +67,7 @@ export function requireConfigResolver(ctx, handlerName) {
|
|
|
67
67
|
if (!ctx.configResolver) {
|
|
68
68
|
throw new InternalError({
|
|
69
69
|
message: `[${handlerName}] ctx.configResolver missing — pass createConfigAccessorFactory's ` +
|
|
70
|
-
`output via extraContext.
|
|
70
|
+
`output via extraContext.configAccessorFactory and the resolver via ` +
|
|
71
71
|
`extraContext.configResolver at boot.`,
|
|
72
72
|
});
|
|
73
73
|
}
|
package/dist/config/table.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare const configValueEntity: import("@cosmicdrift/kumiko-types/fields
|
|
|
13
13
|
readonly sensitive?: boolean;
|
|
14
14
|
readonly writeOnly?: boolean;
|
|
15
15
|
readonly readAsInstruction?: boolean;
|
|
16
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
16
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
17
17
|
readonly default?: string;
|
|
18
18
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
19
19
|
readonly multiline?: boolean | {
|
|
@@ -36,7 +36,7 @@ export declare const configValueEntity: import("@cosmicdrift/kumiko-types/fields
|
|
|
36
36
|
readonly sensitive?: boolean;
|
|
37
37
|
readonly writeOnly?: boolean;
|
|
38
38
|
readonly readAsInstruction?: boolean;
|
|
39
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
39
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
40
40
|
readonly default?: string;
|
|
41
41
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
42
42
|
readonly multiline?: boolean | {
|
|
@@ -59,7 +59,7 @@ export declare const configValueEntity: import("@cosmicdrift/kumiko-types/fields
|
|
|
59
59
|
readonly sensitive?: boolean;
|
|
60
60
|
readonly writeOnly?: boolean;
|
|
61
61
|
readonly readAsInstruction?: boolean;
|
|
62
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
62
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
63
63
|
readonly default?: string;
|
|
64
64
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
65
65
|
readonly multiline?: boolean | {
|
|
@@ -84,7 +84,7 @@ export declare const configValuesTable: import("@cosmicdrift/kumiko-framework/db
|
|
|
84
84
|
readonly sensitive?: boolean;
|
|
85
85
|
readonly writeOnly?: boolean;
|
|
86
86
|
readonly readAsInstruction?: boolean;
|
|
87
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
87
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
88
88
|
readonly default?: string;
|
|
89
89
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
90
90
|
readonly multiline?: boolean | {
|
|
@@ -107,7 +107,7 @@ export declare const configValuesTable: import("@cosmicdrift/kumiko-framework/db
|
|
|
107
107
|
readonly sensitive?: boolean;
|
|
108
108
|
readonly writeOnly?: boolean;
|
|
109
109
|
readonly readAsInstruction?: boolean;
|
|
110
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
110
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
111
111
|
readonly default?: string;
|
|
112
112
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
113
113
|
readonly multiline?: boolean | {
|
|
@@ -130,7 +130,7 @@ export declare const configValuesTable: import("@cosmicdrift/kumiko-framework/db
|
|
|
130
130
|
readonly sensitive?: boolean;
|
|
131
131
|
readonly writeOnly?: boolean;
|
|
132
132
|
readonly readAsInstruction?: boolean;
|
|
133
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
133
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
134
134
|
readonly default?: string;
|
|
135
135
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
136
136
|
readonly multiline?: boolean | {
|
package/dist/config/web/i18n.js
CHANGED
|
@@ -29,6 +29,7 @@ export const defaultTranslations = {
|
|
|
29
29
|
"config.errors.unknownExtensionPlugin": "This provider is not available.",
|
|
30
30
|
"config.settings.extensionSelectorHint": "Choose a provider. Its settings appear below and are saved together with it.",
|
|
31
31
|
"config.settings.provider": "Provider",
|
|
32
|
+
"config.settings.provider.platformDefault": "Platform default",
|
|
32
33
|
"config.settings.audience.system": "Applies to every tenant unless a tenant sets its own value.",
|
|
33
34
|
"config.settings.audience.tenant": "Applies to everyone in this tenant. Platform defaults are shown where nothing is set here.",
|
|
34
35
|
"config.settings.audience.user": "Only applies to you.",
|
|
@@ -13,7 +13,7 @@ export declare const fieldDefinitionEntity: import("@cosmicdrift/kumiko-types/fi
|
|
|
13
13
|
readonly sensitive?: boolean;
|
|
14
14
|
readonly writeOnly?: boolean;
|
|
15
15
|
readonly readAsInstruction?: boolean;
|
|
16
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
16
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
17
17
|
readonly default?: string;
|
|
18
18
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
19
19
|
readonly multiline?: boolean | {
|
|
@@ -36,7 +36,7 @@ export declare const fieldDefinitionEntity: import("@cosmicdrift/kumiko-types/fi
|
|
|
36
36
|
readonly sensitive?: boolean;
|
|
37
37
|
readonly writeOnly?: boolean;
|
|
38
38
|
readonly readAsInstruction?: boolean;
|
|
39
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
39
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
40
40
|
readonly default?: string;
|
|
41
41
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
42
42
|
readonly multiline?: boolean | {
|
|
@@ -59,7 +59,7 @@ export declare const fieldDefinitionEntity: import("@cosmicdrift/kumiko-types/fi
|
|
|
59
59
|
readonly sensitive?: boolean;
|
|
60
60
|
readonly writeOnly?: boolean;
|
|
61
61
|
readonly readAsInstruction?: boolean;
|
|
62
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
62
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
63
63
|
readonly default?: string;
|
|
64
64
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
65
65
|
readonly multiline?: boolean | {
|
|
@@ -109,7 +109,7 @@ export declare const fieldDefinitionEntity: import("@cosmicdrift/kumiko-types/fi
|
|
|
109
109
|
readonly sensitive?: boolean;
|
|
110
110
|
readonly writeOnly?: boolean;
|
|
111
111
|
readonly readAsInstruction?: boolean;
|
|
112
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
112
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
113
113
|
readonly default?: string;
|
|
114
114
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
115
115
|
readonly multiline?: boolean | {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer
|
|
1
|
+
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
2
2
|
export declare function customFieldsClient(): ClientFeatureDefinition;
|
|
@@ -13,7 +13,7 @@ export declare const tenantRetentionOverrideEntity: import("@cosmicdrift/kumiko-
|
|
|
13
13
|
readonly sensitive?: boolean;
|
|
14
14
|
readonly writeOnly?: boolean;
|
|
15
15
|
readonly readAsInstruction?: boolean;
|
|
16
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
16
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
17
17
|
readonly default?: string;
|
|
18
18
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
19
19
|
readonly multiline?: boolean | {
|
|
@@ -52,7 +52,7 @@ export declare const tenantRetentionOverrideEntity: import("@cosmicdrift/kumiko-
|
|
|
52
52
|
readonly sensitive?: boolean;
|
|
53
53
|
readonly writeOnly?: boolean;
|
|
54
54
|
readonly readAsInstruction?: boolean;
|
|
55
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
55
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
56
56
|
readonly default?: string;
|
|
57
57
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
58
58
|
readonly multiline?: boolean | {
|
|
@@ -77,7 +77,7 @@ export declare const tenantRetentionOverrideTable: import("@cosmicdrift/kumiko-f
|
|
|
77
77
|
readonly sensitive?: boolean;
|
|
78
78
|
readonly writeOnly?: boolean;
|
|
79
79
|
readonly readAsInstruction?: boolean;
|
|
80
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
80
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
81
81
|
readonly default?: string;
|
|
82
82
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
83
83
|
readonly multiline?: boolean | {
|
|
@@ -116,7 +116,7 @@ export declare const tenantRetentionOverrideTable: import("@cosmicdrift/kumiko-f
|
|
|
116
116
|
readonly sensitive?: boolean;
|
|
117
117
|
readonly writeOnly?: boolean;
|
|
118
118
|
readonly readAsInstruction?: boolean;
|
|
119
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
119
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
120
120
|
readonly default?: string;
|
|
121
121
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
122
122
|
readonly multiline?: boolean | {
|
|
@@ -16,7 +16,7 @@ export declare const notificationPreferenceEntity: import("@cosmicdrift/kumiko-t
|
|
|
16
16
|
readonly sensitive?: boolean;
|
|
17
17
|
readonly writeOnly?: boolean;
|
|
18
18
|
readonly readAsInstruction?: boolean;
|
|
19
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
19
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
20
20
|
readonly default?: string;
|
|
21
21
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
22
22
|
readonly multiline?: boolean | {
|
|
@@ -39,7 +39,7 @@ export declare const notificationPreferenceEntity: import("@cosmicdrift/kumiko-t
|
|
|
39
39
|
readonly sensitive?: boolean;
|
|
40
40
|
readonly writeOnly?: boolean;
|
|
41
41
|
readonly readAsInstruction?: boolean;
|
|
42
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
42
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
43
43
|
readonly default?: string;
|
|
44
44
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
45
45
|
readonly multiline?: boolean | {
|
|
@@ -62,7 +62,7 @@ export declare const notificationPreferenceEntity: import("@cosmicdrift/kumiko-t
|
|
|
62
62
|
readonly sensitive?: boolean;
|
|
63
63
|
readonly writeOnly?: boolean;
|
|
64
64
|
readonly readAsInstruction?: boolean;
|
|
65
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
65
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
66
66
|
readonly default?: string;
|
|
67
67
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
68
68
|
readonly multiline?: boolean | {
|
|
@@ -92,7 +92,7 @@ export declare const notificationAddressOptOutEntity: import("@cosmicdrift/kumik
|
|
|
92
92
|
readonly sensitive?: boolean;
|
|
93
93
|
readonly writeOnly?: boolean;
|
|
94
94
|
readonly readAsInstruction?: boolean;
|
|
95
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
95
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
96
96
|
readonly default?: string;
|
|
97
97
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
98
98
|
readonly multiline?: boolean | {
|
|
@@ -115,7 +115,7 @@ export declare const notificationAddressOptOutEntity: import("@cosmicdrift/kumik
|
|
|
115
115
|
readonly sensitive?: boolean;
|
|
116
116
|
readonly writeOnly?: boolean;
|
|
117
117
|
readonly readAsInstruction?: boolean;
|
|
118
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
118
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
119
119
|
readonly default?: string;
|
|
120
120
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
121
121
|
readonly multiline?: boolean | {
|
|
@@ -138,7 +138,7 @@ export declare const notificationAddressOptOutEntity: import("@cosmicdrift/kumik
|
|
|
138
138
|
readonly sensitive?: boolean;
|
|
139
139
|
readonly writeOnly?: boolean;
|
|
140
140
|
readonly readAsInstruction?: boolean;
|
|
141
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
141
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
142
142
|
readonly default?: string;
|
|
143
143
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
144
144
|
readonly multiline?: boolean | {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { mailT } from "@cosmicdrift/kumiko-framework/i18n";
|
|
3
|
-
import { escapeHtml, escapeHtmlAttr } from "@cosmicdrift/kumiko-headless";
|
|
3
|
+
import { escapeHtml, escapeHtmlAttr } from "@cosmicdrift/kumiko-renderer/headless";
|
|
4
4
|
import { DELIVERY_RESUBSCRIBE_PATH, DELIVERY_UNSUBSCRIBE_PATH } from "./public-names.js";
|
|
5
5
|
import "./unsubscribe-page-strings.js";
|
|
6
6
|
// Same values as the in-code mail layout of renderer-mail-html, so the page reads as the mail's sequel.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TranslationsByLocale } from "@cosmicdrift/kumiko-renderer";
|
|
2
|
-
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer
|
|
2
|
+
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
3
3
|
export type DeliveryClientOptions = {
|
|
4
4
|
readonly translations?: TranslationsByLocale;
|
|
5
5
|
};
|
|
@@ -5,7 +5,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
5
5
|
// in feature.ts). The list frame itself is the generic declarative
|
|
6
6
|
// projectionList renderer — only this one cell stays TSX.
|
|
7
7
|
import { useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
8
|
-
import { StatusBadge } from "@cosmicdrift/kumiko-renderer
|
|
8
|
+
import { StatusBadge } from "@cosmicdrift/kumiko-renderer/web";
|
|
9
9
|
import { translateOrRaw } from "../../shared/web/translate-or-raw.js";
|
|
10
10
|
import { DeliveryStatus } from "../public-names.js";
|
|
11
11
|
const STATUS_TONE = {
|
|
@@ -24,7 +24,7 @@ export declare const documentExtractEntity: import("@cosmicdrift/kumiko-types/fi
|
|
|
24
24
|
readonly sensitive?: boolean;
|
|
25
25
|
readonly writeOnly?: boolean;
|
|
26
26
|
readonly readAsInstruction?: boolean;
|
|
27
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
27
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
28
28
|
readonly default?: string;
|
|
29
29
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
30
30
|
readonly multiline?: boolean | {
|
|
@@ -47,7 +47,7 @@ export declare const documentExtractEntity: import("@cosmicdrift/kumiko-types/fi
|
|
|
47
47
|
readonly sensitive?: boolean;
|
|
48
48
|
readonly writeOnly?: boolean;
|
|
49
49
|
readonly readAsInstruction?: boolean;
|
|
50
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
50
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
51
51
|
readonly default?: string;
|
|
52
52
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
53
53
|
readonly multiline?: boolean | {
|
|
@@ -89,7 +89,7 @@ export declare const documentExtractsTable: import("@cosmicdrift/kumiko-framewor
|
|
|
89
89
|
readonly sensitive?: boolean;
|
|
90
90
|
readonly writeOnly?: boolean;
|
|
91
91
|
readonly readAsInstruction?: boolean;
|
|
92
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
92
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
93
93
|
readonly default?: string;
|
|
94
94
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
95
95
|
readonly multiline?: boolean | {
|
|
@@ -112,7 +112,7 @@ export declare const documentExtractsTable: import("@cosmicdrift/kumiko-framewor
|
|
|
112
112
|
readonly sensitive?: boolean;
|
|
113
113
|
readonly writeOnly?: boolean;
|
|
114
114
|
readonly readAsInstruction?: boolean;
|
|
115
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
115
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
116
116
|
readonly default?: string;
|
|
117
117
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
118
118
|
readonly multiline?: boolean | {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TranslationsByLocale } from "@cosmicdrift/kumiko-renderer";
|
|
2
|
-
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer
|
|
2
|
+
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
3
3
|
export type FeatureTogglesClientOptions = {
|
|
4
4
|
readonly translations?: TranslationsByLocale;
|
|
5
5
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type NamedS3EnvProviderOptions = {
|
|
2
|
+
/** Provider key tenants select in `file-foundation`'s `provider` config; the feature is `file-provider-s3-env-<name>`. */
|
|
3
|
+
readonly name: string;
|
|
4
|
+
/** Env prefix of the credential set, e.g. `RELEASES_S3_`. */
|
|
5
|
+
readonly envPrefix: string;
|
|
6
|
+
/** Tolerate missing credentials at boot; the provider then fails on its first file operation. */
|
|
7
|
+
readonly lazy?: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** An additional S3 provider next to `"s3-env"`, reading its credentials from `<envPrefix>BUCKET` etc. */
|
|
10
|
+
export declare function createFileProviderS3NamedEnvFeature(options: NamedS3EnvProviderOptions): import("@cosmicdrift/kumiko-framework/env").FeatureWithEnvSchema<import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
11
|
+
readonly exports: void;
|
|
12
|
+
}, {
|
|
13
|
+
[x: string]: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
14
|
+
false: "false";
|
|
15
|
+
true: "true";
|
|
16
|
+
}>> | import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodPipe<import("zod").ZodLiteral<"">, import("zod").ZodTransform<undefined, "">>, import("zod").ZodURL]>>;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineFeature } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
import { featureWithEnvSchema } from "@cosmicdrift/kumiko-framework/env";
|
|
3
|
+
import { createRuntimeS3EnvSchema } from "./env-schema.js";
|
|
4
|
+
import { createS3ProviderFromEnv } from "./lib/env-helper.js";
|
|
5
|
+
/** An additional S3 provider next to `"s3-env"`, reading its credentials from `<envPrefix>BUCKET` etc. */
|
|
6
|
+
export function createFileProviderS3NamedEnvFeature(options) {
|
|
7
|
+
const envSchema = createRuntimeS3EnvSchema(options.envPrefix);
|
|
8
|
+
const feature = defineFeature(`file-provider-s3-env-${options.name}`, (r) => {
|
|
9
|
+
r.describe(`Registers the "${options.name}" provider for \`file-foundation\`: one shared S3 bucket for every tenant, credentials from the \`${options.envPrefix}*\` env vars. A second bucket next to the \`"s3-env"\` provider (for example release artifacts).`);
|
|
10
|
+
r.uiHints({
|
|
11
|
+
displayLabel: `File Provider · S3 (${options.name})`,
|
|
12
|
+
category: "storage",
|
|
13
|
+
recommended: false,
|
|
14
|
+
});
|
|
15
|
+
r.requires({ features: ["file-foundation"] });
|
|
16
|
+
r.envSchema(envSchema);
|
|
17
|
+
const plugin = {
|
|
18
|
+
build: async (_ctx, _tenantId) => createS3ProviderFromEnv(options.envPrefix), // @wrapper-known semantic-alias
|
|
19
|
+
};
|
|
20
|
+
r.useExtension("fileProvider", options.name, plugin);
|
|
21
|
+
}, { dedupeOptions: { name: options.name, envPrefix: options.envPrefix } });
|
|
22
|
+
return featureWithEnvSchema(feature, envSchema);
|
|
23
|
+
}
|
|
@@ -9,6 +9,13 @@ export declare const s3EndpointSchema: z.ZodURL;
|
|
|
9
9
|
export declare function createS3EnvSchema<const TPrefix extends string>(options: {
|
|
10
10
|
readonly prefix: TPrefix;
|
|
11
11
|
}): z.ZodObject<S3EnvShape<TPrefix> extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strip>;
|
|
12
|
+
/** Same block for a prefix only known at runtime (named providers); keys are typed as a record. */
|
|
13
|
+
export declare function createRuntimeS3EnvSchema(prefix: string): z.ZodObject<{
|
|
14
|
+
[x: string]: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
false: "false";
|
|
16
|
+
true: "true";
|
|
17
|
+
}>> | z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"">, z.ZodTransform<undefined, "">>, z.ZodURL]>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
12
19
|
type OptionalString = z.ZodOptional<z.ZodString>;
|
|
13
20
|
type S3EnvShape<TPrefix extends string> = {
|
|
14
21
|
[Key in `${TPrefix}${"BUCKET" | "REGION" | "ACCESS_KEY" | "SECRET_KEY"}`]: OptionalString;
|
|
@@ -15,15 +15,8 @@ function isAcceptableEndpoint(value) {
|
|
|
15
15
|
export const s3EndpointSchema = z
|
|
16
16
|
.url({ protocol: /^https?$/ })
|
|
17
17
|
.refine(isAcceptableEndpoint, "must use https unless the host is loopback");
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* Every field is optional: an app that mounts the env provider next to
|
|
21
|
-
* another one picks the provider at runtime, and the provider reports
|
|
22
|
-
* missing credentials on its first file operation. */
|
|
23
|
-
export function createS3EnvSchema(options) {
|
|
24
|
-
const { prefix } = options;
|
|
25
|
-
// @cast-boundary schema-walk — computed template keys widen to an index signature; the literal keys below are exactly the ones S3EnvShape names.
|
|
26
|
-
const shape = {
|
|
18
|
+
function buildS3Shape(prefix) {
|
|
19
|
+
return {
|
|
27
20
|
[`${prefix}BUCKET`]: z.string().min(1).optional().describe("S3 bucket."),
|
|
28
21
|
[`${prefix}REGION`]: z.string().min(1).optional().describe("S3 region."),
|
|
29
22
|
[`${prefix}ACCESS_KEY`]: z
|
|
@@ -48,7 +41,19 @@ export function createS3EnvSchema(options) {
|
|
|
48
41
|
.optional()
|
|
49
42
|
.describe('Path-style bucket addressing ("true"), needed by MinIO and some S3 clones.'),
|
|
50
43
|
};
|
|
51
|
-
|
|
44
|
+
}
|
|
45
|
+
/** Builds the env block `createS3ProviderFromEnv(prefix)` reads, e.g.
|
|
46
|
+
* `createS3EnvSchema({ prefix: "RELEASES_S3_" })` for a second bucket.
|
|
47
|
+
* Every field is optional: an app that mounts the env provider next to
|
|
48
|
+
* another one picks the provider at runtime, and the provider reports
|
|
49
|
+
* missing credentials on its first file operation. */
|
|
50
|
+
export function createS3EnvSchema(options) {
|
|
51
|
+
// @cast-boundary schema-walk — computed template keys widen to an index signature; the literal keys below are exactly the ones S3EnvShape names.
|
|
52
|
+
return z.object(buildS3Shape(options.prefix));
|
|
53
|
+
}
|
|
54
|
+
/** Same block for a prefix only known at runtime (named providers); keys are typed as a record. */
|
|
55
|
+
export function createRuntimeS3EnvSchema(prefix) {
|
|
56
|
+
return z.object(buildS3Shape(prefix));
|
|
52
57
|
}
|
|
53
58
|
/** The `S3_*` block of the `"s3-env"` provider. */
|
|
54
59
|
export const s3EnvSchema = createS3EnvSchema({ prefix: "S3_" });
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
export { createFileProviderS3NamedEnvFeature, type NamedS3EnvProviderOptions, } from "./env-named-feature.ts";
|
|
1
2
|
export { createS3EnvSchema, s3EndpointSchema, s3EnvSchema } from "./env-schema.ts";
|
|
2
3
|
export { createFileProviderS3Feature, type FileProviderS3FeatureOptions, S3_SECRET_ACCESS_KEY, } from "./feature.ts";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
// Public API of the file-provider-s3 bundled-feature.
|
|
2
|
+
export { createFileProviderS3NamedEnvFeature, } from "./env-named-feature.js";
|
|
2
3
|
export { createS3EnvSchema, s3EndpointSchema, s3EnvSchema } from "./env-schema.js";
|
|
3
4
|
export { createFileProviderS3Feature, S3_SECRET_ACCESS_KEY, } from "./feature.js";
|
package/dist/folders/entity.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare const folderEntity: EntityDefinition<{
|
|
|
14
14
|
readonly sensitive?: boolean;
|
|
15
15
|
readonly writeOnly?: boolean;
|
|
16
16
|
readonly readAsInstruction?: boolean;
|
|
17
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
17
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
18
18
|
readonly default?: string;
|
|
19
19
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
20
20
|
readonly multiline?: boolean | {
|
|
@@ -37,7 +37,7 @@ export declare const folderEntity: EntityDefinition<{
|
|
|
37
37
|
readonly sensitive?: boolean;
|
|
38
38
|
readonly writeOnly?: boolean;
|
|
39
39
|
readonly readAsInstruction?: boolean;
|
|
40
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
40
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
41
41
|
readonly default?: string;
|
|
42
42
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
43
43
|
readonly multiline?: boolean | {
|
|
@@ -62,7 +62,7 @@ export declare function createFolderAssignmentEntity(access?: EntityDefinition["
|
|
|
62
62
|
readonly sensitive?: boolean;
|
|
63
63
|
readonly writeOnly?: boolean;
|
|
64
64
|
readonly readAsInstruction?: boolean;
|
|
65
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
65
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
66
66
|
readonly default?: string;
|
|
67
67
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
68
68
|
readonly multiline?: boolean | {
|
|
@@ -85,7 +85,7 @@ export declare function createFolderAssignmentEntity(access?: EntityDefinition["
|
|
|
85
85
|
readonly sensitive?: boolean;
|
|
86
86
|
readonly writeOnly?: boolean;
|
|
87
87
|
readonly readAsInstruction?: boolean;
|
|
88
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
88
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
89
89
|
readonly default?: string;
|
|
90
90
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
91
91
|
readonly multiline?: boolean | {
|
|
@@ -108,7 +108,7 @@ export declare function createFolderAssignmentEntity(access?: EntityDefinition["
|
|
|
108
108
|
readonly sensitive?: boolean;
|
|
109
109
|
readonly writeOnly?: boolean;
|
|
110
110
|
readonly readAsInstruction?: boolean;
|
|
111
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
111
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
112
112
|
readonly default?: string;
|
|
113
113
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
114
114
|
readonly multiline?: boolean | {
|
|
@@ -133,7 +133,7 @@ export declare const folderAssignmentEntity: EntityDefinition<{
|
|
|
133
133
|
readonly sensitive?: boolean;
|
|
134
134
|
readonly writeOnly?: boolean;
|
|
135
135
|
readonly readAsInstruction?: boolean;
|
|
136
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
136
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
137
137
|
readonly default?: string;
|
|
138
138
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
139
139
|
readonly multiline?: boolean | {
|
|
@@ -156,7 +156,7 @@ export declare const folderAssignmentEntity: EntityDefinition<{
|
|
|
156
156
|
readonly sensitive?: boolean;
|
|
157
157
|
readonly writeOnly?: boolean;
|
|
158
158
|
readonly readAsInstruction?: boolean;
|
|
159
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
159
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
160
160
|
readonly default?: string;
|
|
161
161
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
162
162
|
readonly multiline?: boolean | {
|
|
@@ -179,7 +179,7 @@ export declare const folderAssignmentEntity: EntityDefinition<{
|
|
|
179
179
|
readonly sensitive?: boolean;
|
|
180
180
|
readonly writeOnly?: boolean;
|
|
181
181
|
readonly readAsInstruction?: boolean;
|
|
182
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
182
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
183
183
|
readonly default?: string;
|
|
184
184
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
185
185
|
readonly multiline?: boolean | {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer
|
|
1
|
+
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
2
2
|
export declare function foldersClient(): ClientFeatureDefinition;
|
|
@@ -13,7 +13,7 @@ export declare const formDraftEntity: import("@cosmicdrift/kumiko-types/fields")
|
|
|
13
13
|
readonly sensitive?: boolean;
|
|
14
14
|
readonly writeOnly?: boolean;
|
|
15
15
|
readonly readAsInstruction?: boolean;
|
|
16
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
16
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
17
17
|
readonly default?: string;
|
|
18
18
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
19
19
|
readonly multiline?: boolean | {
|
|
@@ -36,7 +36,7 @@ export declare const formDraftEntity: import("@cosmicdrift/kumiko-types/fields")
|
|
|
36
36
|
readonly sensitive?: boolean;
|
|
37
37
|
readonly writeOnly?: boolean;
|
|
38
38
|
readonly readAsInstruction?: boolean;
|
|
39
|
-
readonly format?: "email" | "url" | "phone" | "password";
|
|
39
|
+
readonly format?: "email" | "url" | "phone" | "password" | "month";
|
|
40
40
|
readonly default?: string;
|
|
41
41
|
readonly access?: import("@cosmicdrift/kumiko-types/fields").FieldAccess;
|
|
42
42
|
readonly multiline?: boolean | {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export declare const HOST_ROUTING_FEATURE = "host-routing";
|
|
2
2
|
export declare const HostRoutingQueries: {
|
|
3
3
|
readonly tenantKeyExists: "host-routing:query:tenant-key-exists";
|
|
4
|
+
readonly hostTenantExists: "host-routing:query:host-tenant-exists";
|
|
4
5
|
};
|
|
5
6
|
export declare const TENANT_KEY_MAX_LENGTH = 50;
|
|
6
7
|
export declare const TENANT_KEY_PATTERN: RegExp;
|
|
7
8
|
export declare function isTenantKeyCandidate(value: string): boolean;
|
|
8
9
|
export declare function isPathTenantKeyCandidate(value: string): boolean;
|
|
10
|
+
export declare const HOST_HEADER_MAX_LENGTH = 260;
|