@blendification/results 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.1
4
+
5
+ - `TrackedConversation`, the type of what `conversations()` yields, now has the fields the server sends: `conversationId`, `respondentName` and `respondentEmail`. 0.1.0 declared `id`, `name` and `email`, which were always undefined. The type also gains `abandoned`, `templateId` and the conversation's dates. It drops the catch-all index signature, so a misspelt field no longer compiles.
6
+ - `conversationPage()` returns a typed `ConversationPage`, and `status` accepts one status or a list.
7
+ - The README named the same wrong fields; it now names the real ones.
8
+
3
9
  ## 0.1.0
4
10
 
5
11
  First release.
package/README.md CHANGED
@@ -78,7 +78,7 @@ const results = createResultsClient({
78
78
  | Call | What it returns |
79
79
  | --- | --- |
80
80
  | `progress({ templateId?, inviteGroupName?, since? })` | Status counts, completion rate, and splits by invite group or template, read to the end and added up |
81
- | `conversations({ templateId?, inviteGroupName?, status?, since? })` | An async iterator over every conversation: id, status, name, email, invite group, link |
81
+ | `conversations({ templateId?, inviteGroupName?, status?, since? })` | An async iterator over every conversation: `conversationId`, `status`, `abandoned`, `respondentName`, `respondentEmail`, `inviteGroup`, `link`, and its dates (`startedAt`, `completedAt`) |
82
82
  | `transcript(conversationId, { resultsGroupId })` | Every message, oldest first |
83
83
  | `summary(resultsGroupId)` | A results group's name, counts, topics and reports |
84
84
  | `exportGroup(resultsGroupId, { format: 'csv' })` | Starts an export, waits for it, and returns download links plus the first page |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blendification/results",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Read Blendification results (survey progress, conversations, transcripts, exports) from your own page or server, signed in with Blendification's OAuth, and verify the webhooks it sends.",
5
5
  "license": "MIT",
6
6
  "author": "Blendification",
package/types/index.d.ts CHANGED
@@ -106,14 +106,44 @@ export interface ScopeArgs {
106
106
  since?: string;
107
107
  }
108
108
 
109
+ export type ConversationStatus = 'not started' | 'started' | 'complete';
110
+
111
+ /**
112
+ * One conversation, as conversations() yields it and conversationPage() lists
113
+ * it (the list_template_conversations tool). A drift test in
114
+ * services/analysis-engine pins these names to the rows the server builds.
115
+ */
109
116
  export interface TrackedConversation {
110
- id: string;
111
- status: string;
112
- name?: string | null;
113
- email?: string | null;
114
- inviteGroup?: string | null;
115
- link?: string | null;
116
- [key: string]: unknown;
117
+ conversationId: string;
118
+ /** 'not started', 'started' or 'complete'. */
119
+ status: string | null;
120
+ /** Started, then left without completing. */
121
+ abandoned: boolean;
122
+ /** Null for an anonymous conversation. */
123
+ respondentName: string | null;
124
+ /** Lower-cased. Null for an anonymous conversation. */
125
+ respondentEmail: string | null;
126
+ inviteGroup: string | null;
127
+ templateId: string | null;
128
+ interviewDate: string | null;
129
+ createdAt: string | null;
130
+ startedAt: string | null;
131
+ completedAt: string | null;
132
+ /** The participant's link: the template's hosted page when it names one, else the app's page. */
133
+ link: string | null;
134
+ }
135
+
136
+ /** One page of list_template_conversations. */
137
+ export interface ConversationPage {
138
+ templateId: string | null;
139
+ templateName: string | null;
140
+ inviteGroupName: string | null;
141
+ status: ConversationStatus[] | null;
142
+ since: string | null;
143
+ returned: number;
144
+ conversations: TrackedConversation[];
145
+ nextToken: string | null;
146
+ message: string;
117
147
  }
118
148
 
119
149
  export interface ResultsClient {
@@ -122,8 +152,8 @@ export interface ResultsClient {
122
152
  call<T = any>(tool: string, args?: Record<string, unknown>): Promise<T>;
123
153
  listTools(): Promise<Array<{ name: string; description: string; inputSchema: object }>>;
124
154
  progress(args: ScopeArgs): Promise<Progress>;
125
- conversationPage(args: ScopeArgs & { status?: string[]; limit?: number; nextToken?: string }): Promise<any>;
126
- conversations(args: ScopeArgs & { status?: string[]; limit?: number }): AsyncGenerator<TrackedConversation>;
155
+ conversationPage(args: ScopeArgs & { status?: ConversationStatus | ConversationStatus[]; limit?: number; nextToken?: string }): Promise<ConversationPage>;
156
+ conversations(args: ScopeArgs & { status?: ConversationStatus | ConversationStatus[]; limit?: number }): AsyncGenerator<TrackedConversation>;
127
157
  transcript(conversationId: string, opts: { resultsGroupId: string; limit?: number }): Promise<{ conversationId: string; messages: any[]; complete: boolean }>;
128
158
  waitForJob(jobId: string, opts?: { intervalMs?: number; timeoutMs?: number; onUpdate?: (status: any) => void }): Promise<any>;
129
159
  exportGroup(resultsGroupId: string, opts?: { format?: 'json' | 'csv'; conversationIds?: string[]; includeMessages?: boolean; includeFeatures?: boolean; waitMs?: number }): Promise<any>;