Skip to content

Commit 1ad9a5a

Browse files
committed
Fix workflow action type and optional issue
1 parent 9e8f755 commit 1ad9a5a

File tree

13 files changed

+64
-9
lines changed

13 files changed

+64
-9
lines changed

.changeset/afraid-rockets-camp.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@pulse-editor/shared-utils": patch
3+
"@pulse-editor/react-api": patch
4+
---
5+
6+
Allow optional args for workflow handler

.changeset/pre.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"changesets": [
1212
"afraid-moments-punch",
13+
"afraid-rockets-camp",
1314
"angry-llamas-smash",
1415
"beige-pandas-rhyme",
1516
"beige-pumas-run",
@@ -50,6 +51,7 @@
5051
"real-knives-rest",
5152
"rude-ducks-design",
5253
"sad-tables-join",
54+
"shaggy-geckos-bow",
5355
"sharp-memes-give",
5456
"shiny-doodles-jump",
5557
"silent-glasses-kick",

.changeset/shaggy-geckos-bow.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@pulse-editor/shared-utils": patch
3+
"@pulse-editor/react-api": patch
4+
---
5+
6+
Fix object type issue in typed variable

npm-packages/react-api/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# @pulse-editor/react-api
22

3+
## 0.1.1-beta.59
4+
5+
### Patch Changes
6+
7+
- Fix object type issue in typed variable
8+
- Updated dependencies
9+
- @pulse-editor/shared-utils@0.1.1-beta.59
10+
11+
## 0.1.1-beta.58
12+
13+
### Patch Changes
14+
15+
- Allow optional args for workflow handler
16+
- Updated dependencies
17+
- @pulse-editor/shared-utils@0.1.1-beta.58
18+
319
## 0.1.1-beta.57
420

521
### Patch Changes

npm-packages/react-api/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pulse-editor/react-api",
3-
"version": "0.1.1-beta.57",
3+
"version": "0.1.1-beta.59",
44
"main": "dist/main.js",
55
"files": [
66
"dist"
@@ -37,7 +37,7 @@
3737
"typescript-eslint": "^8.30.1"
3838
},
3939
"peerDependencies": {
40-
"@pulse-editor/shared-utils": "0.1.1-beta.57",
40+
"@pulse-editor/shared-utils": "0.1.1-beta.59",
4141
"react": "^19.0.0",
4242
"react-dom": "^19.0.0"
4343
},

npm-packages/react-api/src/hooks/editor/use-register-action.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,14 @@ export default function useRegisterAction(
123123
}
124124
// Validate parameters
125125
const actionParams = actionInfo.parameters ?? {};
126-
if (Object.keys(args).length !== Object.keys(actionParams).length) {
126+
127+
const requiredParamCount = Object.entries(actionParams).filter(
128+
([, paramInfo]) => !(paramInfo as TypedVariable).optional,
129+
).length;
130+
131+
if (Object.keys(args).length < requiredParamCount) {
127132
throw new Error(
128-
`Invalid number of parameters: expected ${
133+
`Invalid number of parameters: expected at least${
129134
Object.keys(actionParams).length
130135
}, got ${Object.keys(args).length}`,
131136
);

npm-packages/shared-utils/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# @pulse-editor/shared-utils
22

3+
## 0.1.1-beta.59
4+
5+
### Patch Changes
6+
7+
- Fix object type issue in typed variable
8+
9+
## 0.1.1-beta.58
10+
11+
### Patch Changes
12+
13+
- Allow optional args for workflow handler
14+
315
## 0.1.1-beta.57
416

517
### Patch Changes

npm-packages/shared-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pulse-editor/shared-utils",
3-
"version": "0.1.1-beta.57",
3+
"version": "0.1.1-beta.59",
44
"main": "dist/main.js",
55
"files": [
66
"dist"

npm-packages/shared-utils/src/types/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export type TypedVariableType =
215215
| "string"
216216
| "number"
217217
| "boolean"
218-
| "any"
218+
| "object"
219219
// An app instance is a reference to another app.
220220
// This instance could be possessed by the owner,
221221
// or it can be initialized by the caller.

web/components/marketplace/app/app-preview-card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ export default function AppPreviewCard({
362362
<Button
363363
color="primary"
364364
size="sm"
365-
onPress={(e) => {
366-
installExtension(
365+
onPress={async (e) => {
366+
await installExtension(
367367
extension.remoteOrigin,
368368
extension.config.id,
369369
extension.config.version,

0 commit comments

Comments
 (0)