@cratis/stage.runtime 4.187.0 → 4.187.2

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.
@@ -23,5 +23,29 @@ export declare function StageCommandForm({ element }: StageCommandFormProps): im
23
23
  * A required uuid property that the form does not list is that kind of identity - the screen's own parameter when it carries one, otherwise one value per
24
24
  * identifier concept for as long as this browser keeps the session - the same basket for every add, change and checkout, a different one for
25
25
  * another browser - and a command is never submitted for an identity nobody chose.
26
+ *
27
+ * A schema that marks the identifier the command acts on (`x-identity`, a task dialog's) says which one that is: only it is created, and a
28
+ * reference to another entity gets only what the address or the session supplies. A schema that marks none - an authored form's - leaves
29
+ * every identifier it does not show to the session, as it always has.
26
30
  */
27
31
  export declare function sessionIdentifiers(fields: FormField[], schema: SchemaProperty[], parameters: Record<string, string>): StageCommandContent;
32
+ /**
33
+ * Whether a task dialog leaves an identifier out of what it asks: the identifier the command acts on (`x-identity`) - the shopper's basket,
34
+ * which the session supplies or creates - or one the address or the session already supplies. Every other identifier is a reference to
35
+ * another entity - the product an add to basket is for - and is the person's to choose.
36
+ *
37
+ * @param property The property of the command.
38
+ * @param parameters The screen's address parameters.
39
+ * @returns Whether the dialog does not ask for it.
40
+ */
41
+ export declare function suppliedWithoutAsking(property: SchemaProperty, parameters: Record<string, string>): boolean;
42
+ /**
43
+ * The value an identifier property already has without anyone typing it: the screen's parameter of the same name, or the identity the session
44
+ * already holds for its concept. Nothing is created here, so a reference to another entity - the product an add to basket is for - that
45
+ * nothing supplies stays a value the person filling the form is asked for.
46
+ *
47
+ * @param property The property of the command.
48
+ * @param parameters The screen's address parameters.
49
+ * @returns The value, or nothing when the property is not an identifier or nothing supplies it.
50
+ */
51
+ export declare function suppliedIdentifier(property: SchemaProperty, parameters: Record<string, string>): string | undefined;
@@ -9,6 +9,13 @@ export declare function registeredCommand(name: string, typeName?: string, route
9
9
  * they would be posted to the root of the proxy's host instead of to the Stage.
10
10
  */
11
11
  export declare function hostedBasePath(): string;
12
+ /**
13
+ * Points a command at the path the page is served under when Arc was not given a base path. Arc's own command form builds its command from
14
+ * Arc's default configuration, whose empty base path posts to the root of the host - Studio's Play at `/api/play/{id}/` refused that with `405`.
15
+ */
16
+ export declare function withHostedBasePath<TCommand extends {
17
+ setApiBasePath(apiBasePath: string): void;
18
+ }>(command: TCommand, arcApiBasePath?: string): TCommand;
12
19
  /** Executes the registered proxy with the same host configuration as Arc's useCommand. */
13
20
  export declare function executeRegisteredCommand(name: string, values: Record<string, unknown>, arc: ArcConfiguration): Promise<StageCommandOutcome>;
14
21
  /** Maps Arc's typed result without treating a rejection or authorization failure as success. */