@kardalum/plugin-sdk 0.16.0 → 0.18.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 +105 -0
- package/README.md +4 -3
- package/dist/admin-section-registry.d.ts +14 -5
- package/dist/admin-section-registry.js +14 -4
- 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-settings-schemas.d.ts +2 -0
- package/dist/built-in-settings-schemas.js +27 -0
- package/dist/built-in-value-schemas.js +3 -0
- package/dist/built-ins.js +10 -1
- package/dist/capabilities.js +5 -3
- package/dist/datatype-validation.js +18 -4
- package/dist/datatypes-entry.d.ts +1 -0
- package/dist/datatypes-entry.js +1 -0
- 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/host-entry.d.ts +1 -1
- package/dist/host-entry.js +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.js +13 -18
- package/dist/license-verdict-keys.d.ts +4 -3
- package/dist/license-verdict-keys.js +4 -7
- package/dist/manifest-entry.d.ts +6 -2
- package/dist/manifest-entry.js +5 -1
- package/dist/manifest-schema.d.ts +56 -63
- package/dist/manifest-schema.js +103 -249
- package/dist/manifest.d.ts +61 -73
- package/dist/manifest.js +13 -36
- package/dist/media/media-picker.js +32 -32
- package/dist/notify.d.ts +17 -0
- package/dist/notify.js +17 -0
- package/dist/plugin-screen-context.d.ts +11 -1
- package/dist/richtext/block-panel.js +19 -20
- package/dist/richtext/extensions.js +10 -1
- package/dist/richtext/insert-menu.js +1 -1
- package/dist/richtext/kardalum-block.js +17 -17
- package/dist/richtext/style-listbox.js +4 -4
- package/dist/richtext-html-entry.d.ts +35 -0
- package/dist/richtext-html-entry.js +73 -0
- package/dist/structured-storage-types.d.ts +11 -0
- package/dist/tailwind.js +10 -3
- package/dist/tokens/tailwind-theme.css +176 -0
- package/dist/tokens/tokens.css +2 -0
- package/dist/tokens/tokens.json +4 -2
- package/dist/type-equality.d.ts +2 -0
- package/dist/type-equality.js +1 -0
- 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/html-code-editor.js +0 -1
- package/dist/views/html-view.js +1 -1
- package/dist/views/image-view.js +1 -1
- package/dist/views/rich-text-view.js +30 -30
- package/node_modules/@kardalum/api-schemas/README.md +1 -1
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +43 -10
- 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 +23 -1
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +60 -18
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +204 -0
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +134 -0
- 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 +12 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +22 -6
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +2 -1
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +52 -10
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +33 -14
- 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 +25 -5
- 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 +3 -0
- 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.js +42 -2
- 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 +73 -31
- package/node_modules/@kardalum/api-schemas/dist/index.js +47 -17
- package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.js +8 -0
- package/node_modules/@kardalum/api-schemas/dist/issue-list.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/issue-list.js +6 -0
- 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/marketplace-listing-api.schema.d.ts +216 -63
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +117 -5
- 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 +6 -0
- 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/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-actions.schema.d.ts +6 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +8 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +8 -18
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +3 -19
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -15
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +17 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +18 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +97 -85
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +35 -68
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +60 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +116 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +9 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +22 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +240 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +164 -32
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +4 -3
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +14 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +37 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.d.ts +64 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.js +134 -0
- 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.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +83 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +152 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.js +15 -0
- 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 +35 -23
- 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/role.schema.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +11 -2
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +21 -3
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +126 -0
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +70 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +6 -6
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +58 -25
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +194 -48
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +18 -6
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/strict-url.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/strict-url.js +31 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +115 -1
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +65 -10
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +37 -2
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +34 -8
- package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.js +29 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +16 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +8 -0
- 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 +32 -0
- package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/package.json +2 -2
- package/node_modules/@kardalum/design-tokens/README.md +1 -1
- 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 +2 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +2 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +4 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +4 -2
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -0
- package/node_modules/@kardalum/design-tokens/package.json +6 -3
- package/node_modules/@kardalum/plugin-package/README.md +5 -2
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +6 -21
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +13 -8
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +4 -4
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +59 -16
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +4 -0
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +25 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +25 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +203 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +73 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +8 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +77 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.js +2052 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icons.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +51 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +8 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +7 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +119 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +14 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +21 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +148 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.js +76 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.d.ts +22 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +137 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +90 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/support.d.ts +24 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/support.js +55 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +7 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +215 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +53 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.js +1 -0
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +3 -2
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +4 -2
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +92 -3
- package/node_modules/@kardalum/plugin-package/dist/extract.js +251 -41
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +13 -4
- package/node_modules/@kardalum/plugin-package/dist/index.js +10 -3
- 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/manifest-entry.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/manifest-entry.js +20 -0
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +1 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +21 -3
- package/node_modules/@kardalum/plugin-package/dist/sample-content.js +37 -9
- package/node_modules/@kardalum/plugin-package/dist/shipped-files.d.ts +39 -0
- package/node_modules/@kardalum/plugin-package/dist/shipped-files.js +133 -0
- package/node_modules/@kardalum/plugin-package/dist/shipped-locales.d.ts +7 -0
- package/node_modules/@kardalum/plugin-package/dist/shipped-locales.js +27 -0
- 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/plugin-package/package.json +4 -2
- package/node_modules/@kardalum/ui/README.md +1 -1
- package/node_modules/@kardalum/ui/dist/components/button.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/checkbox.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.js +5 -2
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +3 -3
- package/node_modules/@kardalum/ui/dist/components/input.js +1 -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/sheet.js +5 -4
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/tab-strip.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/toast.js +1 -1
- package/node_modules/@kardalum/ui/dist/index.d.ts +1 -0
- package/node_modules/@kardalum/ui/dist/index.js +1 -0
- package/node_modules/@kardalum/ui/package.json +1 -1
- package/package.json +19 -6
|
@@ -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>;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ActionStringSchema } from "./action.schema.js";
|
|
3
|
+
import { HomeCountSchema } from "./home.schema.js";
|
|
4
|
+
import { RoleIdSchema } from "./role.schema.js";
|
|
5
|
+
import { ADMIN_LOCALES } from "./user-api.schema.js";
|
|
6
|
+
// S314n2 (2026-10-28-s314n2-user-notifications-design.md): the inbox every signed-in
|
|
7
|
+
// person has. A notification is sent once to roles, people or both; each person it
|
|
8
|
+
// reaches holds a copy of their own, read and archived alone, and every copy goes when
|
|
9
|
+
// the notification is older than the retention period.
|
|
10
|
+
export const NOTIFICATION_TITLE_MAX = 120;
|
|
11
|
+
export const NOTIFICATION_TEXT_MAX = 1000;
|
|
12
|
+
export const NOTIFICATION_URL_MAX = 500;
|
|
13
|
+
export const NOTIFICATION_ROLES_MAX = 20;
|
|
14
|
+
export const NOTIFICATION_USERS_MAX = 50;
|
|
15
|
+
/** S314n3 (D2): the most actions ("everyone who may publish") one send names. */
|
|
16
|
+
export const NOTIFICATION_ACTIONS_MAX = 10;
|
|
17
|
+
/** More people than this in one send is refused. */
|
|
18
|
+
export const NOTIFICATION_RECIPIENTS_MAX = 5000;
|
|
19
|
+
/** One page of an inbox list, newest first. */
|
|
20
|
+
export const NOTIFICATION_PAGE_SIZE = 20;
|
|
21
|
+
/** The unread count is exact up to this, and "99+" beyond it. */
|
|
22
|
+
export const NOTIFICATION_UNREAD_CAP = 99;
|
|
23
|
+
/** The bell's popover and the Home card show this many. */
|
|
24
|
+
export const NOTIFICATION_PREVIEW_ROWS = 5;
|
|
25
|
+
/** How often the bell asks for the unread count. */
|
|
26
|
+
export const NOTIFICATION_POLL_MS = 60_000;
|
|
27
|
+
/** The most roles, and the most people, the audience search answers. */
|
|
28
|
+
export const NOTIFICATION_AUDIENCE_SEARCH_MAX = 20;
|
|
29
|
+
export const NOTIFICATION_RETENTION_DEFAULT_DAYS = 90;
|
|
30
|
+
export const NOTIFICATION_RETENTION_MIN_DAYS = 7;
|
|
31
|
+
export const NOTIFICATION_RETENTION_MAX_DAYS = 3650;
|
|
32
|
+
/** `kardalumUpdate` (S314n3, D4): a newer Kardalum is out. */
|
|
33
|
+
export const NOTIFICATION_KINDS = ["message", "pluginUpdate", "kardalumUpdate"];
|
|
34
|
+
export const NotificationKindSchema = z.enum(NOTIFICATION_KINDS);
|
|
35
|
+
/** `system` is Kardalum itself; `plugin` (S314n3) a plugin that declared notifications. */
|
|
36
|
+
export const NOTIFICATION_SENDER_KINDS = ["person", "key", "system", "plugin"];
|
|
37
|
+
export const NotificationSenderKindSchema = z.enum(NOTIFICATION_SENDER_KINDS);
|
|
38
|
+
/** `all` is every copy not archived. */
|
|
39
|
+
export const NOTIFICATION_BOXES = ["unread", "all", "archived"];
|
|
40
|
+
export const NotificationBoxSchema = z.enum(NOTIFICATION_BOXES);
|
|
41
|
+
/** A linked page as the reader sees it now: `noAccess` names nothing. */
|
|
42
|
+
export const NOTIFICATION_PAGE_STATES = ["draft", "published", "removed", "noAccess"];
|
|
43
|
+
export const NotificationPageStateSchema = z.enum(NOTIFICATION_PAGE_STATES);
|
|
44
|
+
/** A system notice is written once per key, ever. */
|
|
45
|
+
export function pluginUpdateDedupeKey(pluginId, version) {
|
|
46
|
+
return `pluginUpdate:${pluginId}:${version}`;
|
|
47
|
+
}
|
|
48
|
+
/** S314n3 (D4): the Kardalum update notice is written once per version. */
|
|
49
|
+
export function kardalumUpdateDedupeKey(version) {
|
|
50
|
+
return `kardalumUpdate:${version}`;
|
|
51
|
+
}
|
|
52
|
+
/** https only, so a notification cannot carry a script or data link into every inbox. */
|
|
53
|
+
const httpsUrl = () => z
|
|
54
|
+
.url({ protocol: /^https$/, error: "A web address starts with https://." })
|
|
55
|
+
.max(NOTIFICATION_URL_MAX, `A web address has at most ${NOTIFICATION_URL_MAX} characters.`);
|
|
56
|
+
export const NotificationLinkInputSchema = z.discriminatedUnion("kind", [
|
|
57
|
+
z.object({ kind: z.literal("none") }).strict(),
|
|
58
|
+
z.object({ kind: z.literal("page"), nodeId: z.string().uuid() }).strict(),
|
|
59
|
+
z.object({ kind: z.literal("url"), url: httpsUrl() }).strict(),
|
|
60
|
+
]);
|
|
61
|
+
export const NotificationTargetsSchema = z
|
|
62
|
+
.object({
|
|
63
|
+
roles: z.array(RoleIdSchema).max(NOTIFICATION_ROLES_MAX, `A notification names at most ${NOTIFICATION_ROLES_MAX} roles.`).default([]),
|
|
64
|
+
users: z.array(z.string().uuid()).max(NOTIFICATION_USERS_MAX, `A notification names at most ${NOTIFICATION_USERS_MAX} people.`).default([]),
|
|
65
|
+
/** S314n3 (D2): every person whose role holds the action when it is sent, administrators always among them. */
|
|
66
|
+
actions: z.array(ActionStringSchema).max(NOTIFICATION_ACTIONS_MAX, `A notification names at most ${NOTIFICATION_ACTIONS_MAX} actions.`).default([]),
|
|
67
|
+
})
|
|
68
|
+
.strict()
|
|
69
|
+
.refine((to) => to.roles.length + to.users.length + to.actions.length > 0, { message: "Name at least one role, person or action." })
|
|
70
|
+
// S314c6 (D6): the reference generator takes an example before a default, and the defaults
|
|
71
|
+
// (three empty lists) are exactly what the refinement refuses.
|
|
72
|
+
.meta({ example: { roles: ["editor"], users: [], actions: [] } });
|
|
73
|
+
export const SendNotificationRequestSchema = z
|
|
74
|
+
.object({
|
|
75
|
+
to: NotificationTargetsSchema,
|
|
76
|
+
title: z
|
|
77
|
+
.string()
|
|
78
|
+
.trim()
|
|
79
|
+
.min(1, "A notification needs a title.")
|
|
80
|
+
.max(NOTIFICATION_TITLE_MAX, `A title has at most ${NOTIFICATION_TITLE_MAX} characters.`),
|
|
81
|
+
text: z.string().max(NOTIFICATION_TEXT_MAX, `A text has at most ${NOTIFICATION_TEXT_MAX} characters.`).default(""),
|
|
82
|
+
link: NotificationLinkInputSchema.default({ kind: "none" }),
|
|
83
|
+
})
|
|
84
|
+
.strict();
|
|
85
|
+
export const SendNotificationResponseSchema = z.object({
|
|
86
|
+
id: z.string().uuid(),
|
|
87
|
+
/** How many people it reached. */
|
|
88
|
+
recipients: z.number().int().min(1).max(NOTIFICATION_RECIPIENTS_MAX),
|
|
89
|
+
});
|
|
90
|
+
export const NotificationReachRequestSchema = z.object({ to: NotificationTargetsSchema }).strict();
|
|
91
|
+
export const NotificationReachResponseSchema = z.object({
|
|
92
|
+
/** Distinct people, at most NOTIFICATION_RECIPIENTS_MAX. */
|
|
93
|
+
count: z.number().int().min(0).max(NOTIFICATION_RECIPIENTS_MAX),
|
|
94
|
+
/** More people than a send may reach: the send would be refused. */
|
|
95
|
+
overLimit: z.boolean(),
|
|
96
|
+
/** The signed-in sender is among them; always false for an API key. */
|
|
97
|
+
includesYou: z.boolean(),
|
|
98
|
+
});
|
|
99
|
+
export const NotificationAudienceQuerySchema = z.object({
|
|
100
|
+
q: z.string().trim().max(100).optional(),
|
|
101
|
+
/** S314n3 (3e): the caller's admin language, in which a nameless person's label is worded. */
|
|
102
|
+
lang: z.enum(ADMIN_LOCALES).default("en"),
|
|
103
|
+
});
|
|
104
|
+
const AudienceOptionSchema = z.object({ id: z.string(), label: z.string() });
|
|
105
|
+
export const NotificationAudienceResponseSchema = z.object({
|
|
106
|
+
roles: z.array(AudienceOptionSchema).max(NOTIFICATION_AUDIENCE_SEARCH_MAX),
|
|
107
|
+
/** A person's label is their name, or "Unnamed person (role)" when they have none; never their email. */
|
|
108
|
+
users: z.array(AudienceOptionSchema).max(NOTIFICATION_AUDIENCE_SEARCH_MAX),
|
|
109
|
+
});
|
|
110
|
+
/** The targets as they were named at send time, for "to Publishers". */
|
|
111
|
+
export const NotificationAudienceEntrySchema = z.discriminatedUnion("kind", [
|
|
112
|
+
z.object({ kind: z.literal("role"), id: z.string(), label: z.string() }),
|
|
113
|
+
/** S314n3 (3e): `name` is null for a person with no name, who is shown by their role, worded by the reader's admin. */
|
|
114
|
+
z.object({
|
|
115
|
+
kind: z.literal("user"),
|
|
116
|
+
id: z.string(),
|
|
117
|
+
name: z.string().nullable(),
|
|
118
|
+
role: z.object({ id: z.string(), label: z.string() }).optional(),
|
|
119
|
+
}),
|
|
120
|
+
/** S314n3 (D2): "people who may <label>"; the label as the action had it when sent. */
|
|
121
|
+
z.object({ kind: z.literal("action"), action: z.string(), label: z.string() }),
|
|
122
|
+
]);
|
|
123
|
+
export const NotificationAudienceSchema = z
|
|
124
|
+
.array(NotificationAudienceEntrySchema)
|
|
125
|
+
.max(NOTIFICATION_ROLES_MAX + NOTIFICATION_USERS_MAX + NOTIFICATION_ACTIONS_MAX);
|
|
126
|
+
export const NotificationPageSummarySchema = z.object({
|
|
127
|
+
state: NotificationPageStateSchema,
|
|
128
|
+
/** Null for `noAccess`, and for a page whose row is gone. */
|
|
129
|
+
name: z.string().nullable(),
|
|
130
|
+
path: z.string().nullable(),
|
|
131
|
+
});
|
|
132
|
+
export const NotificationLinkSchema = z.discriminatedUnion("kind", [
|
|
133
|
+
z.object({ kind: z.literal("none") }),
|
|
134
|
+
z.object({ kind: z.literal("page"), nodeId: z.string().uuid(), page: NotificationPageSummarySchema }),
|
|
135
|
+
z.object({ kind: z.literal("url"), url: z.string() }),
|
|
136
|
+
]);
|
|
137
|
+
/** `name` is null for a person with no name (S314n3, 3e); the admin says "Unnamed person". */
|
|
138
|
+
export const NotificationSenderSchema = z.object({ kind: NotificationSenderKindSchema, name: z.string().nullable() });
|
|
139
|
+
/** What a plugin update notice is about, so the admin can word it in the reader's language. */
|
|
140
|
+
export const NotificationPluginUpdateDataSchema = z.object({
|
|
141
|
+
pluginId: z.string(),
|
|
142
|
+
pluginName: z.string(),
|
|
143
|
+
installedVersion: z.string(),
|
|
144
|
+
version: z.string(),
|
|
145
|
+
});
|
|
146
|
+
/** S314n3 (D4): what a Kardalum update notice is about. */
|
|
147
|
+
export const NotificationKardalumUpdateDataSchema = z.object({
|
|
148
|
+
installedVersion: z.string(),
|
|
149
|
+
version: z.string(),
|
|
150
|
+
});
|
|
151
|
+
/** The facts of a system notice, by its kind; null for a message. */
|
|
152
|
+
export const NotificationDataSchema = z.union([NotificationPluginUpdateDataSchema, NotificationKardalumUpdateDataSchema]);
|
|
153
|
+
/** One person's copy of a notification. */
|
|
154
|
+
export const NotificationItemSchema = z.object({
|
|
155
|
+
id: z.string().uuid(),
|
|
156
|
+
kind: NotificationKindSchema,
|
|
157
|
+
title: z.string(),
|
|
158
|
+
text: z.string(),
|
|
159
|
+
link: NotificationLinkSchema,
|
|
160
|
+
sender: NotificationSenderSchema,
|
|
161
|
+
audience: NotificationAudienceSchema,
|
|
162
|
+
/** A system notice's facts (a plugin update's or a Kardalum update's); null for a message. `title` and `text` are its English form, for API readers. */
|
|
163
|
+
data: NotificationDataSchema.nullable(),
|
|
164
|
+
createdAt: z.string().datetime(),
|
|
165
|
+
readAt: z.string().datetime().nullable(),
|
|
166
|
+
archivedAt: z.string().datetime().nullable(),
|
|
167
|
+
});
|
|
168
|
+
export const NotificationInboxQuerySchema = z.object({
|
|
169
|
+
box: NotificationBoxSchema.default("all"),
|
|
170
|
+
/** The previous page's nextCursor, passed back as it came. */
|
|
171
|
+
cursor: z.string().max(200).optional(),
|
|
172
|
+
limit: z.coerce.number().int().min(1).max(NOTIFICATION_PAGE_SIZE).default(NOTIFICATION_PAGE_SIZE),
|
|
173
|
+
});
|
|
174
|
+
export const NotificationInboxPageSchema = z.object({
|
|
175
|
+
items: z.array(NotificationItemSchema).max(NOTIFICATION_PAGE_SIZE),
|
|
176
|
+
nextCursor: z.string().nullable(),
|
|
177
|
+
/** How many days a notification is kept, so every person can be told. */
|
|
178
|
+
retentionDays: z.number().int(),
|
|
179
|
+
});
|
|
180
|
+
/** `{ count, more }`: exact up to 99; `more` when there are more than 99. */
|
|
181
|
+
export const NotificationUnreadCountSchema = HomeCountSchema;
|
|
182
|
+
export const NotificationParamsSchema = z.object({ id: z.string().uuid() });
|
|
183
|
+
export const NotificationStateSchema = z.object({
|
|
184
|
+
id: z.string().uuid(),
|
|
185
|
+
readAt: z.string().datetime().nullable(),
|
|
186
|
+
archivedAt: z.string().datetime().nullable(),
|
|
187
|
+
});
|
|
188
|
+
export const NotificationReadAllResponseSchema = z.object({ marked: z.number().int().min(0) });
|
|
189
|
+
export const NotificationRetentionSchema = z
|
|
190
|
+
.object({
|
|
191
|
+
retentionDays: z.number().int().min(NOTIFICATION_RETENTION_MIN_DAYS).max(NOTIFICATION_RETENTION_MAX_DAYS),
|
|
192
|
+
})
|
|
193
|
+
.strict();
|