@cosmicdrift/kumiko-samples 0.409.0 → 0.410.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/bundled-features/package.json +6 -1
- package/packages/bundled-features/src/auth-email-password/handlers/login-options.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/self-registration-status.query.ts +1 -1
- package/packages/bundled-features/src/compliance-profiles/handlers/sub-processors.query.ts +4 -1
- package/packages/bundled-features/src/contact/changes.json +6 -0
- package/packages/bundled-features/src/contact/client/contact-website-client.ts +29 -0
- package/packages/bundled-features/src/contact/client/index.ts +9 -0
- package/packages/bundled-features/src/contact/feature.ts +3 -0
- package/packages/bundled-features/src/contact/handlers/access.ts +1 -1
- package/packages/bundled-features/src/contact/handlers/challenge.query.ts +1 -1
- package/packages/bundled-features/src/contact/handlers/submit.write.ts +1 -1
- package/packages/bundled-features/src/contact/i18n.ts +4 -1
- package/packages/bundled-features/src/contact/options.ts +1 -1
- package/packages/bundled-features/src/contact/screens.ts +1 -0
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant-by-file-ref.query.ts +1 -1
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/branding.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/by-slug.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/by-tenant-published.query.ts +1 -1
- package/packages/bundled-features/src/seo/handlers/seo-config.query.ts +1 -1
- package/packages/bundled-features/src/subscription-paddle/checkout-config.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/by-slug.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +1 -1
- package/packages/bundled-features/src/tenant-inactivity/handlers/keep-account.write.ts +4 -1
- package/packages/bundled-features/src/user-data-rights/handlers/confirm-deletion-by-token.write.ts +4 -1
- package/packages/bundled-features/src/user-data-rights/handlers/download-by-token.query.ts +1 -0
- package/packages/bundled-features/src/user-data-rights/handlers/request-deletion-by-email.write.ts +4 -1
- package/packages/bundled-features/src/waitlist/changes.json +6 -0
- package/packages/bundled-features/src/waitlist/handlers/submit.write.ts +1 -2
- package/samples/apps/use-all-bundled/feature-manifest.json +3 -24
- package/samples/apps/use-all-bundled/playwright.config.ts +0 -2
- package/samples/apps/use-all-bundled/src/run-config.ts +3 -15
- package/samples/recipes/anonymous-access/README.md +2 -0
- package/samples/recipes/anonymous-access/src/feature.ts +7 -1
- package/samples/recipes/contact/README.md +10 -4
- package/samples/recipes/contact/src/feature.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-samples",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.410.0",
|
|
4
4
|
"description": "Source trees of the Kumiko sample recipes, sample apps and bundled features in repo layout, for tooling such as few-shot corpus builds.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-bundled-features",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.410.0",
|
|
4
4
|
"description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -155,6 +155,7 @@
|
|
|
155
155
|
"./legal-pages/web": "./src/legal-pages/web/index.ts",
|
|
156
156
|
"./contact": "./src/contact/index.ts",
|
|
157
157
|
"./contact/web": "./src/contact/web/index.ts",
|
|
158
|
+
"./contact/client": "./src/contact/client/index.ts",
|
|
158
159
|
"./waitlist": "./src/waitlist/index.ts",
|
|
159
160
|
"./page-render": "./src/page-render/index.ts",
|
|
160
161
|
"./page-render/web": "./src/page-render/web.ts",
|
|
@@ -732,6 +733,10 @@
|
|
|
732
733
|
"types": "./dist/contact/web/index.d.ts",
|
|
733
734
|
"default": "./dist/contact/web/index.js"
|
|
734
735
|
},
|
|
736
|
+
"./contact/client": {
|
|
737
|
+
"types": "./dist/contact/client/index.d.ts",
|
|
738
|
+
"default": "./dist/contact/client/index.js"
|
|
739
|
+
},
|
|
735
740
|
"./waitlist": {
|
|
736
741
|
"types": "./dist/waitlist/index.d.ts",
|
|
737
742
|
"default": "./dist/waitlist/index.js"
|
|
@@ -8,7 +8,7 @@ import { AuthHandlers } from "../web/constants.ts";
|
|
|
8
8
|
export const loginOptionsQuery = defineQueryHandler({
|
|
9
9
|
name: "login-options",
|
|
10
10
|
schema: z.object({}),
|
|
11
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
11
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
12
12
|
rateLimit: { per: "ip+handler", limit: 30, windowSeconds: 60 },
|
|
13
13
|
description:
|
|
14
14
|
"Reports which optional login-page flows (password reset, account unlock) are available, readable without signing in, so the login screen links only to flows that exist.",
|
package/packages/bundled-features/src/auth-email-password/handlers/self-registration-status.query.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { AUTH_SELF_REGISTRATION_FEATURE } from "../self-registration-toggle.ts";
|
|
|
13
13
|
export const selfRegistrationStatusQuery = defineQueryHandler({
|
|
14
14
|
name: "signup-registration-status",
|
|
15
15
|
schema: z.object({}),
|
|
16
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
16
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
17
17
|
rateLimit: { per: "ip+handler", limit: 30, windowSeconds: 60 },
|
|
18
18
|
description:
|
|
19
19
|
"Reports whether self-registration is currently switched on, readable without signing in, so a signup page can hide its own form instead of collecting an address that would be silently ignored.",
|
|
@@ -22,7 +22,10 @@ import * as z from "zod";
|
|
|
22
22
|
export const subProcessorsQuery = defineQueryHandler({
|
|
23
23
|
name: "sub-processors",
|
|
24
24
|
schema: z.object({}),
|
|
25
|
-
access: {
|
|
25
|
+
access: {
|
|
26
|
+
roles: ["anonymous", "Member", "User", "TenantAdmin", "SystemAdmin"],
|
|
27
|
+
anySignedIn: true,
|
|
28
|
+
},
|
|
26
29
|
rateLimit: { per: "ip+handler", limit: 30, windowSeconds: 60 },
|
|
27
30
|
description:
|
|
28
31
|
"Returns the publicly readable Kumiko sub-processor list split into active and planned entries, for the GDPR Art. 28(2) disclosure a privacy policy or data-processing agreement links to.",
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.410.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "contact/client subpath, app name in the report hint, Telegram documented as optional",
|
|
6
|
+
"detail": "`@cosmicdrift/kumiko-bundled-features/contact/client` exports `CONTACT_CLIENT_SOURCE` and the website client types `ContactWebsiteClient`, `ContactWebsiteWindow`, `ContactWebsiteSubmitFields`, `ContactWebsiteSubmitResult`, `ContactWebsiteFormOptions` and `ContactWebsiteKind`. The report form hint reads \"Goes straight to the {appName} team\" with the `appName` option (de, en, es, fr, it). With the default `telegram: false` the feature lists `channel-telegram` as an optional dependency only; the feature manifest, the recipe and the docs no longer show the Telegram config key or `contact:write:send-test` for that default. A signed-in visitor with any role can submit the website form and fetch the challenge."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.409.0",
|
|
4
10
|
"type": "improvement",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type * as z from "zod";
|
|
2
|
+
import type { ContactSubmitSchema } from "../payloads.ts";
|
|
3
|
+
import type { CONTACT_WEBSITE_KINDS, ContactPhoneMode } from "../web/constants.ts";
|
|
4
|
+
|
|
5
|
+
export type ContactWebsiteKind = (typeof CONTACT_WEBSITE_KINDS)[number];
|
|
6
|
+
|
|
7
|
+
export type ContactWebsiteFormOptions = {
|
|
8
|
+
readonly phone: ContactPhoneMode;
|
|
9
|
+
readonly kinds: readonly ContactWebsiteKind[];
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// The client adds challenge and nonce itself and falls back to the page language for locale.
|
|
13
|
+
export type ContactWebsiteSubmitFields = Omit<
|
|
14
|
+
z.input<typeof ContactSubmitSchema>,
|
|
15
|
+
"challenge" | "nonce" | "locale"
|
|
16
|
+
> & { readonly locale?: z.input<typeof ContactSubmitSchema>["locale"] };
|
|
17
|
+
|
|
18
|
+
export type ContactWebsiteSubmitResult =
|
|
19
|
+
| { readonly kind: "sent" }
|
|
20
|
+
| { readonly kind: "rate-limited"; readonly retryAfterSeconds?: number }
|
|
21
|
+
| { readonly kind: "failed" };
|
|
22
|
+
|
|
23
|
+
export type ContactWebsiteClient = {
|
|
24
|
+
load(): Promise<ContactWebsiteFormOptions>;
|
|
25
|
+
submit(fields: ContactWebsiteSubmitFields): Promise<ContactWebsiteSubmitResult>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// Registered by CONTACT_CLIENT_SOURCE as window.KumikoContact.
|
|
29
|
+
export type ContactWebsiteWindow = { readonly KumikoContact?: ContactWebsiteClient };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { CONTACT_CLIENT_SOURCE } from "./contact-client-source.ts";
|
|
2
|
+
export type {
|
|
3
|
+
ContactWebsiteClient,
|
|
4
|
+
ContactWebsiteFormOptions,
|
|
5
|
+
ContactWebsiteKind,
|
|
6
|
+
ContactWebsiteSubmitFields,
|
|
7
|
+
ContactWebsiteSubmitResult,
|
|
8
|
+
ContactWebsiteWindow,
|
|
9
|
+
} from "./contact-website-client.ts";
|
|
@@ -71,7 +71,10 @@ export function createContactFeature(opts: ContactOptions): FeatureDefinition {
|
|
|
71
71
|
r.uiHints({ displayLabel: "Contact", category: "communication", recommended: false });
|
|
72
72
|
r.systemScope();
|
|
73
73
|
r.requires({ features: ["config", "delivery", "user-data-rights", "files", "notes-history"] });
|
|
74
|
+
// The feature manifest and reference are built from one mounted instance, so the off
|
|
75
|
+
// default still names Telegram as an optional dependency.
|
|
74
76
|
if (telegram) r.requires({ features: [TELEGRAM_FEATURE] });
|
|
77
|
+
else r.optionalRequires(TELEGRAM_FEATURE);
|
|
75
78
|
r.adoptsBundledLists();
|
|
76
79
|
r.translations({ keys: createContactI18n() });
|
|
77
80
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { access } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
|
|
3
|
-
// The website client sends without a session (credentials: "omit"), so it
|
|
3
|
+
// The website client sends without a session (credentials: "omit"), so it arrives as anonymous; other callers that carry a session pass through anySignedIn on the handlers.
|
|
4
4
|
export const SUBMIT_ROLES = access.roles(
|
|
5
5
|
...access.anonymous,
|
|
6
6
|
...access.authenticated,
|
|
@@ -17,7 +17,7 @@ export function createChallengeQuery(settings: ContactSettings) {
|
|
|
17
17
|
return defineQueryHandler({
|
|
18
18
|
name: "challenge",
|
|
19
19
|
schema: ContactEmptySchema,
|
|
20
|
-
access: { roles: SUBMIT_ROLES, personalData: "public-intake" },
|
|
20
|
+
access: { roles: SUBMIT_ROLES, personalData: "public-intake", anySignedIn: true },
|
|
21
21
|
rateLimit: CHALLENGE_RATE_LIMIT,
|
|
22
22
|
agent: { expose: false },
|
|
23
23
|
description:
|
|
@@ -119,7 +119,7 @@ export function createSubmitHandler(opts: ContactOptions, settings: ContactSetti
|
|
|
119
119
|
return defineWriteHandler<"submit", typeof ContactSubmitSchema, ContactSubmitData>({
|
|
120
120
|
name: "submit",
|
|
121
121
|
schema: ContactSubmitSchema,
|
|
122
|
-
access: { roles: SUBMIT_ROLES, personalData: "public-intake" },
|
|
122
|
+
access: { roles: SUBMIT_ROLES, personalData: "public-intake", anySignedIn: true },
|
|
123
123
|
rateLimit: opts.rateLimit ?? DEFAULT_SUBMIT_RATE_LIMIT,
|
|
124
124
|
agent: { expose: false },
|
|
125
125
|
description:
|
|
@@ -45,7 +45,10 @@ export function createContactI18n(): Readonly<Record<string, LocalizedString>> {
|
|
|
45
45
|
"contact:entity:contact-request:field:answeredAt": { en: "Answered", de: "Beantwortet" },
|
|
46
46
|
"contact:entity:contact-request:field:closedAt": { en: "Closed", de: "Abgeschlossen" },
|
|
47
47
|
"contact:entity:contact-request:field:replyCount": { en: "Replies", de: "Antworten" },
|
|
48
|
-
"contact:report.hint": {
|
|
48
|
+
"contact:report.hint": {
|
|
49
|
+
en: "Goes straight to the {appName} team",
|
|
50
|
+
de: "Geht direkt an das Team von {appName}",
|
|
51
|
+
},
|
|
49
52
|
"contact:config.send-test.description": {
|
|
50
53
|
en: "Now sends a test message to the chat.",
|
|
51
54
|
de: "Schickt jetzt eine Testnachricht an den Chat.",
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./web/constants.ts";
|
|
12
12
|
|
|
13
13
|
export type ContactOptions = {
|
|
14
|
-
/** Name shown in the notification mails ("Testnachricht von <appName>")
|
|
14
|
+
/** Name shown in the notification mails ("Testnachricht von <appName>") and in the hint of the report form. */
|
|
15
15
|
readonly appName: string;
|
|
16
16
|
/** Default { phone: "off" }. Controls both the public form (challenge query reports it) and the admin report form. */
|
|
17
17
|
readonly fields?: { readonly phone?: ContactPhoneMode };
|
|
@@ -56,6 +56,7 @@ function createReportScreen(
|
|
|
56
56
|
summary: {
|
|
57
57
|
title: `${CONTACT_FEATURE}:report.hint`,
|
|
58
58
|
subtitle: `${CONTACT_FEATURE}:report.summary`,
|
|
59
|
+
params: { appName: opts.appName },
|
|
59
60
|
},
|
|
60
61
|
fields: {
|
|
61
62
|
kind: { type: "select", options: CONTACT_ADMIN_KINDS, required: true, display: "radio" },
|
package/packages/bundled-features/src/file-derivatives/handlers/public-variant-by-file-ref.query.ts
CHANGED
|
@@ -31,7 +31,7 @@ export const PUBLIC_VARIANT_BY_FILE_REF_QN = "file-derivatives:query:public-vari
|
|
|
31
31
|
export const publicVariantByFileRefQuery = defineQueryHandler({
|
|
32
32
|
name: "public-variant-by-file-ref",
|
|
33
33
|
schema: publicVariantPayloadSchema,
|
|
34
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
34
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
35
35
|
agent: { expose: false },
|
|
36
36
|
rateLimit: { per: "ip", limit: 60, windowSeconds: 60 },
|
|
37
37
|
escapeHatch: {
|
|
@@ -93,7 +93,7 @@ export const publicVariantPayloadSchema = z.object({
|
|
|
93
93
|
export const publicVariantQuery = defineQueryHandler({
|
|
94
94
|
name: "public-variant",
|
|
95
95
|
schema: publicVariantPayloadSchema,
|
|
96
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
96
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
97
97
|
agent: { expose: false },
|
|
98
98
|
// ponytail: "ip" is the ONLY throttle on an anonymous, internet-facing
|
|
99
99
|
// render/storage-cost route — its accuracy depends on the server's
|
|
@@ -18,7 +18,7 @@ export function createBrandingQuery(opts: { readonly allowCustomCss: boolean })
|
|
|
18
18
|
return defineQueryHandler({
|
|
19
19
|
name: "branding",
|
|
20
20
|
schema: z.object({}),
|
|
21
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
21
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
22
22
|
rateLimit: { per: "ip+handler", limit: 60, windowSeconds: 60 },
|
|
23
23
|
description:
|
|
24
24
|
"Reads the tenant's public branding values for the rendered page shell, adding the raw custom CSS only when the app opted in and the per-tenant CSS toggle is on; anonymous callers may read it because it dresses public pages.",
|
|
@@ -15,7 +15,7 @@ export const bySlugQuery = defineQueryHandler({
|
|
|
15
15
|
slug: z.string().min(1).max(64),
|
|
16
16
|
lang: z.string().min(2).max(8),
|
|
17
17
|
}),
|
|
18
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
18
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
19
19
|
rateLimit: { per: "ip+handler", limit: 60, windowSeconds: 60 },
|
|
20
20
|
description:
|
|
21
21
|
"Reads the body and metadata of one published managed page of the caller's tenant by slug and language, returning null for drafts and bodyless pages; use it to render a public page, not to load one for editing.",
|
|
@@ -23,7 +23,7 @@ export const byTenantPublishedQuery = defineQueryHandler({
|
|
|
23
23
|
* logic in by-slug.query. */
|
|
24
24
|
tenantIdOverride: z.string().min(1).optional(),
|
|
25
25
|
}),
|
|
26
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
26
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
27
27
|
rateLimit: { per: "ip+handler", limit: 60, windowSeconds: 60 },
|
|
28
28
|
description:
|
|
29
29
|
"Lists every published page of a tenant with slug, language, title and last-change time but no body; use it to enumerate the public pages for sitemap.xml or llms.txt, rather than by-slug which fetches one page's content.",
|
|
@@ -17,7 +17,7 @@ import { SEO_CONFIG_QN } from "../constants.ts";
|
|
|
17
17
|
export const seoConfigQuery = defineQueryHandler({
|
|
18
18
|
name: "config",
|
|
19
19
|
schema: z.object({}),
|
|
20
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
20
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
21
21
|
rateLimit: { per: "ip+handler", limit: 60, windowSeconds: 60 },
|
|
22
22
|
description:
|
|
23
23
|
"Reads the tenant's SEO metadata settings — organization name and logo URL, Twitter site handle, LLMs summary and default OG image — as plain strings; use it to inspect what the sitemap, llms.txt and page meta tags will publish.",
|
|
@@ -8,7 +8,7 @@ export function makeCheckoutConfigQuery(readCheckoutConfig: PaddleRuntimes["read
|
|
|
8
8
|
return defineQueryHandler({
|
|
9
9
|
name: "checkout-config",
|
|
10
10
|
schema: z.object({}),
|
|
11
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
11
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
12
12
|
rateLimit: { per: "ip+handler", limit: 60, windowSeconds: 60 },
|
|
13
13
|
description:
|
|
14
14
|
"Answers the public Paddle.js client token and the Paddle environment for the checkout page; the client token is public by design and no other config leaves this handler.",
|
|
@@ -26,7 +26,7 @@ export const bySlugQuery = defineQueryHandler({
|
|
|
26
26
|
/** Optional cross-tenant read — SystemAdmin only. See set.write.ts. */
|
|
27
27
|
tenantIdOverride: z.string().min(1).optional(),
|
|
28
28
|
}),
|
|
29
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
29
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
30
30
|
rateLimit: { per: "ip+handler", limit: 60, windowSeconds: 60 },
|
|
31
31
|
description:
|
|
32
32
|
"Reads one text-block of a tenant by slug and locale together with its body and format; it is pinned to the text-block kind so mail templates and AI prompts in the same table stay unreachable through this anonymous-capable path.",
|
|
@@ -31,7 +31,7 @@ export const byTenantQuery = defineQueryHandler({
|
|
|
31
31
|
/** Optional cross-tenant read — SystemAdmin only. Symmetric to by-slug. */
|
|
32
32
|
tenantIdOverride: z.string().min(1).optional(),
|
|
33
33
|
}),
|
|
34
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
34
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
35
35
|
rateLimit: { per: "ip+handler", limit: 60, windowSeconds: 60 },
|
|
36
36
|
description:
|
|
37
37
|
"Lists every text-block of a tenant with slug, locale, title and body so a public content tree can be rendered in one call; use it for the whole sidebar, and by-slug when only one block is needed.",
|
|
@@ -12,7 +12,10 @@ export function createKeepAccountHandler(opts: { readonly keepAccountTokenSecret
|
|
|
12
12
|
return defineWriteHandler({
|
|
13
13
|
name: "keep-account",
|
|
14
14
|
schema: z.object({ token: z.string().min(1) }),
|
|
15
|
-
access: {
|
|
15
|
+
access: {
|
|
16
|
+
roles: ["anonymous", "Member", "User", "TenantAdmin", "TenantOwner", "SystemAdmin"],
|
|
17
|
+
anySignedIn: true,
|
|
18
|
+
},
|
|
16
19
|
escapeHatch: { grants: ["unsafeRaw"], reason: KEEP_ACCOUNT_ESCAPE_HATCH_REASON },
|
|
17
20
|
agent: { expose: false },
|
|
18
21
|
rateLimit: { per: "ip+handler", limit: 10, windowSeconds: 60 },
|
package/packages/bundled-features/src/user-data-rights/handlers/confirm-deletion-by-token.write.ts
CHANGED
|
@@ -56,7 +56,10 @@ export function createConfirmDeletionByTokenHandler(opts: ConfirmDeletionByToken
|
|
|
56
56
|
return defineWriteHandler({
|
|
57
57
|
name: "confirm-deletion-by-token",
|
|
58
58
|
schema: z.object({ token: z.string().min(1) }),
|
|
59
|
-
access: {
|
|
59
|
+
access: {
|
|
60
|
+
roles: ["anonymous", "Member", "User", "TenantAdmin", "SystemAdmin"],
|
|
61
|
+
anySignedIn: true,
|
|
62
|
+
},
|
|
60
63
|
escapeHatch: {
|
|
61
64
|
reason:
|
|
62
65
|
"resolveGracePeriod reads the tenant compliance profile via ctx.dispatch.queryAs(SYSTEM, " +
|
|
@@ -79,6 +79,7 @@ export const downloadByTokenQuery = defineQueryHandler({
|
|
|
79
79
|
access: {
|
|
80
80
|
roles: ["anonymous", "Member", "User", "TenantAdmin", "SystemAdmin"],
|
|
81
81
|
personalData: "public-intake",
|
|
82
|
+
anySignedIn: true,
|
|
82
83
|
},
|
|
83
84
|
agent: { expose: false },
|
|
84
85
|
// Brute-force protection for token-hash probing. This anonymous endpoint uses a
|
package/packages/bundled-features/src/user-data-rights/handlers/request-deletion-by-email.write.ts
CHANGED
|
@@ -61,7 +61,10 @@ export function createRequestDeletionByEmailHandler(opts: RequestDeletionByEmail
|
|
|
61
61
|
return defineWriteHandler({
|
|
62
62
|
name: "request-deletion-by-email",
|
|
63
63
|
schema: z.object({ email: z.email() }),
|
|
64
|
-
access: {
|
|
64
|
+
access: {
|
|
65
|
+
roles: ["anonymous", "Member", "User", "TenantAdmin", "SystemAdmin"],
|
|
66
|
+
anySignedIn: true,
|
|
67
|
+
},
|
|
65
68
|
description:
|
|
66
69
|
"Mails an account-deletion verification link to the given address, for a user who wants to be erased but can no longer log in; it answers identically whether or not the address belongs to an active account and never returns the link.",
|
|
67
70
|
// Mails a deletion link to any address the caller names.
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.410.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "Signed-in visitors can join the waitlist whatever their roles",
|
|
6
|
+
"detail": "`waitlist:write:submit` used to answer 403 when the browser sent the session cookie of a user without one of the listed roles. It now admits every signed-in caller through `anySignedIn`."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.389.0",
|
|
4
10
|
"type": "fix",
|
|
@@ -33,7 +33,6 @@ const SUBMIT_LOCK_NAMESPACE = 0x776c7374;
|
|
|
33
33
|
const SUBMIT_LOCK_REASON =
|
|
34
34
|
"takes the per-email advisory lock so parallel submits cannot both pass the duplicate check and wraps the admin-recipient resolver in a savepoint so a failing statement cannot abort the submit transaction; TenantDb has neither API";
|
|
35
35
|
|
|
36
|
-
// Logged-in callers carry no anonymous role, so every signed-in role must be listed.
|
|
37
36
|
const SUBMIT_ROLES = access.roles(
|
|
38
37
|
...access.anonymous,
|
|
39
38
|
...access.authenticated,
|
|
@@ -132,7 +131,7 @@ export function createSubmitHandler(opts: WaitlistOptions) {
|
|
|
132
131
|
return defineWriteHandler<"submit", typeof WaitlistSubmitSchema, WaitlistSubmitData>({
|
|
133
132
|
name: "submit",
|
|
134
133
|
schema: WaitlistSubmitSchema,
|
|
135
|
-
access: { roles: SUBMIT_ROLES, personalData: "public-intake" },
|
|
134
|
+
access: { roles: SUBMIT_ROLES, personalData: "public-intake", anySignedIn: true },
|
|
136
135
|
rateLimit: opts.rateLimit ?? DEFAULT_SUBMIT_RATE_LIMIT,
|
|
137
136
|
// An empty array means "disabled"; boot validation rejects an empty additionalRateLimits.
|
|
138
137
|
...(emailRateLimits.length > 0 && { additionalRateLimits: emailRateLimits }),
|
|
@@ -704,10 +704,11 @@
|
|
|
704
704
|
"delivery",
|
|
705
705
|
"user-data-rights",
|
|
706
706
|
"files",
|
|
707
|
-
"notes-history"
|
|
707
|
+
"notes-history"
|
|
708
|
+
],
|
|
709
|
+
"optionalRequires": [
|
|
708
710
|
"channel-telegram"
|
|
709
711
|
],
|
|
710
|
-
"optionalRequires": [],
|
|
711
712
|
"configReads": [],
|
|
712
713
|
"exposesApis": [],
|
|
713
714
|
"usesApis": [],
|
|
@@ -742,27 +743,6 @@
|
|
|
742
743
|
"readRoles": [
|
|
743
744
|
"SystemAdmin"
|
|
744
745
|
]
|
|
745
|
-
},
|
|
746
|
-
{
|
|
747
|
-
"key": "telegram-chat",
|
|
748
|
-
"qualifiedName": "contact:config:telegram-chat",
|
|
749
|
-
"type": "text",
|
|
750
|
-
"scope": "system",
|
|
751
|
-
"default": "",
|
|
752
|
-
"encrypted": false,
|
|
753
|
-
"computed": false,
|
|
754
|
-
"validated": false,
|
|
755
|
-
"options": null,
|
|
756
|
-
"bounds": null,
|
|
757
|
-
"pattern": {
|
|
758
|
-
"regex": "^$|^(-?[0-9]{1,20}|@[A-Za-z0-9_]{5,32})$"
|
|
759
|
-
},
|
|
760
|
-
"writeRoles": [
|
|
761
|
-
"SystemAdmin"
|
|
762
|
-
],
|
|
763
|
-
"readRoles": [
|
|
764
|
-
"SystemAdmin"
|
|
765
|
-
]
|
|
766
746
|
}
|
|
767
747
|
],
|
|
768
748
|
"secrets": [],
|
|
@@ -773,7 +753,6 @@
|
|
|
773
753
|
"contact:write:reply",
|
|
774
754
|
"contact:write:report",
|
|
775
755
|
"contact:write:send-reply-mail",
|
|
776
|
-
"contact:write:send-test",
|
|
777
756
|
"contact:write:submit"
|
|
778
757
|
],
|
|
779
758
|
"uiHints": {
|
|
@@ -8,7 +8,6 @@ import { chromium } from "@playwright/test";
|
|
|
8
8
|
import { E2E_PORTS } from "../../e2e/e2e-ports";
|
|
9
9
|
|
|
10
10
|
const PORT = E2E_PORTS["framework/use-all-bundled"];
|
|
11
|
-
const FAKE_TELEGRAM_PORT = E2E_PORTS["framework/use-all-bundled-fake-telegram"];
|
|
12
11
|
const PRINT_SERVICE_PORT = E2E_PORTS["framework/use-all-bundled-puppeteer-service"];
|
|
13
12
|
// Both sides of the print service handshake; any value of 16+ characters will do for a local run.
|
|
14
13
|
const PRINT_SERVICE_TOKEN = "use-all-bundled-e2e-print-service";
|
|
@@ -19,7 +18,6 @@ const appConfig = defineAppE2eConfig({
|
|
|
19
18
|
...PLAYWRIGHT_DEMO_ENV,
|
|
20
19
|
PUPPETEER_SERVICE_URL: `http://127.0.0.1:${PRINT_SERVICE_PORT}`,
|
|
21
20
|
PUPPETEER_AUTH_TOKEN: PRINT_SERVICE_TOKEN,
|
|
22
|
-
SAMPLE_TELEGRAM_API_URL: `http://127.0.0.1:${FAKE_TELEGRAM_PORT}`,
|
|
23
21
|
},
|
|
24
22
|
});
|
|
25
23
|
|
|
@@ -35,10 +35,7 @@ import {
|
|
|
35
35
|
} from "@cosmicdrift/kumiko-bundled-features/channel-push";
|
|
36
36
|
import { createChannelSlackFeature } from "@cosmicdrift/kumiko-bundled-features/channel-slack";
|
|
37
37
|
import { createChannelTeamsFeature } from "@cosmicdrift/kumiko-bundled-features/channel-teams";
|
|
38
|
-
import {
|
|
39
|
-
createChannelTelegramFeature,
|
|
40
|
-
type TelegramChannelOptions,
|
|
41
|
-
} from "@cosmicdrift/kumiko-bundled-features/channel-telegram";
|
|
38
|
+
import { createChannelTelegramFeature } from "@cosmicdrift/kumiko-bundled-features/channel-telegram";
|
|
42
39
|
import { createComplianceProfilesFeature } from "@cosmicdrift/kumiko-bundled-features/compliance-profiles";
|
|
43
40
|
import { createComplianceProfilesOpsFeature } from "@cosmicdrift/kumiko-bundled-features/compliance-profiles-ops";
|
|
44
41
|
import {
|
|
@@ -134,18 +131,10 @@ const stubPushTransport: PushTransport = {
|
|
|
134
131
|
// no token minted here is ever trusted by a deployment.
|
|
135
132
|
const SMOKE_HMAC_SECRET = "use-all-bundled-smoke-hmac-key-0123456789";
|
|
136
133
|
|
|
137
|
-
// The e2e points the Telegram channel at a local stub so the contact forward reads "delivered" without the real Bot API.
|
|
138
|
-
function fakeTelegramApiOptions(): TelegramChannelOptions {
|
|
139
|
-
const apiBaseUrl = process.env["SAMPLE_TELEGRAM_API_URL"];
|
|
140
|
-
if (apiBaseUrl === undefined) return {};
|
|
141
|
-
return { apiBaseUrl, allowedHosts: [new URL(apiBaseUrl).hostname], requireHttps: false };
|
|
142
|
-
}
|
|
143
|
-
|
|
144
134
|
export const APP_FEATURES = [
|
|
145
135
|
localeDe(),
|
|
146
136
|
// foundations not in the auto-mounted bundled-set
|
|
147
|
-
|
|
148
|
-
createSecretsFeature({ roles: ["TenantAdmin", "SystemAdmin"] }),
|
|
137
|
+
createSecretsFeature(),
|
|
149
138
|
...composeSecurityStack(),
|
|
150
139
|
// auth-mfa: composeFeatures auto-threads mfaStatusCheckerFromFeature into
|
|
151
140
|
// the auto-mounted auth-email-password login handler when this feature is
|
|
@@ -201,7 +190,7 @@ export const APP_FEATURES = [
|
|
|
201
190
|
createChannelSlackFeature(),
|
|
202
191
|
createChannelDiscordFeature(),
|
|
203
192
|
createChannelTeamsFeature(),
|
|
204
|
-
createChannelTelegramFeature(
|
|
193
|
+
createChannelTelegramFeature(),
|
|
205
194
|
|
|
206
195
|
...composeMailStack({ transports: ["inmemory", "smtp"] }),
|
|
207
196
|
|
|
@@ -328,7 +317,6 @@ export const APP_FEATURES = [
|
|
|
328
317
|
appName: "publicstatus",
|
|
329
318
|
appVersion: "2026.10.30",
|
|
330
319
|
fields: { phone: "optional" },
|
|
331
|
-
telegram: true,
|
|
332
320
|
reportCancelTarget: "admin-shell:screen:tenant-overview",
|
|
333
321
|
// Lowest values the options allow, so the e2e submit does not wait on the challenge.
|
|
334
322
|
spamProtection: { minSubmitSeconds: 0, proofOfWorkBits: 8 },
|
|
@@ -6,6 +6,8 @@ Public endpoints without a logged-in user.
|
|
|
6
6
|
|
|
7
7
|
- `access: "anonymous"` on handlers that must stay public
|
|
8
8
|
- Rate limits that still bind anonymous callers (`per: "ip+handler"`)
|
|
9
|
+
- `anySignedIn: true` next to `anonymous`, so a visitor who is signed in with a role the
|
|
10
|
+
handler does not list is not turned away from a public form
|
|
9
11
|
|
|
10
12
|
## Source
|
|
11
13
|
|
|
@@ -104,7 +104,13 @@ export const anonymousAccessFeature = defineFeature("shop", (r) => {
|
|
|
104
104
|
// anonymous root handler — the runtime personal-data gate
|
|
105
105
|
// (write-origin.ts) requires this explicit opt-in, the same way the
|
|
106
106
|
// boot validator would reject an openToAll declaration missing it.
|
|
107
|
-
|
|
107
|
+
// The browser sends the session cookie along, so a signed-in visitor arrives with its
|
|
108
|
+
// roles; anySignedIn keeps the checkout open to them whatever those roles are.
|
|
109
|
+
access: {
|
|
110
|
+
roles: [...access.anonymous, "User"],
|
|
111
|
+
personalData: "public-intake",
|
|
112
|
+
anySignedIn: true,
|
|
113
|
+
},
|
|
108
114
|
rateLimit: { per: "ip+handler", limit: 30, windowSeconds: 60 },
|
|
109
115
|
});
|
|
110
116
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Public contact form backend. The `contact` bundled feature stores questions, contact
|
|
4
4
|
requests and problem reports from website visitors and notifies every SystemAdmin (mail,
|
|
5
|
-
|
|
5
|
+
Telegram only when the app turns it on). The notification names only the kind, the app and a link into the inbox:
|
|
6
6
|
no name, address, phone, subject or message. Telegram is a third party where nothing can be
|
|
7
7
|
shredded or recalled, so it gets the same minimal text. Website senders get a fixed
|
|
8
8
|
acknowledgement that repeats nothing they typed; signed-in admin reports get a copy.
|
|
@@ -40,7 +40,13 @@ bun test --config=bunfig.integration.toml samples/recipes/contact
|
|
|
40
40
|
## Integration into a real app
|
|
41
41
|
|
|
42
42
|
1. Mount `createContactFeature({ appName })` plus delivery, a mail channel, `user-data-rights`,
|
|
43
|
-
`files` with a file provider
|
|
43
|
+
`files` with a file provider and `config`.
|
|
44
44
|
2. Run `kumiko schema generate` (new tables, plus the delivery `idempotency_key` column).
|
|
45
|
-
3. SystemAdmins set `contact:config:reply-to`
|
|
46
|
-
4. Embed `/contact/client.js` on the website; the form is yours.
|
|
45
|
+
3. SystemAdmins set `contact:config:reply-to` in the admin.
|
|
46
|
+
4. Embed `/contact/client.js` on the website; the form is yours. A website served by another
|
|
47
|
+
server can serve the same script from `CONTACT_CLIENT_SOURCE` and type its calls with
|
|
48
|
+
`ContactWebsiteClient`, both from `@cosmicdrift/kumiko-bundled-features/contact/client`.
|
|
49
|
+
|
|
50
|
+
Telegram is optional and off by default: notifications go by mail to SystemAdmins only. An app
|
|
51
|
+
that turns it on (`telegram: true`) also mounts `channel-telegram` and `secrets` for the bot
|
|
52
|
+
token, and SystemAdmins set `contact:config:telegram-chat`.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
//
|
|
14
14
|
// Prerequisites the app wires itself:
|
|
15
15
|
// - `anonymousAccess` (defaultTenantId = SYSTEM_TENANT_ID) so the form needs no login
|
|
16
|
-
// - delivery with a mail channel (
|
|
16
|
+
// - delivery with a mail channel (channel-telegram only with `telegram: true`, off by default)
|
|
17
17
|
// - a file provider, because the entities carry file fields
|
|
18
18
|
// - `kumiko schema generate` for the new tables
|
|
19
19
|
|