@elmohq/sdk 0.1.1 → 0.1.3
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/dist/calls/index.d.mts +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{request-options-B9S9d24M.d.mts → request-options--nBUndY9.d.mts} +8 -8
- package/dist/{request-options-B9S9d24M.d.mts.map → request-options--nBUndY9.d.mts.map} +1 -1
- package/dist/tools-B1lVtYAr.mjs.map +1 -1
- package/dist/{tools-7Hs5J2xb.d.mts → tools-Bfx2x86E.d.mts} +215 -40
- package/dist/tools-Bfx2x86E.d.mts.map +1 -0
- package/dist/types/index.d.mts +2 -2
- package/package.json +1 -1
- package/src/client.ts +4 -1
- package/src/resources/analytics.ts +4 -0
- package/src/resources/brands.ts +4 -0
- package/src/resources/prompts.ts +4 -0
- package/src/resources/runs.ts +4 -0
- package/src/types/analytics.ts +86 -28
- package/src/types/index.ts +5 -0
- package/src/types/runs.ts +71 -5
- package/src/types/shared/model-filter.ts +7 -5
- package/src/types/shared/position.ts +51 -0
- package/src/types/snapshots.ts +3 -0
- package/dist/tools-7Hs5J2xb.d.mts.map +0 -1
package/src/types/analytics.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
} from './shared/error';
|
|
7
7
|
import type { ModelFilter, WindowEnd, WindowStart } from './shared/model-filter';
|
|
8
8
|
import type { NotFoundError } from './shared/not-found-error';
|
|
9
|
+
import type { Position, SentimentSummary } from './shared/position';
|
|
9
10
|
import type { ValidationError } from './shared/validation-error';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -36,8 +37,10 @@ export type ShareOfVoiceEntry = {
|
|
|
36
37
|
mentions: number;
|
|
37
38
|
/** Brand or competitor name. */
|
|
38
39
|
name: string;
|
|
40
|
+
position: Position;
|
|
39
41
|
/** Distinct prompts this entity appeared in. */
|
|
40
42
|
prompts: number;
|
|
43
|
+
sentiment: SentimentSummary;
|
|
41
44
|
/**
|
|
42
45
|
* This entity's share of all brand and competitor mentions. Ratio 0–1; multiply by 100 for a
|
|
43
46
|
* percentage.
|
|
@@ -211,7 +214,9 @@ export type PromptPerformance = {
|
|
|
211
214
|
competitorMentionRate: number;
|
|
212
215
|
firstEvaluatedAt: Date | null;
|
|
213
216
|
lastRunAt: Date | null;
|
|
217
|
+
position: Position;
|
|
214
218
|
promptId: string;
|
|
219
|
+
sentiment: SentimentSummary;
|
|
215
220
|
tags: Array<string>;
|
|
216
221
|
totalRuns: number;
|
|
217
222
|
value: string;
|
|
@@ -229,7 +234,9 @@ export type ModelVisibility = {
|
|
|
229
234
|
citations: number;
|
|
230
235
|
label: string;
|
|
231
236
|
model: string;
|
|
237
|
+
position: Position;
|
|
232
238
|
runs: number;
|
|
239
|
+
sentiment: SentimentSummary;
|
|
233
240
|
/**
|
|
234
241
|
* Share of this model's runs that mentioned the brand. Ratio 0–1; multiply by 100 for a
|
|
235
242
|
* percentage.
|
|
@@ -242,16 +249,17 @@ export type ModelVisibility = {
|
|
|
242
249
|
|
|
243
250
|
/**
|
|
244
251
|
* Every non-paginated figure for a brand over one window. There is no parameter for selecting a
|
|
245
|
-
* subset: the
|
|
246
|
-
*
|
|
247
|
-
* about.
|
|
252
|
+
* subset: the computations behind this cover the same prompts and run concurrently, so a subset
|
|
253
|
+
* would save a caller a fraction of one request and cost everyone a parameter to reason about.
|
|
248
254
|
*/
|
|
249
255
|
export type BrandAnalytics = {
|
|
250
256
|
brandId: string;
|
|
251
257
|
brandName: string;
|
|
252
258
|
/** Per-model visibility and run counts. Only models that produced a run in the window appear. */
|
|
253
259
|
models: Array<ModelVisibility>;
|
|
260
|
+
position: BrandPosition;
|
|
254
261
|
range: DateRange;
|
|
262
|
+
sentiment: BrandSentiment;
|
|
255
263
|
/** The brand against its tracked competitors. */
|
|
256
264
|
shareOfVoice: {
|
|
257
265
|
/**
|
|
@@ -288,6 +296,46 @@ export type BrandAnalytics = {
|
|
|
288
296
|
};
|
|
289
297
|
};
|
|
290
298
|
|
|
299
|
+
/**
|
|
300
|
+
* **Experimental — the shape may still change.**
|
|
301
|
+
*
|
|
302
|
+
* The brand's sentiment over the window, with the counts for each day so a client can chart or
|
|
303
|
+
* smooth them.
|
|
304
|
+
*/
|
|
305
|
+
export type BrandSentiment = SentimentSummary & {
|
|
306
|
+
series: Array<{
|
|
307
|
+
date: string;
|
|
308
|
+
/** @minimum 0 */
|
|
309
|
+
mixed: number;
|
|
310
|
+
/** @minimum 0 */
|
|
311
|
+
negative: number;
|
|
312
|
+
/** @minimum 0 */
|
|
313
|
+
neutral: number;
|
|
314
|
+
/** @minimum 0 */
|
|
315
|
+
positive: number;
|
|
316
|
+
}>;
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* **Experimental — the shape may still change.**
|
|
321
|
+
*
|
|
322
|
+
* The brand's position among the tracked companies the answers name, 1 being named first, averaged
|
|
323
|
+
* over the window and per day.
|
|
324
|
+
*/
|
|
325
|
+
export type BrandPosition = {
|
|
326
|
+
/**
|
|
327
|
+
* Average position over the window, to one decimal; null when no answer ranks it.
|
|
328
|
+
*
|
|
329
|
+
* @minimum 1
|
|
330
|
+
*/
|
|
331
|
+
average: number | null;
|
|
332
|
+
series: Array<{
|
|
333
|
+
/** @minimum 1 */
|
|
334
|
+
average: number | null;
|
|
335
|
+
date: string;
|
|
336
|
+
}>;
|
|
337
|
+
};
|
|
338
|
+
|
|
291
339
|
/** Comma-separated prompt tags. Only prompts carrying at least one of them are counted. */
|
|
292
340
|
export type TagsFilter = string;
|
|
293
341
|
|
|
@@ -408,14 +456,16 @@ export type GetBrandQueryFanoutResponses = {
|
|
|
408
456
|
|
|
409
457
|
export type GetBrandAnalyticsParams = {
|
|
410
458
|
/**
|
|
411
|
-
* Inclusive lower bound of the window, an ISO 8601 timestamp such as `2026-01-01T00:00:00Z`.
|
|
412
|
-
*
|
|
413
|
-
*
|
|
459
|
+
* Inclusive lower bound of the window, an ISO 8601 timestamp such as `2026-01-01T00:00:00Z`.
|
|
460
|
+
* Aligned down to the quarter hour, the grain analytics are aggregated at; where a response
|
|
461
|
+
* repeats the window, it repeats the aligned one. A bare `YYYY-MM-DD` is rejected: that is
|
|
462
|
+
* `/prompts/{promptId}/snapshot`'s spelling and means a local calendar day there.
|
|
414
463
|
*/
|
|
415
464
|
start: WindowStart;
|
|
416
465
|
/**
|
|
417
|
-
* Exclusive upper bound of the window, an ISO 8601 timestamp
|
|
418
|
-
* exactly `end` is outside it.
|
|
466
|
+
* Exclusive upper bound of the window, an ISO 8601 timestamp, also aligned down to the quarter
|
|
467
|
+
* hour. The window is half-open: a run at exactly `end` is outside it. `start` and `end` inside
|
|
468
|
+
* one quarter-hour bucket leave an empty window and are rejected.
|
|
419
469
|
*/
|
|
420
470
|
end: WindowEnd;
|
|
421
471
|
/** Restrict to one model, e.g. `chatgpt`. See `models.list()`. */
|
|
@@ -426,14 +476,16 @@ export type GetBrandAnalyticsParams = {
|
|
|
426
476
|
|
|
427
477
|
export type ListBrandCitationDomainsParams = {
|
|
428
478
|
/**
|
|
429
|
-
* Inclusive lower bound of the window, an ISO 8601 timestamp such as `2026-01-01T00:00:00Z`.
|
|
430
|
-
*
|
|
431
|
-
*
|
|
479
|
+
* Inclusive lower bound of the window, an ISO 8601 timestamp such as `2026-01-01T00:00:00Z`.
|
|
480
|
+
* Aligned down to the quarter hour, the grain analytics are aggregated at; where a response
|
|
481
|
+
* repeats the window, it repeats the aligned one. A bare `YYYY-MM-DD` is rejected: that is
|
|
482
|
+
* `/prompts/{promptId}/snapshot`'s spelling and means a local calendar day there.
|
|
432
483
|
*/
|
|
433
484
|
start: WindowStart;
|
|
434
485
|
/**
|
|
435
|
-
* Exclusive upper bound of the window, an ISO 8601 timestamp
|
|
436
|
-
* exactly `end` is outside it.
|
|
486
|
+
* Exclusive upper bound of the window, an ISO 8601 timestamp, also aligned down to the quarter
|
|
487
|
+
* hour. The window is half-open: a run at exactly `end` is outside it. `start` and `end` inside
|
|
488
|
+
* one quarter-hour bucket leave an empty window and are rejected.
|
|
437
489
|
*/
|
|
438
490
|
end: WindowEnd;
|
|
439
491
|
/** Restrict to one model, e.g. `chatgpt`. See `models.list()`. */
|
|
@@ -444,14 +496,16 @@ export type ListBrandCitationDomainsParams = {
|
|
|
444
496
|
|
|
445
497
|
export type ListBrandCitationURLsParams = {
|
|
446
498
|
/**
|
|
447
|
-
* Inclusive lower bound of the window, an ISO 8601 timestamp such as `2026-01-01T00:00:00Z`.
|
|
448
|
-
*
|
|
449
|
-
*
|
|
499
|
+
* Inclusive lower bound of the window, an ISO 8601 timestamp such as `2026-01-01T00:00:00Z`.
|
|
500
|
+
* Aligned down to the quarter hour, the grain analytics are aggregated at; where a response
|
|
501
|
+
* repeats the window, it repeats the aligned one. A bare `YYYY-MM-DD` is rejected: that is
|
|
502
|
+
* `/prompts/{promptId}/snapshot`'s spelling and means a local calendar day there.
|
|
450
503
|
*/
|
|
451
504
|
start: WindowStart;
|
|
452
505
|
/**
|
|
453
|
-
* Exclusive upper bound of the window, an ISO 8601 timestamp
|
|
454
|
-
* exactly `end` is outside it.
|
|
506
|
+
* Exclusive upper bound of the window, an ISO 8601 timestamp, also aligned down to the quarter
|
|
507
|
+
* hour. The window is half-open: a run at exactly `end` is outside it. `start` and `end` inside
|
|
508
|
+
* one quarter-hour bucket leave an empty window and are rejected.
|
|
455
509
|
*/
|
|
456
510
|
end: WindowEnd;
|
|
457
511
|
/** Restrict to one model, e.g. `chatgpt`. See `models.list()`. */
|
|
@@ -462,14 +516,16 @@ export type ListBrandCitationURLsParams = {
|
|
|
462
516
|
|
|
463
517
|
export type ListBrandPromptPerformanceParams = {
|
|
464
518
|
/**
|
|
465
|
-
* Inclusive lower bound of the window, an ISO 8601 timestamp such as `2026-01-01T00:00:00Z`.
|
|
466
|
-
*
|
|
467
|
-
*
|
|
519
|
+
* Inclusive lower bound of the window, an ISO 8601 timestamp such as `2026-01-01T00:00:00Z`.
|
|
520
|
+
* Aligned down to the quarter hour, the grain analytics are aggregated at; where a response
|
|
521
|
+
* repeats the window, it repeats the aligned one. A bare `YYYY-MM-DD` is rejected: that is
|
|
522
|
+
* `/prompts/{promptId}/snapshot`'s spelling and means a local calendar day there.
|
|
468
523
|
*/
|
|
469
524
|
start: WindowStart;
|
|
470
525
|
/**
|
|
471
|
-
* Exclusive upper bound of the window, an ISO 8601 timestamp
|
|
472
|
-
* exactly `end` is outside it.
|
|
526
|
+
* Exclusive upper bound of the window, an ISO 8601 timestamp, also aligned down to the quarter
|
|
527
|
+
* hour. The window is half-open: a run at exactly `end` is outside it. `start` and `end` inside
|
|
528
|
+
* one quarter-hour bucket leave an empty window and are rejected.
|
|
473
529
|
*/
|
|
474
530
|
end: WindowEnd;
|
|
475
531
|
/** Restrict to one model, e.g. `chatgpt`. See `models.list()`. */
|
|
@@ -480,14 +536,16 @@ export type ListBrandPromptPerformanceParams = {
|
|
|
480
536
|
|
|
481
537
|
export type GetBrandQueryFanoutParams = {
|
|
482
538
|
/**
|
|
483
|
-
* Inclusive lower bound of the window, an ISO 8601 timestamp such as `2026-01-01T00:00:00Z`.
|
|
484
|
-
*
|
|
485
|
-
*
|
|
539
|
+
* Inclusive lower bound of the window, an ISO 8601 timestamp such as `2026-01-01T00:00:00Z`.
|
|
540
|
+
* Aligned down to the quarter hour, the grain analytics are aggregated at; where a response
|
|
541
|
+
* repeats the window, it repeats the aligned one. A bare `YYYY-MM-DD` is rejected: that is
|
|
542
|
+
* `/prompts/{promptId}/snapshot`'s spelling and means a local calendar day there.
|
|
486
543
|
*/
|
|
487
544
|
start: WindowStart;
|
|
488
545
|
/**
|
|
489
|
-
* Exclusive upper bound of the window, an ISO 8601 timestamp
|
|
490
|
-
* exactly `end` is outside it.
|
|
546
|
+
* Exclusive upper bound of the window, an ISO 8601 timestamp, also aligned down to the quarter
|
|
547
|
+
* hour. The window is half-open: a run at exactly `end` is outside it. `start` and `end` inside
|
|
548
|
+
* one quarter-hour bucket leave an empty window and are rejected.
|
|
491
549
|
*/
|
|
492
550
|
end: WindowEnd;
|
|
493
551
|
/** Restrict to one model, e.g. `chatgpt`. See `models.list()`. */
|
package/src/types/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export type {
|
|
2
2
|
BrandAnalytics,
|
|
3
|
+
BrandPosition,
|
|
3
4
|
BrandQueryFanout,
|
|
5
|
+
BrandSentiment,
|
|
4
6
|
CitationDomain,
|
|
5
7
|
CitationDomainList,
|
|
6
8
|
CitationURL,
|
|
@@ -126,7 +128,9 @@ export type {
|
|
|
126
128
|
ListPromptRunsErrors,
|
|
127
129
|
ListPromptRunsParams,
|
|
128
130
|
ListPromptRunsResponses,
|
|
131
|
+
MentionAssessment,
|
|
129
132
|
Run,
|
|
133
|
+
RunAssessments,
|
|
130
134
|
RunCitation,
|
|
131
135
|
RunList,
|
|
132
136
|
RunSummary,
|
|
@@ -146,6 +150,7 @@ export type { ModelFilter, WindowEnd, WindowStart } from './shared/model-filter'
|
|
|
146
150
|
export type { NotFoundError } from './shared/not-found-error';
|
|
147
151
|
export type { Page } from './shared/page';
|
|
148
152
|
export type { Pagination } from './shared/pagination';
|
|
153
|
+
export type { Position, SentimentSummary } from './shared/position';
|
|
149
154
|
export type { ValidationError } from './shared/validation-error';
|
|
150
155
|
export type {
|
|
151
156
|
CitedURLEntry,
|
package/src/types/runs.ts
CHANGED
|
@@ -13,6 +13,7 @@ import type { ValidationError } from './shared/validation-error';
|
|
|
13
13
|
|
|
14
14
|
/** A single model answer, without its text. Fetch `prompts.runs.get()` for the answer itself. */
|
|
15
15
|
export type RunSummary = {
|
|
16
|
+
assessments: RunAssessments;
|
|
16
17
|
brandId: string;
|
|
17
18
|
brandMentioned: boolean;
|
|
18
19
|
citationCount: number;
|
|
@@ -53,6 +54,69 @@ export type RunList = {
|
|
|
53
54
|
pagination: Pagination;
|
|
54
55
|
};
|
|
55
56
|
|
|
57
|
+
/**
|
|
58
|
+
* **Experimental — the shape may still change.**
|
|
59
|
+
*
|
|
60
|
+
* The mention judge's assessment of one brand or competitor named in an answer.
|
|
61
|
+
*/
|
|
62
|
+
export type MentionAssessment = {
|
|
63
|
+
/**
|
|
64
|
+
* How many times the answer mentions it. Null when the answer isn't counted as mentioning it.
|
|
65
|
+
*
|
|
66
|
+
* @minimum 1
|
|
67
|
+
*/
|
|
68
|
+
mentionCount: number | null;
|
|
69
|
+
/**
|
|
70
|
+
* Whether the answer counts as mentioning this company. A name the judge can't call either way
|
|
71
|
+
* counts.
|
|
72
|
+
*/
|
|
73
|
+
mentioned: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* 1 for the tracked company the answer names first, 2 for the next, and so on. Null when the
|
|
76
|
+
* answer isn't counted as mentioning it.
|
|
77
|
+
*
|
|
78
|
+
* @minimum 1
|
|
79
|
+
*/
|
|
80
|
+
position: number | null;
|
|
81
|
+
/**
|
|
82
|
+
* Calibrated probability that the answer mentions this company.
|
|
83
|
+
*
|
|
84
|
+
* @minimum 0
|
|
85
|
+
* @maximum 1
|
|
86
|
+
*/
|
|
87
|
+
probability: number;
|
|
88
|
+
/**
|
|
89
|
+
* When it isn't counted as a mention, the likeliest other reading: `other_meaning` (the name used
|
|
90
|
+
* as an ordinary word), `other_company` (a different company with the same name) or `no_info`
|
|
91
|
+
* (the answer says it knows nothing about it). Informational; not a stable enum.
|
|
92
|
+
*/
|
|
93
|
+
reason: string | null;
|
|
94
|
+
/**
|
|
95
|
+
* The likeliest sentiment toward this company in the passages about it. Null when the answer
|
|
96
|
+
* isn't about it, or when it only links to the company.
|
|
97
|
+
*/
|
|
98
|
+
sentiment: 'positive' | 'neutral' | 'negative' | 'mixed' | null;
|
|
99
|
+
/** Probability of each sentiment, keyed by label. */
|
|
100
|
+
sentimentProbabilities: {
|
|
101
|
+
[key: string]: number;
|
|
102
|
+
} | null;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* **Experimental — the shape may still change.**
|
|
107
|
+
*
|
|
108
|
+
* The mention judge's assessments for one answer. Null when the run's mentions were matched by
|
|
109
|
+
* name, before the judge, until a replay judges it.
|
|
110
|
+
*/
|
|
111
|
+
export type RunAssessments = {
|
|
112
|
+
/** Null when the answer never names the brand. */
|
|
113
|
+
brand: MentionAssessment | null;
|
|
114
|
+
/** Keyed by competitor name; only competitors the answer names. */
|
|
115
|
+
competitors: {
|
|
116
|
+
[key: string]: MentionAssessment;
|
|
117
|
+
};
|
|
118
|
+
} | null;
|
|
119
|
+
|
|
56
120
|
export type ListPromptRunsErrors = {
|
|
57
121
|
/** Invalid request data */
|
|
58
122
|
400: ValidationError;
|
|
@@ -101,14 +165,16 @@ export type GetRunResponses = {
|
|
|
101
165
|
|
|
102
166
|
export type ListPromptRunsParams = {
|
|
103
167
|
/**
|
|
104
|
-
* Inclusive lower bound of the window, an ISO 8601 timestamp such as `2026-01-01T00:00:00Z`.
|
|
105
|
-
*
|
|
106
|
-
*
|
|
168
|
+
* Inclusive lower bound of the window, an ISO 8601 timestamp such as `2026-01-01T00:00:00Z`.
|
|
169
|
+
* Aligned down to the quarter hour, the grain analytics are aggregated at; where a response
|
|
170
|
+
* repeats the window, it repeats the aligned one. A bare `YYYY-MM-DD` is rejected: that is
|
|
171
|
+
* `/prompts/{promptId}/snapshot`'s spelling and means a local calendar day there.
|
|
107
172
|
*/
|
|
108
173
|
start: WindowStart;
|
|
109
174
|
/**
|
|
110
|
-
* Exclusive upper bound of the window, an ISO 8601 timestamp
|
|
111
|
-
* exactly `end` is outside it.
|
|
175
|
+
* Exclusive upper bound of the window, an ISO 8601 timestamp, also aligned down to the quarter
|
|
176
|
+
* hour. The window is half-open: a run at exactly `end` is outside it. `start` and `end` inside
|
|
177
|
+
* one quarter-hour bucket leave an empty window and are rejected.
|
|
112
178
|
*/
|
|
113
179
|
end: WindowEnd;
|
|
114
180
|
/** Restrict to one model, e.g. `chatgpt`. See `models.list()`. */
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Inclusive lower bound of the window, an ISO 8601 timestamp such as `2026-01-01T00:00:00Z`.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Inclusive lower bound of the window, an ISO 8601 timestamp such as `2026-01-01T00:00:00Z`.
|
|
3
|
+
* Aligned down to the quarter hour, the grain analytics are aggregated at; where a response repeats
|
|
4
|
+
* the window, it repeats the aligned one. A bare `YYYY-MM-DD` is rejected: that is
|
|
5
|
+
* `/prompts/{promptId}/snapshot`'s spelling and means a local calendar day there.
|
|
5
6
|
*/
|
|
6
7
|
export type WindowStart = Date;
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
|
-
* Exclusive upper bound of the window, an ISO 8601 timestamp
|
|
10
|
-
* exactly `end` is outside it.
|
|
10
|
+
* Exclusive upper bound of the window, an ISO 8601 timestamp, also aligned down to the quarter
|
|
11
|
+
* hour. The window is half-open: a run at exactly `end` is outside it. `start` and `end` inside one
|
|
12
|
+
* quarter-hour bucket leave an empty window and are rejected.
|
|
11
13
|
*/
|
|
12
14
|
export type WindowEnd = Date;
|
|
13
15
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **Experimental — the shape may still change.**
|
|
3
|
+
*
|
|
4
|
+
* The company's position among the tracked companies the answers name, 1 being named first.
|
|
5
|
+
* Companies that aren't tracked aren't ranked. Counted over every answer in the window, unlike
|
|
6
|
+
* `visibility.current` and the share-of-voice `mentions` and `share`, which count each prompt's
|
|
7
|
+
* latest result.
|
|
8
|
+
*/
|
|
9
|
+
export type Position = {
|
|
10
|
+
/**
|
|
11
|
+
* Average position to one decimal; null when no answer ranks it.
|
|
12
|
+
*
|
|
13
|
+
* @minimum 1
|
|
14
|
+
*/
|
|
15
|
+
average: number | null;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* **Experimental — the shape may still change.**
|
|
20
|
+
*
|
|
21
|
+
* Answers that mention the company, by the mention judge's sentiment toward it. An answer that only
|
|
22
|
+
* links to the company counts in none. All zero for history the judge hasn't re-judged yet. Counted
|
|
23
|
+
* over every answer in the window, unlike `visibility.current` and the share-of-voice `mentions`
|
|
24
|
+
* and `share`, which count each prompt's latest result.
|
|
25
|
+
*/
|
|
26
|
+
export type SentimentSummary = {
|
|
27
|
+
/** @minimum 0 */
|
|
28
|
+
mixed: number;
|
|
29
|
+
/** @minimum 0 */
|
|
30
|
+
negative: number;
|
|
31
|
+
/**
|
|
32
|
+
* Negative answers as a fraction of those with a sentiment (the four counts). Ratio 0–1; null
|
|
33
|
+
* when there are none.
|
|
34
|
+
*
|
|
35
|
+
* @minimum 0
|
|
36
|
+
* @maximum 1
|
|
37
|
+
*/
|
|
38
|
+
negativeShare: number | null;
|
|
39
|
+
/** @minimum 0 */
|
|
40
|
+
neutral: number;
|
|
41
|
+
/** @minimum 0 */
|
|
42
|
+
positive: number;
|
|
43
|
+
/**
|
|
44
|
+
* Positive answers as a fraction of those with a sentiment (the four counts). Ratio 0–1; null
|
|
45
|
+
* when there are none.
|
|
46
|
+
*
|
|
47
|
+
* @minimum 0
|
|
48
|
+
* @maximum 1
|
|
49
|
+
*/
|
|
50
|
+
positiveShare: number | null;
|
|
51
|
+
};
|
package/src/types/snapshots.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
} from './shared/error';
|
|
7
7
|
import type { MentionsSummary } from './shared/mention-entry';
|
|
8
8
|
import type { NotFoundError } from './shared/not-found-error';
|
|
9
|
+
import type { Position, SentimentSummary } from './shared/position';
|
|
9
10
|
import type { ValidationError } from './shared/validation-error';
|
|
10
11
|
|
|
11
12
|
export type CitedURLEntry = {
|
|
@@ -33,10 +34,12 @@ export type PromptSnapshot = {
|
|
|
33
34
|
/** End of the queried date range (YYYY-MM-DD) */
|
|
34
35
|
endDate: string;
|
|
35
36
|
mentions: MentionsSummary;
|
|
37
|
+
position: Position;
|
|
36
38
|
/** Unique identifier for the prompt */
|
|
37
39
|
promptId: string;
|
|
38
40
|
/** The prompt text */
|
|
39
41
|
promptValue: string;
|
|
42
|
+
sentiment: SentimentSummary;
|
|
40
43
|
/** Start of the queried date range (YYYY-MM-DD) */
|
|
41
44
|
startDate: string;
|
|
42
45
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools-7Hs5J2xb.d.mts","names":[],"sources":["../src/types/shared/error.ts","../src/types/shared/model-filter.ts","../src/types/shared/not-found-error.ts","../src/types/shared/validation-error.ts","../src/types/analytics.ts","../src/types/shared/brand-id-path.ts","../src/types/opportunities.ts","../src/types/tags.ts","../src/types/shared/conflict-error.ts","../src/types/shared/limit.ts","../src/types/shared/page.ts","../src/types/shared/pagination.ts","../src/types/brands.ts","../src/types/competitors.ts","../src/types/identity.ts","../src/types/models.ts","../src/types/organizations.ts","../src/types/runs.ts","../src/types/shared/mention-entry.ts","../src/types/snapshots.ts","../src/types/prompts.ts","../src/types/reports.ts","../src/types/tools.ts"],"mappings":";KAAY;;;;;;;;;EASV;;EAEA;;EAEA;;;KAIU,oBAAoB;KAEpB,sBAAsB;;;;;KAMtB,iBAAiB;;KAGjB,iBAAiB;;;;;;;;KCvBjB,cAAc;;;;;KAMd,YAAY;;KAGZ;;;;KCXA,gBAAgB;;;;KCAhB,kBAAkB;;;;;;KCUlB;;EAEV,KAAK;;EAEL,OAAO;;KAGG;EACV;;;;;;;;EAQA;;KAGU;;EAEV;EACA;;EAEA;;EAEA;;;;;;;;EAQA;;KAGU;EACV;;;;;;;;EAQA;;KAGU;;EAEV;;;;;;;;;EAoBA;;EAEA;EACA;;EAEA;;EAEA;;;;;;;EAOA;;KAGU;EACV;;EAEA,MAAM,MAAM;EACZ,OAAO;EACP;IACE;IACA;IACA;;;KAIQ;;EAEV;EAYA;EACA;;EAEA;;EAEA;EAeA;EACA;EACA;;KAGU;EACV;;EAEA,MAAM,MAAM;EACZ,OAAO;EACP;IACE;IACA;IACA;;;KAIQ;EACV;;EAEA;EACA;;KAGU;EACV;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