Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '24'
cache: 'npm'
- name: Install dependencies
run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '24'
cache: 'npm'
- name: Install dependencies
run: npm ci
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"version": "1.0.0",
"license": "MIT",
"engines": {
"node": "16.x",
"npm": "8.x"
"node": "24.x",
"npm": "11.x"
},
"private": true,
"scripts": {
Expand Down
10 changes: 10 additions & 0 deletions src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ const LinkButton = z.object({
linkButtonLabel: z.string().max(500),
});

const WorkflowButton = z.object({
workflowButtonLabel: z.string().max(500),
workflowButtonWorkflowIdentifier: z.object({
workflowId: z.string(),
}),
});

const Spacer = z.object({
spacerSize: ComponentSpacerSize,
});
Expand All @@ -48,6 +55,7 @@ const RowContentUnionInput = z.object({
componentText: Text.optional(),
componentDivider: Divider.optional(),
componentLinkButton: LinkButton.optional(),
componentWorkflowButton: WorkflowButton.optional(),
componentSpacer: Spacer.optional(),
componentBadge: Badge.optional(),
componentCopyButton: CopyButton.optional(),
Expand All @@ -62,6 +70,7 @@ const ContainerContentUnionInput = z.object({
componentText: Text.optional(),
componentDivider: Divider.optional(),
componentLinkButton: LinkButton.optional(),
componentWorkflowButton: WorkflowButton.optional(),
componentSpacer: Spacer.optional(),
componentBadge: Badge.optional(),
componentCopyButton: CopyButton.optional(),
Expand All @@ -76,6 +85,7 @@ export const Component = z.object({
componentText: Text.optional(),
componentDivider: Divider.optional(),
componentLinkButton: LinkButton.optional(),
componentWorkflowButton: WorkflowButton.optional(),
componentSpacer: Spacer.optional(),
componentBadge: Badge.optional(),
componentCopyButton: CopyButton.optional(),
Expand Down
2 changes: 2 additions & 0 deletions src/example-cards/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import usage from './usage';
import latestInvoice from './latestInvoice';
import sentry from './sentry';
import tutorial from './tutorial';
import workflow from './workflow';

export const cardExamples: (() => Card)[] = [
// realistic examples
Expand All @@ -21,6 +22,7 @@ export const cardExamples: (() => Card)[] = [
sentry,
timerCard,
tutorial,
workflow,

// component examples
componentLibrary,
Expand Down
31 changes: 31 additions & 0 deletions src/example-cards/workflow.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Card } from '../response';

export default (): Card => {
return {
key: 'workflow-card',
timeToLiveSeconds: null,
components: [
{
componentText: {
text: 'Trigger a workflow directly from a customer card.',
textSize: 'S',
textColor: 'MUTED',
},
},
{
componentSpacer: {
spacerSize: 'M',
},
},
{
componentWorkflowButton: {
workflowButtonLabel: 'Run workflow',
workflowButtonWorkflowIdentifier: {
// This is a placeholder workflow ID from Plain's developer environment. You'll need to replace this with the a workflow ID from your workspace.
workflowId: 'wf_01KKKW99MRJW6SY6C12JS0NRBR',
},
},
},
],
};
};
Loading