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/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 30d1550..72f6861 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", 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[]; };