From 7b19f41769566d59979c0f82b72e41a77a13b872 Mon Sep 17 00:00:00 2001 From: Zachary Date: Fri, 6 Feb 2026 19:00:04 +0900 Subject: [PATCH 1/2] Add ESM package type and keep CJS configs --- eslint.config.js => eslint.config.cjs | 0 jest.config.js => jest.config.cjs | 0 package.json | 1 + 3 files changed, 1 insertion(+) rename eslint.config.js => eslint.config.cjs (100%) rename jest.config.js => jest.config.cjs (100%) diff --git a/eslint.config.js b/eslint.config.cjs similarity index 100% rename from eslint.config.js rename to eslint.config.cjs diff --git a/jest.config.js b/jest.config.cjs similarity index 100% rename from jest.config.js rename to jest.config.cjs diff --git a/package.json b/package.json index 44de535..ff40feb 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "🍱 Bento Node.JS SDK and tracking library", "author": "Backpack Internet", "license": "MIT", + "type": "module", "main": "dist/index.js", "module": "dist/index.js", "types": "dist/index.d.ts", From cdcc3187a80091adcad92ec81946e1440c2880eb Mon Sep 17 00:00:00 2001 From: ziptied Date: Tue, 17 Mar 2026 21:45:10 +0900 Subject: [PATCH 2/2] feat: add status field to workflow attributes Add status field to WorkflowAttributes type to track workflow state as either 'live' or 'draft'. Update all workflow test fixtures to include the new status field and add assertions to verify status values are correctly returned from the API. --- __tests__/workflows/workflows.test.ts | 5 +++++ src/sdk/workflows/types.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/__tests__/workflows/workflows.test.ts b/__tests__/workflows/workflows.test.ts index a488c3a..6db2b57 100644 --- a/__tests__/workflows/workflows.test.ts +++ b/__tests__/workflows/workflows.test.ts @@ -23,6 +23,7 @@ describe('BentoWorkflows', () => { type: EntityType.WORKFLOWS, attributes: { name: 'Welcome Workflow', + status: 'live', created_at: '2024-01-01T00:00:00Z', email_templates: [ { id: 1, subject: 'Welcome!', stats: { opened: 150, clicked: 75 } }, @@ -35,6 +36,7 @@ describe('BentoWorkflows', () => { type: EntityType.WORKFLOWS, attributes: { name: 'Abandoned Cart Workflow', + status: 'draft', created_at: '2024-02-01T00:00:00Z', email_templates: [{ id: 3, subject: 'You left something behind', stats: null }], }, @@ -48,8 +50,10 @@ describe('BentoWorkflows', () => { expect(result).toHaveLength(2); expect(result[0].attributes.name).toBe('Welcome Workflow'); + expect(result[0].attributes.status).toBe('live'); expect(result[0].attributes.email_templates).toHaveLength(2); expect(result[1].attributes.name).toBe('Abandoned Cart Workflow'); + expect(result[1].attributes.status).toBe('draft'); }); test('uses correct endpoint for GET request', async () => { @@ -104,6 +108,7 @@ describe('BentoWorkflows', () => { type: EntityType.WORKFLOWS, attributes: { name: 'Empty Workflow', + status: 'live', created_at: '2024-01-01T00:00:00Z', email_templates: [], }, diff --git a/src/sdk/workflows/types.ts b/src/sdk/workflows/types.ts index 0a26656..cd9462a 100644 --- a/src/sdk/workflows/types.ts +++ b/src/sdk/workflows/types.ts @@ -14,6 +14,7 @@ export type WorkflowEmailTemplate = { */ export type WorkflowAttributes = { name: string; + status: 'live' | 'draft'; created_at: string; email_templates: WorkflowEmailTemplate[]; };