-
Notifications
You must be signed in to change notification settings - Fork 6
support the workflow status for cli and mcp and node sdk users #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7b19f41
cdcc318
c91f868
d5484a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -14,6 +14,7 @@ export type WorkflowEmailTemplate = { | |||||
| */ | ||||||
| export type WorkflowAttributes = { | ||||||
| name: string; | ||||||
| status: 'live' | 'draft'; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Making
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: src/sdk/workflows/types.ts
Line: 17
Comment:
**`status` as required field is a breaking change**
Making `status` required means any existing cached/persisted API response that doesn't include this field will fail TypeScript type checks. If there's any chance the API returns workflows without `status` (e.g., older records), this should be optional:
```suggestion
status?: 'live' | 'draft';
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||
| created_at: string; | ||||||
| email_templates: WorkflowEmailTemplate[]; | ||||||
| }; | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
"type": "module"without a CJS build output or anexportsfield with arequirecondition means any consumer usingrequire('@bentonow/bento-node-sdk')will get a runtime error:ERR_REQUIRE_ESM. The PR description mentions improving vanilla JS compatibility, but this change has the opposite effect for CJS environments.To support both, add an
exportsfield with dual entry points:And update the build script to emit both ESM and CJS outputs.
Prompt To Fix With AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDK is ESM only anyway, this allows others to use it as a module with proper imports, we don't have any CJS in here so its a non issue.