{"_id":"@astralibx/call-log-types","_rev":"2-312697841781795c2c7d9fca8d16b736","name":"@astralibx/call-log-types","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.0":{"name":"@astralibx/call-log-types","version":"0.2.0","keywords":["call-log","types","pipeline","analytics"],"license":"MIT","_id":"@astralibx/call-log-types@0.2.0","maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"homepage":"https://github.com/Hariprakash1997/astralib#readme","bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"dist":{"shasum":"2666f61412768753f36d2203a24045d92932e479","tarball":"https://registry.npmjs.org/@astralibx/call-log-types/-/call-log-types-0.2.0.tgz","fileCount":8,"integrity":"sha512-iMHGAyWTXlj+pmP/a2H8pOYU4dCx++K6FMse0gGopzWSFtqLhQhX2hRTjmu5OBghaeUN0bixu17HuA30LKuPfg==","signatures":[{"sig":"MEYCIQDopIhFjCA4TdRaqY8GOTyywWI+nkxbMIesgHgpCXb3zAIhAJ5cxfcOa0Fs94ADe+OKosKIz8MJeylulAEOYDj4d6w5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30066},"main":"dist/index.cjs","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}}},"gitHead":"c09e61ad1f66611cab260c4df471e3cffeb87958","scripts":{"dev":"tsup --watch","lint":"eslint src/","test":"vitest run","build":"tsup","clean":"rm -rf dist","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"astralib","email":"1997hariprakash@gmail.com"},"repository":{"url":"git+https://github.com/Hariprakash1997/astralib.git","type":"git","directory":"packages/call-log/call-log-types"},"_npmVersion":"10.9.4","description":"Shared TypeScript type definitions, enums, and contracts for the call-log module","directories":{},"_nodeVersion":"22.22.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^3.0.0","typescript":"^5.8.2","@vitest/coverage-v8":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/call-log-types_0.2.0_1774147453725_0.34049175566050227","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@astralibx/call-log-types","version":"0.3.0","description":"Shared TypeScript type definitions, enums, and contracts for the call-log module","repository":{"type":"git","url":"git+https://github.com/Hariprakash1997/astralib.git","directory":"packages/call-log/call-log-types"},"main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}}},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","lint":"eslint src/","clean":"rm -rf dist"},"keywords":["call-log","types","pipeline","analytics"],"license":"MIT","devDependencies":{"@vitest/coverage-v8":"^3.0.0","tsup":"^8.0.0","typescript":"^5.8.2","vitest":"^3.0.0"},"_id":"@astralibx/call-log-types@0.3.0","gitHead":"aa24b21103d13c355fbf84fb143335febb4b0136","bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"homepage":"https://github.com/Hariprakash1997/astralib#readme","_nodeVersion":"22.22.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-E2eKg6v7cnydVWFUQKUJVTO0QpFzpZXuTL3Yhyrx99GWKRjPmIOPvJcaA9KCdOmZ+S/aUKeqbAfstMffBrxKJg==","shasum":"9b8c7869da24d60572ca5a95f6ab47b5486e9f6d","tarball":"https://registry.npmjs.org/@astralibx/call-log-types/-/call-log-types-0.3.0.tgz","fileCount":8,"unpackedSize":36467,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC6jgvmVGkc1P+hFOSuj4A1gBOUnzbJ+I9s5WdoQPEBKwIgCXiF96bkwk9HPAJWJ0sXh2XBxpDcCLrZNPRJrhEHEdY="}]},"_npmUser":{"name":"astralib","email":"1997hariprakash@gmail.com"},"directories":{},"maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/call-log-types_0.3.0_1774200548362_0.6873930377369855"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-22T02:44:13.629Z","modified":"2026-03-22T17:29:08.650Z","0.2.0":"2026-03-22T02:44:13.880Z","0.3.0":"2026-03-22T17:29:08.514Z"},"bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"license":"MIT","homepage":"https://github.com/Hariprakash1997/astralib#readme","keywords":["call-log","types","pipeline","analytics"],"repository":{"type":"git","url":"git+https://github.com/Hariprakash1997/astralib.git","directory":"packages/call-log/call-log-types"},"description":"Shared TypeScript type definitions, enums, and contracts for the call-log module","maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"readme":"# @astralibx/call-log-types\n\n[![npm version](https://img.shields.io/npm/v/@astralibx/call-log-types.svg)](https://www.npmjs.com/package/@astralibx/call-log-types)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nShared TypeScript type definitions, enums, and contracts for the call-log module.\n\n## Install\n\n```bash\nnpm install @astralibx/call-log-types\n```\n\nNo runtime dependencies -- pure TypeScript declarations and enums.\n\n## Enums\n\n| Enum | Values | Description |\n|------|--------|-------------|\n| `CallDirection` | `Inbound`, `Outbound` | Direction of the call |\n| `CallPriority` | `Low`, `Medium`, `High`, `Urgent` | Priority level for a call log |\n| `TimelineEntryType` | `Note`, `StageChange`, `Assignment`, `FollowUpSet`, `FollowUpCompleted`, `System` | Type of timeline entry |\n\n### Enum values\n\n```ts\nimport { CallDirection, CallPriority, TimelineEntryType } from '@astralibx/call-log-types';\n\nCallDirection.Inbound    // 'inbound'\nCallDirection.Outbound   // 'outbound'\n\nCallPriority.Low         // 'low'\nCallPriority.Medium      // 'medium'\nCallPriority.High        // 'high'\nCallPriority.Urgent      // 'urgent'\n\nTimelineEntryType.Note              // 'note'\nTimelineEntryType.StageChange       // 'stage_change'\nTimelineEntryType.Assignment        // 'assignment'\nTimelineEntryType.FollowUpSet       // 'follow_up_set'\nTimelineEntryType.FollowUpCompleted // 'follow_up_completed'\nTimelineEntryType.System            // 'system'\n```\n\n## Interfaces\n\n| Interface | Source | Description |\n|-----------|--------|-------------|\n| `IPipeline` | `pipeline.types` | Pipeline with stages, active/default flags, tenant scoping |\n| `IPipelineStage` | `pipeline.types` | Single stage: name, color, order, isTerminal, isDefault |\n| `ICallLog` | `call-log.types` | Call log with contact ref, pipeline/stage, timeline, stage history, follow-up, channel, outcome, isFollowUp, soft delete |\n| `IContactRef` | `call-log.types` | Embedded contact reference: externalId, displayName, phone, email |\n| `IStageChange` | `call-log.types` | Stage transition record with from/to IDs, names, timestamps, time-in-stage |\n| `ITimelineEntry` | `call-log.types` | Single timeline entry: type, content, author, stage/agent change details |\n| `ICallLogSettings` | `settings.types` | Global settings: tags, categories, priority levels, follow-up defaults, availableChannels, availableOutcomes |\n| `IPriorityConfig` | `settings.types` | Priority level config: value, label, color, order |\n| `AgentInfo` | `adapter.types` | Agent reference: agentId, displayName, avatar, teamId |\n| `ContactInfo` | `adapter.types` | Contact lookup result: externalId, displayName, phone, email |\n| `AuthResult` | `adapter.types` | Authentication result: adminUserId, displayName, role (optional, for agent-scoping bypass) |\n| `CallLogEngineConfig` | `config.types` | Full engine configuration: db, logger, agents, adapters, hooks, options (includes enableAgentScoping) |\n| `ResolvedOptions` | `config.types` | Resolved options with defaults applied |\n| `CallLogMetric` | `analytics.types` | Metric event: name, labels, value |\n| `DateRange` | `analytics.types` | Date range filter: from, to |\n| `AgentCallStats` | `analytics.types` | Agent performance stats |\n| `PipelineStageStats` | `analytics.types` | Per-stage stats with avg time and conversion rate |\n| `PipelineReport` | `analytics.types` | Pipeline report with stage breakdown and bottleneck |\n| `PipelineFunnel` | `analytics.types` | Pipeline funnel with entered/exited/dropOff per stage |\n| `DailyReport` | `analytics.types` | Daily report by direction, pipeline, agent |\n| `OverallCallReport` | `analytics.types` | Overall stats: totals, avg close time, compliance, distributions |\n| `WeeklyTrend` | `analytics.types` | Weekly trend with direction and pipeline breakdown |\n| `DashboardStats` | `analytics.types` | Quick dashboard counters: open, closed today, overdue, agents |\n| `ExportFilter` | `analytics.types` | Export filter options |\n| `ExportFormat` | `analytics.types` | Export format type: `'json' \\| 'csv'` |\n| `ChannelDistribution` | `analytics.types` | Channel breakdown entry: `{ channel: string, count: number }` |\n| `OutcomeDistribution` | `analytics.types` | Outcome breakdown entry: `{ outcome: string, count: number }` |\n| `FollowUpStats` | `analytics.types` | Follow-up ratio stats: `{ followUpCalls: number, totalCalls: number, followUpRatio: number }` |\n\n## Phase 2 Fields\n\n### ICallLog\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `channel` | `string` | Communication channel for the call (phone, whatsapp, telegram, etc.) |\n| `outcome` | `string` | Result of the call (interested, not_interested, no_answer, etc.) |\n| `isFollowUp` | `boolean` | Marks the call as a follow-up rather than a fresh outreach |\n| `isDeleted` | `boolean` | Soft delete flag — excluded from all queries and analytics by default |\n| `deletedAt` | `Date?` | Timestamp set when the call is soft-deleted |\n\n### ICallLogSettings\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `availableChannels` | `string[]` | Admin-configurable list of channel options shown in the UI |\n| `availableOutcomes` | `string[]` | Admin-configurable list of outcome options shown in the UI |\n\n### CallLogEngineConfig options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `enableAgentScoping` | `boolean` | `true` | When true, non-owner staff see only their own calls; owners see everything |\n\n### AuthResult\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `role` | `string?` | Agent role returned by `authenticateAgent`. Owners are excluded from agent-scoped filtering when role indicates ownership. |\n\n## Usage\n\n```ts\nimport type { ICallLog, IPipeline, ITimelineEntry, CallLogEngineConfig } from '@astralibx/call-log-types';\nimport { CallDirection, CallPriority, TimelineEntryType } from '@astralibx/call-log-types';\n\n// Type a call log\nconst call: ICallLog = {\n  callLogId: '...',\n  pipelineId: '...',\n  currentStageId: '...',\n  contactRef: { externalId: 'c1', displayName: 'John Doe' },\n  direction: CallDirection.Inbound,\n  callDate: new Date(),\n  priority: CallPriority.High,\n  agentId: '...',\n  tags: ['vip'],\n  timeline: [],\n  stageHistory: [],\n  isClosed: false,\n  createdAt: new Date(),\n  updatedAt: new Date(),\n};\n```\n\n## Links\n\n- [GitHub](https://github.com/Hariprakash1997/astralib/tree/main/packages/call-log/call-log-types)\n- [CHANGELOG](https://github.com/Hariprakash1997/astralib/blob/main/packages/call-log/call-log-types/CHANGELOG.md)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}