@cratis/stage.runtime 5.1.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/App.d.ts +2 -1
- package/dist/src/SandboxActingUser.d.ts +2 -0
- package/dist/src/StageCommandForm.d.ts +4 -1
- package/dist/src/blueprint.d.ts +4 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +830 -744
- package/dist/src/readableValue.d.ts +2 -1
- package/dist/src/sandboxActingUser.d.ts +19 -0
- package/dist/src/stageFormSchema.d.ts +10 -1
- package/dist/src/stageSource.d.ts +5 -0
- package/package.json +1 -1
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* A value of a table cell the way a person reads it, recognised by its runtime type or its ISO format.
|
|
3
3
|
*
|
|
4
4
|
* A boolean reads Yes or No; an ISO date or date-time reads in the user's locale. Anything else - or a text that only looks like a date
|
|
5
|
-
* but is not one - is left as it is.
|
|
5
|
+
* but is not one - is left as it is. A collection reads as its values joined with a comma when it holds scalars or objects with a single
|
|
6
|
+
* field, and as its item count when its objects carry several fields.
|
|
6
7
|
*
|
|
7
8
|
* @param value The value the row carries.
|
|
8
9
|
* @returns The text to show, or undefined when the value is not one this reads.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type StageSource } from './stageSource';
|
|
2
|
+
/** A modeled name and its display-only description. Identity is always resolved by the host. */
|
|
3
|
+
export interface SandboxActingUser {
|
|
4
|
+
name: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
personas: string[];
|
|
7
|
+
}
|
|
8
|
+
/** The live sandbox's browser-local selection. Static and published sources do not offer it. */
|
|
9
|
+
export interface SandboxActingUserState {
|
|
10
|
+
enabled: true;
|
|
11
|
+
users: SandboxActingUser[];
|
|
12
|
+
current: string | null;
|
|
13
|
+
}
|
|
14
|
+
/** Reads only the host-gated surface, relative to the current sandbox base URL. */
|
|
15
|
+
export declare function readSandboxActingUser(signal: AbortSignal, fetcher?: typeof fetch): Promise<SandboxActingUserState | undefined>;
|
|
16
|
+
/** Writes only a modeled name (or clears it); no caller-supplied roles or claims travel in the selection. */
|
|
17
|
+
export declare function writeSandboxActingUser(name: string | null, fetcher?: typeof fetch): Promise<void>;
|
|
18
|
+
/** Refreshes identity, authorization and subscriptions together, only after the host accepts the selection. */
|
|
19
|
+
export declare function changeSandboxActingUser(source: StageSource, name: string | null, reload: () => void): Promise<void>;
|
|
@@ -19,6 +19,11 @@ export interface SchemaProperty {
|
|
|
19
19
|
* another entity, such as the product it adds. Only the schema a task dialog is built from says so.
|
|
20
20
|
*/
|
|
21
21
|
identity?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Set when the schema marks the identifier the command acts on and this identifier is not it - the company a link-to-company command assigns. A row
|
|
24
|
+
* that happens to carry a value of this name does not bind it: the field stays visible and editable.
|
|
25
|
+
*/
|
|
26
|
+
otherEntity?: boolean;
|
|
22
27
|
type?: 'text' | 'number' | 'boolean' | 'date';
|
|
23
28
|
required: boolean;
|
|
24
29
|
unsupportedReason?: string;
|
|
@@ -36,8 +41,12 @@ export declare function createsEntity(schema: string): boolean;
|
|
|
36
41
|
/**
|
|
37
42
|
* The properties a command's JSON schema declares, with the type the native form gives each and whether it is required. A toolbar
|
|
38
43
|
* slice's task dialog is built from the same reading, so a command is the same fields wherever it is presented.
|
|
44
|
+
*
|
|
45
|
+
* @param schema The schema to read.
|
|
46
|
+
* @param identitySchema The schema the host serves for the command, which marks the identifier it acts on (`x-identity`) when the schema a
|
|
47
|
+
* rendered scene carries on an action does not.
|
|
39
48
|
*/
|
|
40
|
-
export declare function schemaPropertiesOf(schema: string): SchemaProperty[];
|
|
49
|
+
export declare function schemaPropertiesOf(schema: string, identitySchema?: string): SchemaProperty[];
|
|
41
50
|
/** Humanizes a member name the way a field label reads: `postalCode` is “Postal code”. */
|
|
42
51
|
export { humanize };
|
|
43
52
|
/**
|
|
@@ -3,6 +3,7 @@ import type { StringsDictionary } from '@cratis/scene.engine';
|
|
|
3
3
|
import type { StageRoutes } from './stageRoutes';
|
|
4
4
|
import type { StageSceneApplication } from './App';
|
|
5
5
|
import type { StageNotesState } from './stageNotes';
|
|
6
|
+
import type { SandboxActingUserState } from './sandboxActingUser';
|
|
6
7
|
/** The content supplied by the host of a Stage application. */
|
|
7
8
|
export interface StageSource {
|
|
8
9
|
scene(signal: AbortSignal): Promise<StageSceneApplication>;
|
|
@@ -11,6 +12,9 @@ export interface StageSource {
|
|
|
11
12
|
strings(locale: string, signal: AbortSignal): Promise<StringsDictionary>;
|
|
12
13
|
/** What the host says about feedback: whether Notes is served, and the model references. A source with nothing to say omits it. */
|
|
13
14
|
notes?(signal: AbortSignal): Promise<StageNotesState>;
|
|
15
|
+
/** A live sandbox's host-gated caller selection. Never supplied by a static application. */
|
|
16
|
+
actingUser?(signal: AbortSignal): Promise<SandboxActingUserState | undefined>;
|
|
17
|
+
selectActingUser?(name: string | null): Promise<void>;
|
|
14
18
|
}
|
|
15
19
|
/** What a generated application already holds when it is built. */
|
|
16
20
|
export interface StageStaticContent {
|
|
@@ -26,6 +30,7 @@ export declare const stageEndpoints: {
|
|
|
26
30
|
routes: string;
|
|
27
31
|
locales: string;
|
|
28
32
|
modelReferences: string;
|
|
33
|
+
actingUser: string;
|
|
29
34
|
strings: (locale: string) => string;
|
|
30
35
|
};
|
|
31
36
|
/** Supplies the source the runtime below reads from. Transport belongs to the host. */
|