@plitzi/sdk-authoring 0.38.19 → 0.38.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -776,6 +776,11 @@ export declare const AUTHORING_CODES: {
776
776
  readonly means: "an `accessLevel` that is not one the router reads";
777
777
  readonly fix: "one of the values the message lists";
778
778
  };
779
+ readonly 'page-access': {
780
+ readonly kind: "refused";
781
+ readonly means: "a page `access` the server cannot keep: no permissions, or one that is not a name";
782
+ readonly fix: "`access: { permissions: ['…'] }` with at least one permission name, or no `access` for a page anybody may see";
783
+ };
779
784
  readonly 'page-target-unknown': {
780
785
  readonly kind: "refused";
781
786
  readonly means: "a link or `navigate` to a page id that does not exist";
@@ -3065,7 +3070,7 @@ export declare const elementAttributeNames: {
3065
3070
  readonly modalContainer: readonly ["autoHideAfterClick", "title"];
3066
3071
  readonly nodeHtml: readonly ["about", "accessKey", "aria-activedescendant", "aria-atomic", "aria-autocomplete", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-checked", "aria-colcount", "aria-colindex", "aria-colindextext", "aria-colspan", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-level", "aria-live", "aria-modal", "aria-multiline", "aria-multiselectable", "aria-orientation", "aria-owns", "aria-placeholder", "aria-posinset", "aria-pressed", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription", "aria-rowcount", "aria-rowindex", "aria-rowindextext", "aria-rowspan", "aria-selected", "aria-setsize", "aria-sort", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext", "autoCapitalize", "autoCorrect", "autoFocus", "autoSave", "color", "content", "contentEditable", "contextMenu", "dangerouslySetInnerHTML", "datatype", "defaultChecked", "defaultValue", "dir", "draggable", "enterKeyHint", "exportparts", "hidden", "inert", "inlist", "inputMode", "is", "itemID", "itemProp", "itemRef", "itemScope", "itemType", "lang", "nonce", "onAbort", "onAbortCapture", "onAnimationEnd", "onAnimationEndCapture", "onAnimationIteration", "onAnimationIterationCapture", "onAnimationStart", "onAnimationStartCapture", "onAuxClick", "onAuxClickCapture", "onBeforeInput", "onBeforeInputCapture", "onBeforeToggle", "onBlur", "onBlurCapture", "onCanPlay", "onCanPlayCapture", "onCanPlayThrough", "onCanPlayThroughCapture", "onChange", "onChangeCapture", "onClick", "onClickCapture", "onCompositionEnd", "onCompositionEndCapture", "onCompositionStart", "onCompositionStartCapture", "onCompositionUpdate", "onCompositionUpdateCapture", "onContextMenu", "onContextMenuCapture", "onCopy", "onCopyCapture", "onCut", "onCutCapture", "onDoubleClick", "onDoubleClickCapture", "onDrag", "onDragCapture", "onDragEnd", "onDragEndCapture", "onDragEnter", "onDragEnterCapture", "onDragExit", "onDragExitCapture", "onDragLeave", "onDragLeaveCapture", "onDragOver", "onDragOverCapture", "onDragStart", "onDragStartCapture", "onDrop", "onDropCapture", "onDurationChange", "onDurationChangeCapture", "onEmptied", "onEmptiedCapture", "onEncrypted", "onEncryptedCapture", "onEnded", "onEndedCapture", "onError", "onErrorCapture", "onFocus", "onFocusCapture", "onGotPointerCapture", "onGotPointerCaptureCapture", "onInput", "onInputCapture", "onInvalid", "onInvalidCapture", "onKeyDown", "onKeyDownCapture", "onKeyPress", "onKeyPressCapture", "onKeyUp", "onKeyUpCapture", "onLoad", "onLoadCapture", "onLoadedData", "onLoadedDataCapture", "onLoadedMetadata", "onLoadedMetadataCapture", "onLoadStart", "onLoadStartCapture", "onLostPointerCapture", "onLostPointerCaptureCapture", "onMouseDown", "onMouseDownCapture", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseMoveCapture", "onMouseOut", "onMouseOutCapture", "onMouseOver", "onMouseOverCapture", "onMouseUp", "onMouseUpCapture", "onPaste", "onPasteCapture", "onPause", "onPauseCapture", "onPlay", "onPlayCapture", "onPlaying", "onPlayingCapture", "onPointerCancel", "onPointerCancelCapture", "onPointerDown", "onPointerDownCapture", "onPointerEnter", "onPointerLeave", "onPointerMove", "onPointerMoveCapture", "onPointerOut", "onPointerOutCapture", "onPointerOver", "onPointerOverCapture", "onPointerUp", "onPointerUpCapture", "onProgress", "onProgressCapture", "onRateChange", "onRateChangeCapture", "onReset", "onResetCapture", "onScroll", "onScrollCapture", "onScrollEnd", "onScrollEndCapture", "onSeeked", "onSeekedCapture", "onSeeking", "onSeekingCapture", "onSelect", "onSelectCapture", "onStalled", "onStalledCapture", "onSubmit", "onSubmitCapture", "onSuspend", "onSuspendCapture", "onTimeUpdate", "onTimeUpdateCapture", "onToggle", "onTouchCancel", "onTouchCancelCapture", "onTouchEnd", "onTouchEndCapture", "onTouchMove", "onTouchMoveCapture", "onTouchStart", "onTouchStartCapture", "onTransitionCancel", "onTransitionCancelCapture", "onTransitionEnd", "onTransitionEndCapture", "onTransitionRun", "onTransitionRunCapture", "onTransitionStart", "onTransitionStartCapture", "onVolumeChange", "onVolumeChangeCapture", "onWaiting", "onWaitingCapture", "onWheel", "onWheelCapture", "part", "popover", "popoverTarget", "popoverTargetAction", "prefix", "property", "radioGroup", "rel", "resource", "results", "rev", "role", "security", "slot", "spellCheck", "style", "subType", "suppressContentEditableWarning", "suppressHydrationWarning", "tabIndex", "title", "translate", "typeof", "unselectable", "vocab"];
3067
3072
  readonly notFound: readonly [];
3068
- readonly page: readonly ["documentScroll", "layout", "layoutContainer", "notFound", "seoEnabled", "seoPageDescription", "seoPageTitle"];
3073
+ readonly page: readonly ["access", "documentScroll", "layout", "layoutContainer", "notFound", "seoEnabled", "seoPageDescription", "seoPageTitle", "withheld"];
3069
3074
  readonly pagination: readonly ["label", "loadMoreLabel", "mode", "nextLabel", "pageInfo", "pageParam", "previousLabel", "target", "windowSize"];
3070
3075
  readonly paragraph: readonly ["content"];
3071
3076
  readonly plitziSdk: readonly ["environment", "offlineData", "spaceKey"];
@@ -6259,6 +6264,8 @@ declare const elementDeclarations: {
6259
6264
  seoPageTitle?: string | undefined;
6260
6265
  seoPageDescription?: string | undefined;
6261
6266
  documentScroll?: (DocumentScroll | "") | undefined;
6267
+ withheld?: PageWithheld | undefined;
6268
+ access?: PageAccess | undefined;
6262
6269
  }>>;
6263
6270
  readonly Pagination: DeclaredElement< {
6264
6271
  readonly type: "pagination";
@@ -8899,6 +8906,20 @@ export declare const PAGE_SPEC_FIELDS: Readonly<Record<string, keyof PageSpec>>;
8899
8906
  /** How many texts a page is read for: enough for a long page, few enough to stay quick. */
8900
8907
  export declare const PAGE_TEXT_LIMIT = 2000;
8901
8908
 
8909
+ /**
8910
+ * Who may see a page, as the page declares it: the permissions a visitor must hold, all of them. A page that says none
8911
+ * is anybody's — `accessLevel` still decides signed in or out — and one that says some is for a signed-in visitor who
8912
+ * holds every one: for a platform space, the account's permissions; for any other, those of the visitor roles the space
8913
+ * declares and gives them.
8914
+ *
8915
+ * It is the server that keeps a page to the people it is for. A page a visitor may not see is answered with its refusal
8916
+ * and never its content: the content is taken out of the space the browser is sent (`withholdPages`), because a page
8917
+ * merely hidden in the browser was still sent to it.
8918
+ */
8919
+ declare type PageAccess = {
8920
+ permissions: string[];
8921
+ };
8922
+
8902
8923
  /**
8903
8924
  * A page a function can be evaluated in — Playwright's `Page`, Puppeteer's, or anything with the same method.
8904
8925
  *
@@ -8980,6 +9001,13 @@ export declare interface PageHandle extends ElementHandle {
8980
9001
  path: string;
8981
9002
  /** Who the page is for, as declared. An `authenticated` page answers a visitor with no session with a 403 or a redirect. */
8982
9003
  accessLevel?: 'public' | 'authenticated';
9004
+ /**
9005
+ * The permissions a visitor must hold to see it, as declared: the server withholds it from anybody else — a visit with
9006
+ * no session included — so a test that opens it signs in as somebody who holds them.
9007
+ */
9008
+ access?: {
9009
+ permissions: string[];
9010
+ };
8983
9011
  /** The route params its slug declares (`post/{{slug}}` → `['slug']`). A path with any is not a URL until they are filled. */
8984
9012
  params: string[];
8985
9013
  /** The layout this page renders inside, by id — whose elements are on screen here too. */
@@ -9068,6 +9096,15 @@ export declare interface PageSpec {
9068
9096
  * space answers 403 to its own owner. Left undefined unless the author means it.
9069
9097
  */
9070
9098
  accessLevel?: 'public' | 'authenticated';
9099
+ /**
9100
+ * The permissions a visitor must hold, all of them, to see this page — for a platform space the account's, for any
9101
+ * other the visitor roles the space declares and gives them. Kept by the server: a visitor without them is answered
9102
+ * 401 or 403 and the page's refusal, and its content is never sent to them. Signed out, they are sent to
9103
+ * `unauthorizedRedirect` when the page names one (a sign-in).
9104
+ */
9105
+ access?: {
9106
+ permissions: string[];
9107
+ };
9071
9108
  /**
9072
9109
  * Where a visitor this page is not for is sent — a page's id or slug (`login`; `''` is the home page), its path, or a
9073
9110
  * full URL for somewhere off this space. Resolved to the page's id, and refused when it names no page.
@@ -9130,6 +9167,8 @@ export declare interface PageText {
9130
9167
  */
9131
9168
  export declare const pageTexts: (limit: number) => PageText[];
9132
9169
 
9170
+ declare type PageWithheld = 'unauthenticated' | 'forbidden';
9171
+
9133
9172
  export declare const pagination: {
9134
9173
  (children: ElementSpec[], props?: ElementProps<Partial<{
9135
9174
  mode?: "pages" | "loadMore" | undefined;
@@ -11364,7 +11403,7 @@ export declare const taskAction: <Task extends ActionTask>(task: Task, { trigger
11364
11403
 
11365
11404
  export declare interface TaskActionOptions {
11366
11405
  trigger: TaskActionTrigger | TaskActionTrigger[];
11367
- /** Left out, `<namespace>-<action>` with the action in kebab case: `inkwell.saveDraft` is `inkwell-save-draft`. */
11406
+ /** Left out, `<namespace>-<action>` with the action in kebab case: `orders.saveDraft` is `orders-save-draft`. */
11368
11407
  id?: string;
11369
11408
  /** Left out, the task's `title`. */
11370
11409
  name?: string;
package/dist/node.d.ts CHANGED
@@ -125,6 +125,11 @@ declare const AUTHORING_CODES: {
125
125
  readonly means: "an `accessLevel` that is not one the router reads";
126
126
  readonly fix: "one of the values the message lists";
127
127
  };
128
+ readonly 'page-access': {
129
+ readonly kind: "refused";
130
+ readonly means: "a page `access` the server cannot keep: no permissions, or one that is not a name";
131
+ readonly fix: "`access: { permissions: ['…'] }` with at least one permission name, or no `access` for a page anybody may see";
132
+ };
128
133
  readonly 'page-target-unknown': {
129
134
  readonly kind: "refused";
130
135
  readonly means: "a link or `navigate` to a page id that does not exist";
@@ -1953,6 +1958,13 @@ declare interface PageHandle extends ElementHandle {
1953
1958
  path: string;
1954
1959
  /** Who the page is for, as declared. An `authenticated` page answers a visitor with no session with a 403 or a redirect. */
1955
1960
  accessLevel?: 'public' | 'authenticated';
1961
+ /**
1962
+ * The permissions a visitor must hold to see it, as declared: the server withholds it from anybody else — a visit with
1963
+ * no session included — so a test that opens it signs in as somebody who holds them.
1964
+ */
1965
+ access?: {
1966
+ permissions: string[];
1967
+ };
1956
1968
  /** The route params its slug declares (`post/{{slug}}` → `['slug']`). A path with any is not a URL until they are filled. */
1957
1969
  params: string[];
1958
1970
  /** The layout this page renders inside, by id — whose elements are on screen here too. */
@@ -1999,6 +2011,15 @@ declare interface PageSpec {
1999
2011
  * space answers 403 to its own owner. Left undefined unless the author means it.
2000
2012
  */
2001
2013
  accessLevel?: 'public' | 'authenticated';
2014
+ /**
2015
+ * The permissions a visitor must hold, all of them, to see this page — for a platform space the account's, for any
2016
+ * other the visitor roles the space declares and gives them. Kept by the server: a visitor without them is answered
2017
+ * 401 or 403 and the page's refusal, and its content is never sent to them. Signed out, they are sent to
2018
+ * `unauthorizedRedirect` when the page names one (a sign-in).
2019
+ */
2020
+ access?: {
2021
+ permissions: string[];
2022
+ };
2002
2023
  /**
2003
2024
  * Where a visitor this page is not for is sent — a page's id or slug (`login`; `''` is the home page), its path, or a
2004
2025
  * full URL for somewhere off this space. Resolved to the page's id, and refused when it names no page.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-authoring",
3
- "version": "0.38.19",
3
+ "version": "0.38.21",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist/index.js",
@@ -42,6 +42,9 @@
42
42
  "url": "https://github.com/plitzi/plitzi-workspace.git"
43
43
  },
44
44
  "type": "module",
45
+ "engines": {
46
+ "node": ">=22.18"
47
+ },
45
48
  "sideEffects": false,
46
49
  "scripts": {
47
50
  "lint": "eslint ./src ./skills ./templates",
@@ -64,11 +67,11 @@
64
67
  "devDependencies": {
65
68
  "@microsoft/api-extractor": "^7.59.4",
66
69
  "@plitzi/plitzi-ui": "^1.6.34",
67
- "@plitzi/sdk-elements": "0.38.19",
68
- "@plitzi/sdk-interactions": "0.38.19",
69
- "@plitzi/sdk-schema": "0.38.19",
70
- "@plitzi/sdk-shared": "0.38.19",
71
- "@plitzi/sdk-style": "0.38.19",
70
+ "@plitzi/sdk-elements": "0.38.21",
71
+ "@plitzi/sdk-interactions": "0.38.21",
72
+ "@plitzi/sdk-schema": "0.38.21",
73
+ "@plitzi/sdk-shared": "0.38.21",
74
+ "@plitzi/sdk-style": "0.38.21",
72
75
  "@types/react": "^19.3.0",
73
76
  "eslint": "^9.39.5",
74
77
  "prettier": "^3.9.10",
@@ -63,6 +63,12 @@ A page's `accessLevel`: `'authenticated'` (signed in), `'public'` (signed OUT on
63
63
  twin on the same slug. `unauthorizedRedirect` names where a visitor the page is not for goes — a page's id or slug
64
64
  (`''` is the home page), or a URL; without it they are answered 403.
65
65
 
66
+ A page for some permissions says so: `access: { permissions: ['postPublish'] }` — every one held, by a signed-in visitor
67
+ (the permissions of their visitor roles; on Plitzi's own spaces, their account's). The server keeps it: anybody else is
68
+ answered 401 or 403 and the page's refusal, and its content is never sent to them — not in the page, not in the space
69
+ the browser fetches. Signed out, they go to `unauthorizedRedirect` when the page names one. Hiding a part of a page on
70
+ `auth.details.permissions` is not this: the part was still sent.
71
+
66
72
  ## What a visitor may do
67
73
 
68
74
  `settings.visitorRoles` — `{ author: ['postPublish'] }` — is what each role gives. A visitor holds exactly the
@@ -105,6 +105,7 @@ The space is not written until these are fixed.
105
105
  | `not-found-not-a-template` | `notFound`, a provider's or a page's, that is not one `{{ expression }}` — never `true`, so never a 404 | `notFound: '{{ source.found == false }}'` |
106
106
  | `notifications-shape` | `notifications` with a field it does not have, or a value that is not one CSS value | the field it suggests, or one it lists; one CSS value, like 'var(--card)', '12px' or '500' |
107
107
  | `outside-ancestor` | an element that reads the state of an element it is not inside | nest it in the element the message names |
108
+ | `page-access` | a page `access` the server cannot keep: no permissions, or one that is not a name | `access: { permissions: ['…'] }` with at least one permission name, or no `access` for a page anybody may see |
108
109
  | `page-access-level` | an `accessLevel` that is not one the router reads | one of the values the message lists |
109
110
  | `page-route-reserved` | a page under `/fn`, where the space's functions answer | another slug |
110
111
  | `page-route-taken` | two pages at one address for the same visitors | another slug — or `accessLevel` `'public'` on one and `'authenticated'` on the other |
@@ -79,6 +79,9 @@ room.publish('react', { emoji }, { echo: true }); // and heard here too
79
79
  room.members; // who is here, with the state each announced
80
80
  ```
81
81
 
82
+ A job of the space's functions, live in a plugin: `const job = useJob(jobId)` — `job?.progress`, `job?.status`,
83
+ `job?.result` — for whoever the job lets watch it (its `watch`), `undefined` until it is heard.
84
+
82
85
  Messages arrive through the callback and re-render nothing. Take the topic as a prop
83
86
  (`bindTemplate('roomTopic', 'board.id', 'room:{{ source }}')`) so the space names its channels, and trust a message
84
87
  you act on only when `message.from === 'server'`. The page has one connection and is one member per topic, however
@@ -44,6 +44,10 @@ channels: { desk: { access: { mode: 'session' }, publish: 'server', retain: true
44
44
  // a flow: { task: 'realtime.publish', params: { topic: 'desk', type: 'lists', data: '{{ saved.lists }}' } }
45
45
  ```
46
46
 
47
+ A job of the space's functions (`ctx.jobs.start`) says how it goes on `$job:<id>`, a topic no space declares — opened
48
+ for whoever started it and whoever the job's `watch` lets in: `channel({ id: 'training', topic: '$job:{{ state.job }}' })`
49
+ binds `training.retained.job` (`{ status, progress, step, result, error }`).
50
+
47
51
  Two people writing the same thing at once: `kv.setIf` writes only if the value is still the one the flow read (empty
48
52
  `expected` = only if nothing is there yet — claim a seat, a username), `list.put`/`list.range` keep an ordered list
49
53
  (latest first, a leaderboard), and `flow.rateLimit` first in a public action that writes.