@opencxh/domain 1.260.0 → 1.263.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.
@@ -89,7 +89,7 @@ export interface ToolSource {
89
89
  /** A second line: a snippet, a date, an author. */
90
90
  detail?: string;
91
91
  /**
92
- * Where to open this source. Two forms, told apart by their first character:
92
+ * Where to open this source. Three forms, told apart by their prefix:
93
93
  *
94
94
  * - **`/…`** — a shell-absolute in-product route, including the `/apps/<app>`
95
95
  * prefix, since the source may well belong to a different app than the one
@@ -101,6 +101,10 @@ export interface ToolSource {
101
101
  * A Shopify order lives in Shopify's admin and nowhere here; pretending
102
102
  * otherwise would mean either a dead in-product link or dropping the only
103
103
  * address the thing has.
104
+ * - **`settings:<pageId>`** — a settings page, opened in the overlay. Such a
105
+ * page has no route of its own; `sdk.ui.showSettings(pageId)` is the only
106
+ * way in. Without this form a source that lives in settings can be named
107
+ * but not reached.
104
108
  *
105
109
  * Absent when the thing has no page at all — a memory item, for instance —
106
110
  * which is a reason to show it without a link, not a reason to hide it.
@@ -134,6 +134,38 @@ export declare function resourceKindOf(scopeKey: string): string;
134
134
  */
135
135
  export declare const SCOPE_RELATED_ROUTE = "/provider/scope/related";
136
136
  export declare const SCOPE_READ_ROUTE = "/provider/scope/read";
137
+ /**
138
+ * **What can be guarded** on the kinds this app owns: the third optional route on the `scope`
139
+ * role, on the same terms as the two above — an app that does not implement it offers no acts,
140
+ * never an error.
141
+ *
142
+ * It exists because the alternative was a text field. An approval rule names an act
143
+ * (`issue`, `status:scheduled`), and only the owning app knows which acts it actually guards —
144
+ * and for `work` that list is not even static: it is one entry per status in every project
145
+ * ladder. A screen cannot hold that list and a person should not have to type it.
146
+ */
147
+ export declare const SCOPE_ACTS_ROUTE = "/provider/scope/acts";
148
+ /** One thing that can be made to need a signature. */
149
+ export interface GuardableAct {
150
+ /** The scope kind it applies to: `"quote"`, `"work_item"`. */
151
+ kind: string;
152
+ /** What the owning app calls it when it asks the gate: `"issue"`, `"status:scheduled"`. */
153
+ act: string;
154
+ /**
155
+ * What it is called on a settings screen, already rendered.
156
+ *
157
+ * A string and not an i18n key: `work` composes these from statuses an organisation named
158
+ * itself ("Ingepland"), so there is no key to stamp — and the two halves of one list must not
159
+ * be localised by different rules.
160
+ */
161
+ label: string;
162
+ /** What the kind is called, same reasoning. Repeated per row so the caller need not join. */
163
+ kindLabel?: string;
164
+ }
165
+ /** Bare payload of {@link SCOPE_ACTS_ROUTE}, like every describe in this repo. */
166
+ export interface ScopeActsResponse {
167
+ acts: GuardableAct[];
168
+ }
137
169
  /**
138
170
  * One explicit link between two resources, stored by apps/context.
139
171
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencxh/domain",
3
- "version": "1.260.0",
3
+ "version": "1.263.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",