@kardalum/plugin-sdk 0.17.0 → 0.19.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/CHANGELOG.md +109 -0
- package/README.md +4 -3
- package/dist/assets/asset-picker.d.ts +11 -0
- package/dist/assets/asset-picker.js +109 -0
- package/dist/assets/asset-tree.d.ts +30 -0
- package/dist/assets/asset-tree.js +150 -0
- package/dist/built-in-editor-ids.d.ts +1 -0
- package/dist/built-in-editor-ids.js +20 -0
- package/dist/built-in-serializers.js +1 -1
- package/dist/built-in-settings-schemas.d.ts +2 -0
- package/dist/built-in-settings-schemas.js +31 -4
- package/dist/built-in-value-schemas.js +3 -0
- package/dist/built-ins.js +20 -11
- package/dist/capabilities.js +5 -0
- package/dist/data-type-plugin.d.ts +2 -2
- package/dist/datatype-validation.d.ts +2 -2
- package/dist/datatype-validation.js +20 -6
- package/dist/datatypes-entry.d.ts +1 -0
- package/dist/datatypes-entry.js +1 -0
- package/dist/define-plugin.d.ts +4 -4
- package/dist/define-plugin.js +5 -5
- package/dist/entitlement-entry.d.ts +3 -2
- package/dist/entitlement-entry.js +13 -1
- package/dist/entitlement-gate.d.ts +18 -0
- package/dist/entitlement-gate.js +95 -21
- package/dist/entitlement-plan.d.ts +21 -0
- package/dist/entitlement-plan.js +26 -0
- package/dist/entitlement-types.d.ts +21 -4
- package/dist/entitlement.d.ts +29 -1
- package/dist/entitlement.js +39 -0
- package/dist/grid-arrow-step.d.ts +7 -0
- package/dist/grid-arrow-step.js +20 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +11 -12
- package/dist/manifest-entry.d.ts +4 -0
- package/dist/manifest-entry.js +4 -0
- package/dist/manifest-schema.d.ts +5 -1
- package/dist/manifest-schema.js +14 -2
- package/dist/manifest.d.ts +21 -1
- package/dist/media/media-picker.js +34 -34
- package/dist/notify.d.ts +17 -0
- package/dist/notify.js +17 -0
- package/dist/plugin-context.js +3 -3
- package/dist/register-built-ins.js +6 -6
- package/dist/registry.js +1 -1
- package/dist/richtext/block-panel.js +19 -20
- package/dist/richtext/extensions.js +17 -8
- package/dist/richtext/insert-menu.js +4 -4
- package/dist/richtext/kardalum-block.js +17 -17
- package/dist/richtext/style-listbox.js +2 -2
- package/dist/richtext/text-style-class.js +1 -1
- package/dist/richtext-html-entry.d.ts +35 -0
- package/dist/richtext-html-entry.js +73 -0
- package/dist/simple-storage-value-provider.js +3 -3
- package/dist/structured-storage-types.d.ts +12 -1
- package/dist/structured-storage-types.js +2 -2
- package/dist/tailwind.js +10 -3
- package/dist/tokens/tailwind-theme.css +176 -0
- package/dist/tokens/tokens.css +1 -0
- package/dist/tokens/tokens.json +2 -1
- package/dist/ui-entry.js +3 -3
- package/dist/vendor-check.d.ts +39 -0
- package/dist/vendor-check.js +79 -0
- package/dist/vendor-entry.d.ts +3 -0
- package/dist/vendor-entry.js +9 -0
- package/dist/vendor-service.d.ts +20 -0
- package/dist/vendor-service.js +20 -0
- package/dist/views/asset-view.d.ts +6 -0
- package/dist/views/asset-view.js +55 -0
- package/dist/views/content-list-settings-view.js +1 -1
- package/dist/views/content-list-view.js +1 -1
- package/dist/views/date-range-view.js +5 -5
- package/dist/views/html-code-editor.js +2 -3
- package/dist/views/html-view.js +7 -7
- package/dist/views/image-view.js +5 -5
- package/dist/views/rich-text-view.js +33 -32
- package/node_modules/@kardalum/api-schemas/README.md +1 -1
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +17 -15
- package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.d.ts +21 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.js +42 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +10 -3
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.d.ts +36 -0
- package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.js +46 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +30 -9
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -3
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +12 -6
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +11 -6
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +50 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +26 -6
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +6 -3
- package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.js +28 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +56 -6
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +8 -8
- package/node_modules/@kardalum/api-schemas/dist/home.schema.d.ts +130 -0
- package/node_modules/@kardalum/api-schemas/dist/home.schema.js +87 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +48 -19
- package/node_modules/@kardalum/api-schemas/dist/index.js +34 -12
- package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.d.ts +46 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.js +52 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +162 -1
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +144 -9
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +15 -9
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +5 -5
- package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +93 -0
- package/node_modules/@kardalum/api-schemas/dist/news.schema.js +86 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +410 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +193 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +86 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +92 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +7 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +1 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +251 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +196 -31
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +19 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +33 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +3 -3
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +10 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +24 -4
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +23 -20
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.d.ts +83 -0
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +73 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +207 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +147 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +17 -8
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +14 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +27 -12
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +22 -10
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +6 -1
- package/node_modules/@kardalum/api-schemas/dist/uuid.schema.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/uuid.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +88 -0
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +100 -0
- package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +5 -0
- package/node_modules/@kardalum/design-tokens/README.md +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +2 -2
- package/node_modules/@kardalum/design-tokens/dist/build-theme-css.d.ts +16 -0
- package/node_modules/@kardalum/design-tokens/dist/build-theme-css.js +76 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.js +4 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +176 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-css.js +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/themes/light.js +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +3 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +6 -5
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +2 -1
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -1
- package/node_modules/@kardalum/design-tokens/dist/types.js +1 -1
- package/node_modules/@kardalum/design-tokens/package.json +6 -3
- package/node_modules/@kardalum/plugin-package/README.md +1 -1
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +4 -4
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +54 -6
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +18 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +9 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +58 -1
- package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/envelope.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +3 -3
- package/node_modules/@kardalum/plugin-package/dist/extract.js +10 -10
- package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/hash.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
- package/node_modules/@kardalum/plugin-package/dist/index.js +3 -1
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +56 -19
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +119 -25
- package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/package-contract.js +5 -5
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/vendor-token.d.ts +24 -0
- package/node_modules/@kardalum/plugin-package/dist/vendor-token.js +118 -0
- package/node_modules/@kardalum/ui/README.md +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +8 -3
- package/node_modules/@kardalum/ui/dist/components/badge.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/button.js +2 -2
- package/node_modules/@kardalum/ui/dist/components/checkbox.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.js +52 -4
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +5 -1
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +20 -7
- package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +4 -4
- package/node_modules/@kardalum/ui/dist/components/input.js +6 -1
- package/node_modules/@kardalum/ui/dist/components/popover-panel.d.ts +4 -0
- package/node_modules/@kardalum/ui/dist/components/popover-panel.js +13 -0
- package/node_modules/@kardalum/ui/dist/components/property-field.js +3 -3
- package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/sheet.js +15 -9
- package/node_modules/@kardalum/ui/dist/components/skeleton.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +3 -3
- package/node_modules/@kardalum/ui/dist/components/tab-strip.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/toast.js +4 -3
- package/node_modules/@kardalum/ui/dist/components/tooltip.d.ts +27 -0
- package/node_modules/@kardalum/ui/dist/components/tooltip.js +82 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +11 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.js +94 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +2 -2
- package/node_modules/@kardalum/ui/dist/index.d.ts +4 -1
- package/node_modules/@kardalum/ui/dist/index.js +4 -1
- package/node_modules/@kardalum/ui/dist/lib/menu-host.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/lib/menu-host.js +17 -0
- package/node_modules/@kardalum/ui/package.json +8 -6
- package/package.json +21 -7
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PLUGIN_ID_MAX } from "./plugin-manifest-fields.js";
|
|
3
|
+
// S314n (2026-10-28-s314n-home-with-built-in-widgets-design.md, C4): News from
|
|
4
|
+
// Kardalum, written by the marketplace operator on the portal's News screen.
|
|
5
|
+
// An item has a kind, an English title and text, an optional German version
|
|
6
|
+
// (title and text together) and an optional https link; a New plugin item
|
|
7
|
+
// names a published listing and links to it instead, the CMS building that
|
|
8
|
+
// link from its marketplace's address. The marketplace's public read serves
|
|
9
|
+
// the three newest published items; the CMS hands them to Home with the
|
|
10
|
+
// marketplace's address for a browser.
|
|
11
|
+
export const NEWS_KINDS = ["announcement", "release", "plugin"];
|
|
12
|
+
export const NewsKindSchema = z.enum(NEWS_KINDS, { error: "Pick a kind." });
|
|
13
|
+
export const NEWS_STATES = ["draft", "published", "unpublished"];
|
|
14
|
+
export const NewsStateSchema = z.enum(NEWS_STATES);
|
|
15
|
+
/** The longest title of a news item, in either language. */
|
|
16
|
+
export const NEWS_TITLE_MAX = 120;
|
|
17
|
+
/** The longest text of a news item, in either language. */
|
|
18
|
+
export const NEWS_TEXT_MAX = 280;
|
|
19
|
+
/** The longest link. */
|
|
20
|
+
export const NEWS_URL_MAX = 500;
|
|
21
|
+
/** How many published items the news read serves, newest first. */
|
|
22
|
+
export const NEWS_ITEMS_MAX = 3;
|
|
23
|
+
const newsTitle = () => z.string().trim().min(1, "Write a title.").max(NEWS_TITLE_MAX, `A title has at most ${NEWS_TITLE_MAX} characters.`);
|
|
24
|
+
const newsText = () => z.string().trim().min(1, "Write a text.").max(NEWS_TEXT_MAX, `A text has at most ${NEWS_TEXT_MAX} characters.`);
|
|
25
|
+
/** https only, so an item cannot carry a script or data link to every Home. */
|
|
26
|
+
const httpsUrl = () => z.url({ protocol: /^https$/, error: "A link starts with https://." }).max(NEWS_URL_MAX, `A link has at most ${NEWS_URL_MAX} characters.`);
|
|
27
|
+
const pluginIdField = () => z.string().min(1).max(PLUGIN_ID_MAX);
|
|
28
|
+
function checkNewsItem(item, ctx) {
|
|
29
|
+
if ((item.titleDe === null) !== (item.textDe === null)) {
|
|
30
|
+
ctx.addIssue({
|
|
31
|
+
code: "custom",
|
|
32
|
+
path: [item.titleDe === null ? "titleDe" : "textDe"],
|
|
33
|
+
message: "Write the German title and text together, or leave both empty.",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (item.kind === "plugin" && item.pluginId === null) {
|
|
37
|
+
ctx.addIssue({ code: "custom", path: ["pluginId"], message: "A New plugin item names the published plugin it announces." });
|
|
38
|
+
}
|
|
39
|
+
if (item.kind !== "plugin" && item.pluginId !== null) {
|
|
40
|
+
ctx.addIssue({ code: "custom", path: ["pluginId"], message: "Only a New plugin item names a plugin." });
|
|
41
|
+
}
|
|
42
|
+
if (item.kind === "plugin" && item.url !== null) {
|
|
43
|
+
ctx.addIssue({ code: "custom", path: ["url"], message: "A New plugin item links to its listing and takes no link of its own." });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/** What the operator's editor saves: every field of an item but its state and its dates. */
|
|
47
|
+
export const NewsItemInputSchema = z
|
|
48
|
+
.object({
|
|
49
|
+
kind: NewsKindSchema,
|
|
50
|
+
pluginId: pluginIdField().nullable(),
|
|
51
|
+
titleEn: newsTitle(),
|
|
52
|
+
textEn: newsText(),
|
|
53
|
+
titleDe: newsTitle().nullable(),
|
|
54
|
+
textDe: newsText().nullable(),
|
|
55
|
+
url: httpsUrl().nullable(),
|
|
56
|
+
})
|
|
57
|
+
.strict()
|
|
58
|
+
.superRefine(checkNewsItem);
|
|
59
|
+
/**
|
|
60
|
+
* One published item as the marketplace serves it. Not strict, so a field a
|
|
61
|
+
* later marketplace adds does not break an older CMS. A fresh instance per
|
|
62
|
+
* use: the OpenAPI conversion drops a schema instance two schemas share.
|
|
63
|
+
*/
|
|
64
|
+
function newsItem() {
|
|
65
|
+
return z
|
|
66
|
+
.object({
|
|
67
|
+
id: z.string().min(1).max(100),
|
|
68
|
+
kind: NewsKindSchema,
|
|
69
|
+
pluginId: pluginIdField().nullable(),
|
|
70
|
+
titleEn: newsTitle(),
|
|
71
|
+
textEn: newsText(),
|
|
72
|
+
titleDe: newsTitle().nullable(),
|
|
73
|
+
textDe: newsText().nullable(),
|
|
74
|
+
url: httpsUrl().nullable(),
|
|
75
|
+
publishedAt: z.string().datetime(),
|
|
76
|
+
})
|
|
77
|
+
.superRefine(checkNewsItem);
|
|
78
|
+
}
|
|
79
|
+
export const MarketplaceNewsItemSchema = newsItem();
|
|
80
|
+
/** What the marketplace's GET /api/v1/news answers (C4): the newest published items. */
|
|
81
|
+
export const MarketplaceNewsResponseSchema = z.object({ items: z.array(newsItem()).max(NEWS_ITEMS_MAX) });
|
|
82
|
+
/** What the CMS's GET /api/manage/v1/home/news answers: the marketplace's items and its address for a browser. */
|
|
83
|
+
export const HomeNewsResponseSchema = z.object({
|
|
84
|
+
items: z.array(newsItem()).max(NEWS_ITEMS_MAX),
|
|
85
|
+
marketplaceUrl: z.url({ protocol: /^https?$/ }),
|
|
86
|
+
});
|
|
@@ -213,6 +213,19 @@ export const SaveNodePermissionsRequestSchema = z
|
|
|
213
213
|
ctx.addIssue({ code: "custom", message: "A subject is granted once per entry", path: ["rows", i, "entry", "grants"] });
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
|
+
})
|
|
217
|
+
// S314c6 (D6): a generated array repeats its first item, and five rows of one action are
|
|
218
|
+
// what the refinement refuses; the example names each action once.
|
|
219
|
+
.meta({
|
|
220
|
+
example: {
|
|
221
|
+
rows: [
|
|
222
|
+
{ action: "content.read", entry: { mode: "restricted", grants: [{ subjectKind: "role", subjectId: "editor" }] } },
|
|
223
|
+
{ action: "content.create", entry: null },
|
|
224
|
+
{ action: "content.update", entry: null },
|
|
225
|
+
{ action: "content.publish", entry: null },
|
|
226
|
+
{ action: "content.delete", entry: null },
|
|
227
|
+
],
|
|
228
|
+
},
|
|
216
229
|
});
|
|
217
230
|
/** The body of a save the server refused. `action` is the row at fault, when
|
|
218
231
|
* one is. `reason` is what a screen words the refusal by in its own
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const NOTIFICATION_TITLE_MAX = 120;
|
|
3
|
+
export declare const NOTIFICATION_TEXT_MAX = 1000;
|
|
4
|
+
export declare const NOTIFICATION_URL_MAX = 500;
|
|
5
|
+
export declare const NOTIFICATION_ROLES_MAX = 20;
|
|
6
|
+
export declare const NOTIFICATION_USERS_MAX = 50;
|
|
7
|
+
/** S314n3 (D2): the most actions ("everyone who may publish") one send names. */
|
|
8
|
+
export declare const NOTIFICATION_ACTIONS_MAX = 10;
|
|
9
|
+
/** More people than this in one send is refused. */
|
|
10
|
+
export declare const NOTIFICATION_RECIPIENTS_MAX = 5000;
|
|
11
|
+
/** One page of an inbox list, newest first. */
|
|
12
|
+
export declare const NOTIFICATION_PAGE_SIZE = 20;
|
|
13
|
+
/** The unread count is exact up to this, and "99+" beyond it. */
|
|
14
|
+
export declare const NOTIFICATION_UNREAD_CAP = 99;
|
|
15
|
+
/** The bell's popover and the Home card show this many. */
|
|
16
|
+
export declare const NOTIFICATION_PREVIEW_ROWS = 5;
|
|
17
|
+
/** How often the bell asks for the unread count. */
|
|
18
|
+
export declare const NOTIFICATION_POLL_MS = 60000;
|
|
19
|
+
/** The most roles, and the most people, the audience search answers. */
|
|
20
|
+
export declare const NOTIFICATION_AUDIENCE_SEARCH_MAX = 20;
|
|
21
|
+
export declare const NOTIFICATION_RETENTION_DEFAULT_DAYS = 90;
|
|
22
|
+
export declare const NOTIFICATION_RETENTION_MIN_DAYS = 7;
|
|
23
|
+
export declare const NOTIFICATION_RETENTION_MAX_DAYS = 3650;
|
|
24
|
+
/** `kardalumUpdate` (S314n3, D4): a newer Kardalum is out. */
|
|
25
|
+
export declare const NOTIFICATION_KINDS: readonly ["message", "pluginUpdate", "kardalumUpdate"];
|
|
26
|
+
export declare const NotificationKindSchema: z.ZodEnum<{
|
|
27
|
+
message: "message";
|
|
28
|
+
pluginUpdate: "pluginUpdate";
|
|
29
|
+
kardalumUpdate: "kardalumUpdate";
|
|
30
|
+
}>;
|
|
31
|
+
export type NotificationKind = z.infer<typeof NotificationKindSchema>;
|
|
32
|
+
/** `system` is Kardalum itself; `plugin` (S314n3) a plugin that declared notifications. */
|
|
33
|
+
export declare const NOTIFICATION_SENDER_KINDS: readonly ["person", "key", "system", "plugin"];
|
|
34
|
+
export declare const NotificationSenderKindSchema: z.ZodEnum<{
|
|
35
|
+
key: "key";
|
|
36
|
+
system: "system";
|
|
37
|
+
plugin: "plugin";
|
|
38
|
+
person: "person";
|
|
39
|
+
}>;
|
|
40
|
+
export type NotificationSenderKind = z.infer<typeof NotificationSenderKindSchema>;
|
|
41
|
+
/** `all` is every copy not archived. */
|
|
42
|
+
export declare const NOTIFICATION_BOXES: readonly ["unread", "all", "archived"];
|
|
43
|
+
export declare const NotificationBoxSchema: z.ZodEnum<{
|
|
44
|
+
archived: "archived";
|
|
45
|
+
unread: "unread";
|
|
46
|
+
all: "all";
|
|
47
|
+
}>;
|
|
48
|
+
export type NotificationBox = z.infer<typeof NotificationBoxSchema>;
|
|
49
|
+
/** A linked page as the reader sees it now: `noAccess` names nothing. */
|
|
50
|
+
export declare const NOTIFICATION_PAGE_STATES: readonly ["draft", "published", "removed", "noAccess"];
|
|
51
|
+
export declare const NotificationPageStateSchema: z.ZodEnum<{
|
|
52
|
+
removed: "removed";
|
|
53
|
+
published: "published";
|
|
54
|
+
draft: "draft";
|
|
55
|
+
noAccess: "noAccess";
|
|
56
|
+
}>;
|
|
57
|
+
export type NotificationPageState = z.infer<typeof NotificationPageStateSchema>;
|
|
58
|
+
/** A system notice is written once per key, ever. */
|
|
59
|
+
export declare function pluginUpdateDedupeKey(pluginId: string, version: string): string;
|
|
60
|
+
/** S314n3 (D4): the Kardalum update notice is written once per version. */
|
|
61
|
+
export declare function kardalumUpdateDedupeKey(version: string): string;
|
|
62
|
+
export declare const NotificationLinkInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
63
|
+
kind: z.ZodLiteral<"none">;
|
|
64
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
65
|
+
kind: z.ZodLiteral<"page">;
|
|
66
|
+
nodeId: z.ZodString;
|
|
67
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
68
|
+
kind: z.ZodLiteral<"url">;
|
|
69
|
+
url: z.ZodURL;
|
|
70
|
+
}, z.core.$strict>], "kind">;
|
|
71
|
+
export type NotificationLinkInput = z.infer<typeof NotificationLinkInputSchema>;
|
|
72
|
+
export declare const NotificationTargetsSchema: z.ZodObject<{
|
|
73
|
+
roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
74
|
+
users: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
75
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
76
|
+
}, z.core.$strict>;
|
|
77
|
+
export type NotificationTargets = z.infer<typeof NotificationTargetsSchema>;
|
|
78
|
+
export type NotificationTargetsInput = z.input<typeof NotificationTargetsSchema>;
|
|
79
|
+
export declare const SendNotificationRequestSchema: z.ZodObject<{
|
|
80
|
+
to: z.ZodObject<{
|
|
81
|
+
roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
82
|
+
users: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
83
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
84
|
+
}, z.core.$strict>;
|
|
85
|
+
title: z.ZodString;
|
|
86
|
+
text: z.ZodDefault<z.ZodString>;
|
|
87
|
+
link: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
88
|
+
kind: z.ZodLiteral<"none">;
|
|
89
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
90
|
+
kind: z.ZodLiteral<"page">;
|
|
91
|
+
nodeId: z.ZodString;
|
|
92
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
93
|
+
kind: z.ZodLiteral<"url">;
|
|
94
|
+
url: z.ZodURL;
|
|
95
|
+
}, z.core.$strict>], "kind">>;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
export type SendNotificationRequest = z.infer<typeof SendNotificationRequestSchema>;
|
|
98
|
+
export type SendNotificationRequestInput = z.input<typeof SendNotificationRequestSchema>;
|
|
99
|
+
export declare const SendNotificationResponseSchema: z.ZodObject<{
|
|
100
|
+
id: z.ZodString;
|
|
101
|
+
recipients: z.ZodNumber;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
export type SendNotificationResponse = z.infer<typeof SendNotificationResponseSchema>;
|
|
104
|
+
export declare const NotificationReachRequestSchema: z.ZodObject<{
|
|
105
|
+
to: z.ZodObject<{
|
|
106
|
+
roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
107
|
+
users: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
108
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
109
|
+
}, z.core.$strict>;
|
|
110
|
+
}, z.core.$strict>;
|
|
111
|
+
export type NotificationReachRequest = z.infer<typeof NotificationReachRequestSchema>;
|
|
112
|
+
export declare const NotificationReachResponseSchema: z.ZodObject<{
|
|
113
|
+
count: z.ZodNumber;
|
|
114
|
+
overLimit: z.ZodBoolean;
|
|
115
|
+
includesYou: z.ZodBoolean;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
export type NotificationReachResponse = z.infer<typeof NotificationReachResponseSchema>;
|
|
118
|
+
export declare const NotificationAudienceQuerySchema: z.ZodObject<{
|
|
119
|
+
q: z.ZodOptional<z.ZodString>;
|
|
120
|
+
lang: z.ZodDefault<z.ZodEnum<{
|
|
121
|
+
en: "en";
|
|
122
|
+
de: "de";
|
|
123
|
+
}>>;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
export declare const NotificationAudienceResponseSchema: z.ZodObject<{
|
|
126
|
+
roles: z.ZodArray<z.ZodObject<{
|
|
127
|
+
id: z.ZodString;
|
|
128
|
+
label: z.ZodString;
|
|
129
|
+
}, z.core.$strip>>;
|
|
130
|
+
users: z.ZodArray<z.ZodObject<{
|
|
131
|
+
id: z.ZodString;
|
|
132
|
+
label: z.ZodString;
|
|
133
|
+
}, z.core.$strip>>;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
export type NotificationAudienceResponse = z.infer<typeof NotificationAudienceResponseSchema>;
|
|
136
|
+
/** The targets as they were named at send time, for "to Publishers". */
|
|
137
|
+
export declare const NotificationAudienceEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
138
|
+
kind: z.ZodLiteral<"role">;
|
|
139
|
+
id: z.ZodString;
|
|
140
|
+
label: z.ZodString;
|
|
141
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
142
|
+
kind: z.ZodLiteral<"user">;
|
|
143
|
+
id: z.ZodString;
|
|
144
|
+
name: z.ZodNullable<z.ZodString>;
|
|
145
|
+
role: z.ZodOptional<z.ZodObject<{
|
|
146
|
+
id: z.ZodString;
|
|
147
|
+
label: z.ZodString;
|
|
148
|
+
}, z.core.$strip>>;
|
|
149
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
150
|
+
kind: z.ZodLiteral<"action">;
|
|
151
|
+
action: z.ZodString;
|
|
152
|
+
label: z.ZodString;
|
|
153
|
+
}, z.core.$strip>], "kind">;
|
|
154
|
+
export type NotificationAudienceEntry = z.infer<typeof NotificationAudienceEntrySchema>;
|
|
155
|
+
export declare const NotificationAudienceSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
156
|
+
kind: z.ZodLiteral<"role">;
|
|
157
|
+
id: z.ZodString;
|
|
158
|
+
label: z.ZodString;
|
|
159
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
160
|
+
kind: z.ZodLiteral<"user">;
|
|
161
|
+
id: z.ZodString;
|
|
162
|
+
name: z.ZodNullable<z.ZodString>;
|
|
163
|
+
role: z.ZodOptional<z.ZodObject<{
|
|
164
|
+
id: z.ZodString;
|
|
165
|
+
label: z.ZodString;
|
|
166
|
+
}, z.core.$strip>>;
|
|
167
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
168
|
+
kind: z.ZodLiteral<"action">;
|
|
169
|
+
action: z.ZodString;
|
|
170
|
+
label: z.ZodString;
|
|
171
|
+
}, z.core.$strip>], "kind">>;
|
|
172
|
+
export declare const NotificationPageSummarySchema: z.ZodObject<{
|
|
173
|
+
state: z.ZodEnum<{
|
|
174
|
+
removed: "removed";
|
|
175
|
+
published: "published";
|
|
176
|
+
draft: "draft";
|
|
177
|
+
noAccess: "noAccess";
|
|
178
|
+
}>;
|
|
179
|
+
name: z.ZodNullable<z.ZodString>;
|
|
180
|
+
path: z.ZodNullable<z.ZodString>;
|
|
181
|
+
}, z.core.$strip>;
|
|
182
|
+
export type NotificationPageSummary = z.infer<typeof NotificationPageSummarySchema>;
|
|
183
|
+
export declare const NotificationLinkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
184
|
+
kind: z.ZodLiteral<"none">;
|
|
185
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
186
|
+
kind: z.ZodLiteral<"page">;
|
|
187
|
+
nodeId: z.ZodString;
|
|
188
|
+
page: z.ZodObject<{
|
|
189
|
+
state: z.ZodEnum<{
|
|
190
|
+
removed: "removed";
|
|
191
|
+
published: "published";
|
|
192
|
+
draft: "draft";
|
|
193
|
+
noAccess: "noAccess";
|
|
194
|
+
}>;
|
|
195
|
+
name: z.ZodNullable<z.ZodString>;
|
|
196
|
+
path: z.ZodNullable<z.ZodString>;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
199
|
+
kind: z.ZodLiteral<"url">;
|
|
200
|
+
url: z.ZodString;
|
|
201
|
+
}, z.core.$strip>], "kind">;
|
|
202
|
+
export type NotificationLink = z.infer<typeof NotificationLinkSchema>;
|
|
203
|
+
/** `name` is null for a person with no name (S314n3, 3e); the admin says "Unnamed person". */
|
|
204
|
+
export declare const NotificationSenderSchema: z.ZodObject<{
|
|
205
|
+
kind: z.ZodEnum<{
|
|
206
|
+
key: "key";
|
|
207
|
+
system: "system";
|
|
208
|
+
plugin: "plugin";
|
|
209
|
+
person: "person";
|
|
210
|
+
}>;
|
|
211
|
+
name: z.ZodNullable<z.ZodString>;
|
|
212
|
+
}, z.core.$strip>;
|
|
213
|
+
export type NotificationSender = z.infer<typeof NotificationSenderSchema>;
|
|
214
|
+
/** What a plugin update notice is about, so the admin can word it in the reader's language. */
|
|
215
|
+
export declare const NotificationPluginUpdateDataSchema: z.ZodObject<{
|
|
216
|
+
pluginId: z.ZodString;
|
|
217
|
+
pluginName: z.ZodString;
|
|
218
|
+
installedVersion: z.ZodString;
|
|
219
|
+
version: z.ZodString;
|
|
220
|
+
}, z.core.$strip>;
|
|
221
|
+
export type NotificationPluginUpdateData = z.infer<typeof NotificationPluginUpdateDataSchema>;
|
|
222
|
+
/** S314n3 (D4): what a Kardalum update notice is about. */
|
|
223
|
+
export declare const NotificationKardalumUpdateDataSchema: z.ZodObject<{
|
|
224
|
+
installedVersion: z.ZodString;
|
|
225
|
+
version: z.ZodString;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
export type NotificationKardalumUpdateData = z.infer<typeof NotificationKardalumUpdateDataSchema>;
|
|
228
|
+
/** The facts of a system notice, by its kind; null for a message. */
|
|
229
|
+
export declare const NotificationDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
230
|
+
pluginId: z.ZodString;
|
|
231
|
+
pluginName: z.ZodString;
|
|
232
|
+
installedVersion: z.ZodString;
|
|
233
|
+
version: z.ZodString;
|
|
234
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
235
|
+
installedVersion: z.ZodString;
|
|
236
|
+
version: z.ZodString;
|
|
237
|
+
}, z.core.$strip>]>;
|
|
238
|
+
export type NotificationData = z.infer<typeof NotificationDataSchema>;
|
|
239
|
+
/** One person's copy of a notification. */
|
|
240
|
+
export declare const NotificationItemSchema: z.ZodObject<{
|
|
241
|
+
id: z.ZodString;
|
|
242
|
+
kind: z.ZodEnum<{
|
|
243
|
+
message: "message";
|
|
244
|
+
pluginUpdate: "pluginUpdate";
|
|
245
|
+
kardalumUpdate: "kardalumUpdate";
|
|
246
|
+
}>;
|
|
247
|
+
title: z.ZodString;
|
|
248
|
+
text: z.ZodString;
|
|
249
|
+
link: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
250
|
+
kind: z.ZodLiteral<"none">;
|
|
251
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
252
|
+
kind: z.ZodLiteral<"page">;
|
|
253
|
+
nodeId: z.ZodString;
|
|
254
|
+
page: z.ZodObject<{
|
|
255
|
+
state: z.ZodEnum<{
|
|
256
|
+
removed: "removed";
|
|
257
|
+
published: "published";
|
|
258
|
+
draft: "draft";
|
|
259
|
+
noAccess: "noAccess";
|
|
260
|
+
}>;
|
|
261
|
+
name: z.ZodNullable<z.ZodString>;
|
|
262
|
+
path: z.ZodNullable<z.ZodString>;
|
|
263
|
+
}, z.core.$strip>;
|
|
264
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
265
|
+
kind: z.ZodLiteral<"url">;
|
|
266
|
+
url: z.ZodString;
|
|
267
|
+
}, z.core.$strip>], "kind">;
|
|
268
|
+
sender: z.ZodObject<{
|
|
269
|
+
kind: z.ZodEnum<{
|
|
270
|
+
key: "key";
|
|
271
|
+
system: "system";
|
|
272
|
+
plugin: "plugin";
|
|
273
|
+
person: "person";
|
|
274
|
+
}>;
|
|
275
|
+
name: z.ZodNullable<z.ZodString>;
|
|
276
|
+
}, z.core.$strip>;
|
|
277
|
+
audience: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
278
|
+
kind: z.ZodLiteral<"role">;
|
|
279
|
+
id: z.ZodString;
|
|
280
|
+
label: z.ZodString;
|
|
281
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
282
|
+
kind: z.ZodLiteral<"user">;
|
|
283
|
+
id: z.ZodString;
|
|
284
|
+
name: z.ZodNullable<z.ZodString>;
|
|
285
|
+
role: z.ZodOptional<z.ZodObject<{
|
|
286
|
+
id: z.ZodString;
|
|
287
|
+
label: z.ZodString;
|
|
288
|
+
}, z.core.$strip>>;
|
|
289
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
290
|
+
kind: z.ZodLiteral<"action">;
|
|
291
|
+
action: z.ZodString;
|
|
292
|
+
label: z.ZodString;
|
|
293
|
+
}, z.core.$strip>], "kind">>;
|
|
294
|
+
data: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
295
|
+
pluginId: z.ZodString;
|
|
296
|
+
pluginName: z.ZodString;
|
|
297
|
+
installedVersion: z.ZodString;
|
|
298
|
+
version: z.ZodString;
|
|
299
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
300
|
+
installedVersion: z.ZodString;
|
|
301
|
+
version: z.ZodString;
|
|
302
|
+
}, z.core.$strip>]>>;
|
|
303
|
+
createdAt: z.ZodString;
|
|
304
|
+
readAt: z.ZodNullable<z.ZodString>;
|
|
305
|
+
archivedAt: z.ZodNullable<z.ZodString>;
|
|
306
|
+
}, z.core.$strip>;
|
|
307
|
+
export type NotificationItem = z.infer<typeof NotificationItemSchema>;
|
|
308
|
+
export declare const NotificationInboxQuerySchema: z.ZodObject<{
|
|
309
|
+
box: z.ZodDefault<z.ZodEnum<{
|
|
310
|
+
archived: "archived";
|
|
311
|
+
unread: "unread";
|
|
312
|
+
all: "all";
|
|
313
|
+
}>>;
|
|
314
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
315
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
316
|
+
}, z.core.$strip>;
|
|
317
|
+
export declare const NotificationInboxPageSchema: z.ZodObject<{
|
|
318
|
+
items: z.ZodArray<z.ZodObject<{
|
|
319
|
+
id: z.ZodString;
|
|
320
|
+
kind: z.ZodEnum<{
|
|
321
|
+
message: "message";
|
|
322
|
+
pluginUpdate: "pluginUpdate";
|
|
323
|
+
kardalumUpdate: "kardalumUpdate";
|
|
324
|
+
}>;
|
|
325
|
+
title: z.ZodString;
|
|
326
|
+
text: z.ZodString;
|
|
327
|
+
link: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
328
|
+
kind: z.ZodLiteral<"none">;
|
|
329
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
330
|
+
kind: z.ZodLiteral<"page">;
|
|
331
|
+
nodeId: z.ZodString;
|
|
332
|
+
page: z.ZodObject<{
|
|
333
|
+
state: z.ZodEnum<{
|
|
334
|
+
removed: "removed";
|
|
335
|
+
published: "published";
|
|
336
|
+
draft: "draft";
|
|
337
|
+
noAccess: "noAccess";
|
|
338
|
+
}>;
|
|
339
|
+
name: z.ZodNullable<z.ZodString>;
|
|
340
|
+
path: z.ZodNullable<z.ZodString>;
|
|
341
|
+
}, z.core.$strip>;
|
|
342
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
343
|
+
kind: z.ZodLiteral<"url">;
|
|
344
|
+
url: z.ZodString;
|
|
345
|
+
}, z.core.$strip>], "kind">;
|
|
346
|
+
sender: z.ZodObject<{
|
|
347
|
+
kind: z.ZodEnum<{
|
|
348
|
+
key: "key";
|
|
349
|
+
system: "system";
|
|
350
|
+
plugin: "plugin";
|
|
351
|
+
person: "person";
|
|
352
|
+
}>;
|
|
353
|
+
name: z.ZodNullable<z.ZodString>;
|
|
354
|
+
}, z.core.$strip>;
|
|
355
|
+
audience: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
356
|
+
kind: z.ZodLiteral<"role">;
|
|
357
|
+
id: z.ZodString;
|
|
358
|
+
label: z.ZodString;
|
|
359
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
360
|
+
kind: z.ZodLiteral<"user">;
|
|
361
|
+
id: z.ZodString;
|
|
362
|
+
name: z.ZodNullable<z.ZodString>;
|
|
363
|
+
role: z.ZodOptional<z.ZodObject<{
|
|
364
|
+
id: z.ZodString;
|
|
365
|
+
label: z.ZodString;
|
|
366
|
+
}, z.core.$strip>>;
|
|
367
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
368
|
+
kind: z.ZodLiteral<"action">;
|
|
369
|
+
action: z.ZodString;
|
|
370
|
+
label: z.ZodString;
|
|
371
|
+
}, z.core.$strip>], "kind">>;
|
|
372
|
+
data: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
373
|
+
pluginId: z.ZodString;
|
|
374
|
+
pluginName: z.ZodString;
|
|
375
|
+
installedVersion: z.ZodString;
|
|
376
|
+
version: z.ZodString;
|
|
377
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
378
|
+
installedVersion: z.ZodString;
|
|
379
|
+
version: z.ZodString;
|
|
380
|
+
}, z.core.$strip>]>>;
|
|
381
|
+
createdAt: z.ZodString;
|
|
382
|
+
readAt: z.ZodNullable<z.ZodString>;
|
|
383
|
+
archivedAt: z.ZodNullable<z.ZodString>;
|
|
384
|
+
}, z.core.$strip>>;
|
|
385
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
386
|
+
retentionDays: z.ZodNumber;
|
|
387
|
+
}, z.core.$strip>;
|
|
388
|
+
export type NotificationInboxPage = z.infer<typeof NotificationInboxPageSchema>;
|
|
389
|
+
/** `{ count, more }`: exact up to 99; `more` when there are more than 99. */
|
|
390
|
+
export declare const NotificationUnreadCountSchema: z.ZodObject<{
|
|
391
|
+
count: z.ZodNumber;
|
|
392
|
+
more: z.ZodBoolean;
|
|
393
|
+
}, z.core.$strip>;
|
|
394
|
+
export declare const NotificationParamsSchema: z.ZodObject<{
|
|
395
|
+
id: z.ZodString;
|
|
396
|
+
}, z.core.$strip>;
|
|
397
|
+
export declare const NotificationStateSchema: z.ZodObject<{
|
|
398
|
+
id: z.ZodString;
|
|
399
|
+
readAt: z.ZodNullable<z.ZodString>;
|
|
400
|
+
archivedAt: z.ZodNullable<z.ZodString>;
|
|
401
|
+
}, z.core.$strip>;
|
|
402
|
+
export type NotificationState = z.infer<typeof NotificationStateSchema>;
|
|
403
|
+
export declare const NotificationReadAllResponseSchema: z.ZodObject<{
|
|
404
|
+
marked: z.ZodNumber;
|
|
405
|
+
}, z.core.$strip>;
|
|
406
|
+
export type NotificationReadAllResponse = z.infer<typeof NotificationReadAllResponseSchema>;
|
|
407
|
+
export declare const NotificationRetentionSchema: z.ZodObject<{
|
|
408
|
+
retentionDays: z.ZodNumber;
|
|
409
|
+
}, z.core.$strict>;
|
|
410
|
+
export type NotificationRetention = z.infer<typeof NotificationRetentionSchema>;
|