@openfairygui/functions 0.1.0 → 0.2.0-alpha.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @openfairygui/functions
2
2
 
3
- Composable authoring and publish functions built on top of `@openfairygui/core`.
3
+ Composable authoring workflows and thin application seams built on top of `@openfairygui/core`.
4
4
 
5
5
  ## Install
6
6
 
@@ -21,6 +21,41 @@ const report = inspect(doc);
21
21
  await doc.transform(publish({ output: './release' }));
22
22
  ```
23
23
 
24
+ ## Phase A UAM authoring seam
25
+
26
+ `@openfairygui/functions` also exposes a thin stateless wrapper over the Phase A UAM
27
+ transaction contract from `@openfairygui/core`.
28
+
29
+ This seam:
30
+
31
+ - accepts `UamProject` + `UamTransactionOperation[]`
32
+ - returns structured app-level success / failure results
33
+ - does not expose `Document`
34
+ - does not define a second selector / operation grammar
35
+ - does not wrap `publish` or `restore`
36
+
37
+ ```ts
38
+ import {
39
+ type UamProject,
40
+ type UamTransactionOperation,
41
+ } from '@openfairygui/core';
42
+ import { applyUamTransactionApp } from '@openfairygui/functions';
43
+
44
+ const project: UamProject = /* ... */;
45
+ const operations: UamTransactionOperation[] = [
46
+ {
47
+ kind: 'renameResource',
48
+ selector: { packageId: 'pkg001', resourceId: 'img001' },
49
+ newName: 'renamed.png',
50
+ },
51
+ ];
52
+
53
+ const result = applyUamTransactionApp({ project, operations });
54
+ if (!result.ok) {
55
+ console.error(result.error.code, result.error.stage, result.error.message);
56
+ }
57
+ ```
58
+
24
59
  Repository:
25
60
 
26
61
  - https://github.com/OpenFairyGUI/OpenFairyGUI