@osdk/react 0.6.0-beta.3 → 0.6.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/CHANGELOG.md +64 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
# @osdkkit/react
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 322c5bc: Simulated release
|
|
8
|
+
- 47f1bf1: Add backward compatibility to OsdkProvider2 by also providing OsdkContext
|
|
9
|
+
|
|
10
|
+
OsdkProvider2 now provides both OsdkContext2 and the original OsdkContext, enabling existing hooks like useOsdkClient and useOsdkMetadata to work with OsdkProvider2. This allows OsdkProvider2 to serve as a complete replacement for OsdkProvider while maintaining backward compatibility.
|
|
11
|
+
|
|
12
|
+
- 37c7c0b: Add validateAction support to useOsdkAction hook
|
|
13
|
+
|
|
14
|
+
The `useOsdkAction` hook in `@osdk/react` now provides a `validateAction` function that allows you to check if an action is valid without executing it. This is useful for providing real-time validation feedback to users before they commit to performing an action.
|
|
15
|
+
|
|
16
|
+
### New features:
|
|
17
|
+
|
|
18
|
+
- **validateAction**: A new async function that validates action parameters without executing the action
|
|
19
|
+
- **isValidating**: A boolean state that indicates when validation is in progress
|
|
20
|
+
- **validationResult**: Contains the validation response from the server, including whether the action is valid and any validation errors
|
|
21
|
+
|
|
22
|
+
### Example usage:
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
const { applyAction, validateAction, isValidating, validationResult } =
|
|
26
|
+
useOsdkAction(myAction);
|
|
27
|
+
|
|
28
|
+
// Validate without executing
|
|
29
|
+
await validateAction({ param1: "value" });
|
|
30
|
+
|
|
31
|
+
// Check validation result
|
|
32
|
+
if (validationResult?.result === "VALID") {
|
|
33
|
+
console.log("Action is valid!");
|
|
34
|
+
} else {
|
|
35
|
+
console.log("Validation failed:", validationResult);
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Implementation details:
|
|
40
|
+
|
|
41
|
+
- Multiple validation calls can be made - new calls automatically cancel previous pending validations
|
|
42
|
+
- Validation and action execution are mutually exclusive - you cannot validate while an action is being applied and vice versa
|
|
43
|
+
- The underlying `ObservableClient` in `@osdk/client` has been extended with a `validateAction` method to support this functionality
|
|
44
|
+
|
|
45
|
+
- Updated dependencies [322c5bc]
|
|
46
|
+
- Updated dependencies [322c5bc]
|
|
47
|
+
- Updated dependencies [11d2f23]
|
|
48
|
+
- Updated dependencies [4bc848b]
|
|
49
|
+
- Updated dependencies [402eb67]
|
|
50
|
+
- Updated dependencies [9f4fe9e]
|
|
51
|
+
- Updated dependencies [29d2ada]
|
|
52
|
+
- Updated dependencies [8dd6229]
|
|
53
|
+
- Updated dependencies [8c95154]
|
|
54
|
+
- Updated dependencies [f022ffe]
|
|
55
|
+
- Updated dependencies [c32dcf2]
|
|
56
|
+
- Updated dependencies [25c839d]
|
|
57
|
+
- Updated dependencies [722c89a]
|
|
58
|
+
- Updated dependencies [9101bad]
|
|
59
|
+
- Updated dependencies [06fd45a]
|
|
60
|
+
- Updated dependencies [44bbbe0]
|
|
61
|
+
- Updated dependencies [d2d36e1]
|
|
62
|
+
- Updated dependencies [c763807]
|
|
63
|
+
- Updated dependencies [37c7c0b]
|
|
64
|
+
- @osdk/api@2.4.0
|
|
65
|
+
- @osdk/client@2.4.0
|
|
66
|
+
|
|
3
67
|
## 0.6.0-beta.3
|
|
4
68
|
|
|
5
69
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/react",
|
|
3
|
-
"version": "0.6.0
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"react": "^18.0.0",
|
|
51
51
|
"tiny-invariant": "^1.3.3",
|
|
52
52
|
"typescript": "~5.5.4",
|
|
53
|
-
"@osdk/
|
|
54
|
-
"@osdk/
|
|
55
|
-
"@osdk/monorepo.
|
|
56
|
-
"@osdk/monorepo.
|
|
53
|
+
"@osdk/api": "2.4.0",
|
|
54
|
+
"@osdk/client": "2.4.0",
|
|
55
|
+
"@osdk/monorepo.tsconfig": "~0.3.0",
|
|
56
|
+
"@osdk/monorepo.api-extractor": "~0.3.0"
|
|
57
57
|
},
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|