repzo 1.0.292 → 1.0.293
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 +28 -0
- package/lib/index.d.ts +244 -2
- package/lib/index.js +541 -0
- package/lib/types/index.d.ts +4530 -1
- package/package.json +1 -1
- package/src/index.ts +1270 -0
- package/src/oas/activity-ai-object-detection-session-frame.yaml +600 -0
- package/src/oas/ai-object-detection-assigned-missions.yaml +283 -0
- package/src/oas/ai-object-detection-assignment-rule.yaml +357 -0
- package/src/oas/ai-object-detection-category.yaml +338 -0
- package/src/oas/ai-object-detection-dataset.yaml +342 -0
- package/src/oas/ai-object-detection-detection-settings.yaml +410 -0
- package/src/oas/ai-object-detection-inference.yaml +818 -0
- package/src/oas/ai-object-detection-label-group.yaml +265 -0
- package/src/oas/ai-object-detection-label-report.yaml +366 -0
- package/src/oas/ai-object-detection-label.yaml +395 -0
- package/src/oas/ai-object-detection-metric-result.yaml +734 -0
- package/src/oas/ai-object-detection-metric.yaml +559 -0
- package/src/oas/ai-object-detection-mission-results.yaml +370 -0
- package/src/oas/ai-object-detection-mission-set.yaml +250 -0
- package/src/oas/ai-object-detection-mission.yaml +349 -0
- package/src/oas/ai-object-detection-model-version-epoch.yaml +214 -0
- package/src/oas/ai-object-detection-model-version-train-agent.yaml +88 -0
- package/src/oas/ai-object-detection-model-version.yaml +567 -0
- package/src/oas/ai-object-detection-model.yaml +369 -0
- package/src/oas/ai-object-detection-segment.yaml +301 -0
- package/src/oas/ai-object-detection-session-analysis.yaml +1306 -0
- package/src/oas/ai-object-detection-session-election.yaml +193 -0
- package/src/oas/ai-object-detection-session-insight.yaml +418 -0
- package/src/oas/ai-object-detection-session.yaml +840 -0
- package/src/oas/ai-object-detection-settings.yaml +249 -0
- package/src/oas/ai-object-detection-task.yaml +1007 -0
- package/src/oas/object-detection-analytics-report.yaml +674 -0
- package/src/types/index.ts +5156 -1
|
@@ -0,0 +1,674 @@
|
|
|
1
|
+
openapi: 3.0.3
|
|
2
|
+
info:
|
|
3
|
+
title: Repzo API - Object Detection Analytics Report
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
description: |
|
|
6
|
+
**Detection analytics** — the V2 report over metric results
|
|
7
|
+
(`ai.objectDetectionMetricResults`). One endpoint, TWO views selected by
|
|
8
|
+
`body.view`:
|
|
9
|
+
|
|
10
|
+
- `metrics` (default) — one row per METRIC RESULT: the effective answer
|
|
11
|
+
(human override wins) and the 0..1 score are the core data, joined with
|
|
12
|
+
the scanned session's client, channel and rep, and the mission the
|
|
13
|
+
session was started from (when any).
|
|
14
|
+
- `segments` — one row per UNWOUND SegmentOutput of share-of-shelf
|
|
15
|
+
results; every metric-level field rides along and the SEGMENT's share
|
|
16
|
+
is the core. The competitive read: filter segment "American Garden" +
|
|
17
|
+
channels A and B, group by `channel` → its share per channel; group by
|
|
18
|
+
`channel` + `month` over the last two months → how it moved.
|
|
19
|
+
|
|
20
|
+
**V2 body** (`POST`): `anyOf[0].criteria[]` filters (`time` between ms or
|
|
21
|
+
presets; `metric`/`type`/`output`/`flag`/`client`/`channel`/`rep`/`team`/
|
|
22
|
+
`mission`/`segment` with in/nin/eq/ne — `mission` matches the mission the
|
|
23
|
+
session was STARTED FROM, so it narrows to mission-driven sessions;
|
|
24
|
+
LABEL filters `label`/`label_group`/`product_brand`/`product_category`
|
|
25
|
+
match rows whose metric INVOLVES the labels — named directly or resolved
|
|
26
|
+
through the label's product-side attributes, each key AND-ing
|
|
27
|
+
independently; `business_day`/`month`/`week` bucket values set the time
|
|
28
|
+
range), `group[]` (`{ _id: <key> }`), `projection`, `columns` override,
|
|
29
|
+
`options { limit, page, sort, totals_summary }`. Only the FIRST `anyOf`
|
|
30
|
+
group is read. Every read is TIME-BOUNDED (default: last 30 days).
|
|
31
|
+
Filter, column and sort definitions live in the shared report metadata
|
|
32
|
+
under the types `object-detection-metrics` / `object-detection-segments`
|
|
33
|
+
— seeded by `src/scripts/migrate-object-detection-analytics-data.js`
|
|
34
|
+
(rerun-safe).
|
|
35
|
+
|
|
36
|
+
**Query params ride along.** The same filter keys are accepted as query
|
|
37
|
+
params on both GET and POST (that is how a grouped row's `drilldown` is
|
|
38
|
+
spread back), plus `from_time` / `to_time`, `sortBy`, `export` and
|
|
39
|
+
`emailSubject`. `per_page` / `page` on the query string are NOT honoured
|
|
40
|
+
— paging comes from `options.limit` / `options.page` (the GET adapter
|
|
41
|
+
therefore always uses the default page size).
|
|
42
|
+
|
|
43
|
+
**Grouping & drilldown.** Group keys: metric, type, output, client,
|
|
44
|
+
channel, rep, mission, business_day, week, month (+ segment on the
|
|
45
|
+
segments view; type/output are metrics-view only). Grouped rows return
|
|
46
|
+
`row_count`, `avg_score`, `avg_answer` (+ `avg_ratio` — the average share
|
|
47
|
+
— and `main_rows` on segments; `flagged` on metrics) and a `drilldown`
|
|
48
|
+
object holding ONLY filter-compatible ID/bucket values; spreading it as
|
|
49
|
+
query params on the next call yields the detail rows.
|
|
50
|
+
|
|
51
|
+
Export: `?export=excel` schedules the email/Excel flow and returns an
|
|
52
|
+
acknowledgement instead of rows (`send_to_stream` is used internally by
|
|
53
|
+
the scheduler). Read-only — get/update/patch/remove are rejected with
|
|
54
|
+
400. Scoped by `company_namespace` (from the token). Admin-facing.
|
|
55
|
+
servers:
|
|
56
|
+
- url: https://sv.api.repzo.me
|
|
57
|
+
security:
|
|
58
|
+
- ApiKeyAuth: []
|
|
59
|
+
- JwtAuth: []
|
|
60
|
+
paths:
|
|
61
|
+
/object-detection-analytics-report:
|
|
62
|
+
get:
|
|
63
|
+
summary: Legacy read (thin adapter onto the V2 POST)
|
|
64
|
+
operationId: findObjectDetectionAnalyticsReport
|
|
65
|
+
parameters:
|
|
66
|
+
- in: query
|
|
67
|
+
name: view
|
|
68
|
+
schema:
|
|
69
|
+
type: string
|
|
70
|
+
enum: [metrics, segments]
|
|
71
|
+
default: metrics
|
|
72
|
+
- in: query
|
|
73
|
+
name: group
|
|
74
|
+
description: "Group keys — array or comma-separated string (e.g. `channel,month`)."
|
|
75
|
+
schema:
|
|
76
|
+
oneOf:
|
|
77
|
+
- type: string
|
|
78
|
+
- type: array
|
|
79
|
+
items:
|
|
80
|
+
type: string
|
|
81
|
+
enum:
|
|
82
|
+
[
|
|
83
|
+
metric,
|
|
84
|
+
type,
|
|
85
|
+
output,
|
|
86
|
+
client,
|
|
87
|
+
channel,
|
|
88
|
+
rep,
|
|
89
|
+
mission,
|
|
90
|
+
segment,
|
|
91
|
+
business_day,
|
|
92
|
+
month,
|
|
93
|
+
week,
|
|
94
|
+
]
|
|
95
|
+
- $ref: "#/components/parameters/from_time"
|
|
96
|
+
- $ref: "#/components/parameters/to_time"
|
|
97
|
+
- $ref: "#/components/parameters/business_day"
|
|
98
|
+
- $ref: "#/components/parameters/month"
|
|
99
|
+
- $ref: "#/components/parameters/week"
|
|
100
|
+
- $ref: "#/components/parameters/metric"
|
|
101
|
+
- $ref: "#/components/parameters/type"
|
|
102
|
+
- $ref: "#/components/parameters/output"
|
|
103
|
+
- $ref: "#/components/parameters/flag"
|
|
104
|
+
- $ref: "#/components/parameters/client"
|
|
105
|
+
- $ref: "#/components/parameters/channel"
|
|
106
|
+
- $ref: "#/components/parameters/rep"
|
|
107
|
+
- $ref: "#/components/parameters/team"
|
|
108
|
+
- $ref: "#/components/parameters/mission"
|
|
109
|
+
- $ref: "#/components/parameters/segment"
|
|
110
|
+
- $ref: "#/components/parameters/label"
|
|
111
|
+
- $ref: "#/components/parameters/label_group"
|
|
112
|
+
- $ref: "#/components/parameters/product_brand"
|
|
113
|
+
- $ref: "#/components/parameters/product_category"
|
|
114
|
+
- $ref: "#/components/parameters/sortBy"
|
|
115
|
+
- $ref: "#/components/parameters/export"
|
|
116
|
+
- $ref: "#/components/parameters/emailSubject"
|
|
117
|
+
responses:
|
|
118
|
+
"200":
|
|
119
|
+
description: "Same shape as the POST response (default page size — `per_page` is not honoured). With `export`, the export acknowledgement instead."
|
|
120
|
+
content:
|
|
121
|
+
application/json:
|
|
122
|
+
schema:
|
|
123
|
+
oneOf:
|
|
124
|
+
- $ref: "#/components/schemas/AnalyticsResponse"
|
|
125
|
+
- $ref: "#/components/schemas/ExportAck"
|
|
126
|
+
post:
|
|
127
|
+
summary: The V2 report read
|
|
128
|
+
operationId: createObjectDetectionAnalyticsReport
|
|
129
|
+
parameters:
|
|
130
|
+
- $ref: "#/components/parameters/export"
|
|
131
|
+
- $ref: "#/components/parameters/emailSubject"
|
|
132
|
+
- $ref: "#/components/parameters/sortBy"
|
|
133
|
+
- in: query
|
|
134
|
+
name: view
|
|
135
|
+
description: "Fallback when the body has no `view`."
|
|
136
|
+
schema:
|
|
137
|
+
type: string
|
|
138
|
+
enum: [metrics, segments]
|
|
139
|
+
- $ref: "#/components/parameters/from_time"
|
|
140
|
+
- $ref: "#/components/parameters/to_time"
|
|
141
|
+
- $ref: "#/components/parameters/business_day"
|
|
142
|
+
- $ref: "#/components/parameters/month"
|
|
143
|
+
- $ref: "#/components/parameters/week"
|
|
144
|
+
- $ref: "#/components/parameters/metric"
|
|
145
|
+
- $ref: "#/components/parameters/type"
|
|
146
|
+
- $ref: "#/components/parameters/output"
|
|
147
|
+
- $ref: "#/components/parameters/flag"
|
|
148
|
+
- $ref: "#/components/parameters/client"
|
|
149
|
+
- $ref: "#/components/parameters/channel"
|
|
150
|
+
- $ref: "#/components/parameters/rep"
|
|
151
|
+
- $ref: "#/components/parameters/team"
|
|
152
|
+
- $ref: "#/components/parameters/mission"
|
|
153
|
+
- $ref: "#/components/parameters/segment"
|
|
154
|
+
- $ref: "#/components/parameters/label"
|
|
155
|
+
- $ref: "#/components/parameters/label_group"
|
|
156
|
+
- $ref: "#/components/parameters/product_brand"
|
|
157
|
+
- $ref: "#/components/parameters/product_category"
|
|
158
|
+
requestBody:
|
|
159
|
+
required: true
|
|
160
|
+
content:
|
|
161
|
+
application/json:
|
|
162
|
+
schema:
|
|
163
|
+
$ref: "#/components/schemas/AnalyticsBody"
|
|
164
|
+
responses:
|
|
165
|
+
"201":
|
|
166
|
+
description: "Paginated rows + keys/columns/totals/sort_fields. With `export`, the export acknowledgement instead."
|
|
167
|
+
content:
|
|
168
|
+
application/json:
|
|
169
|
+
schema:
|
|
170
|
+
oneOf:
|
|
171
|
+
- $ref: "#/components/schemas/AnalyticsResponse"
|
|
172
|
+
- $ref: "#/components/schemas/ExportAck"
|
|
173
|
+
components:
|
|
174
|
+
securitySchemes:
|
|
175
|
+
ApiKeyAuth:
|
|
176
|
+
type: apiKey
|
|
177
|
+
in: header
|
|
178
|
+
name: api-key
|
|
179
|
+
JwtAuth:
|
|
180
|
+
type: apiKey
|
|
181
|
+
in: header
|
|
182
|
+
name: Authorization
|
|
183
|
+
parameters:
|
|
184
|
+
from_time:
|
|
185
|
+
in: query
|
|
186
|
+
name: from_time
|
|
187
|
+
description: "ms epoch lower bound on the result's createdAt. Default window: the last 30 days."
|
|
188
|
+
schema: { type: number }
|
|
189
|
+
to_time:
|
|
190
|
+
in: query
|
|
191
|
+
name: to_time
|
|
192
|
+
description: ms epoch upper bound (default now).
|
|
193
|
+
schema: { type: number }
|
|
194
|
+
business_day:
|
|
195
|
+
in: query
|
|
196
|
+
name: business_day
|
|
197
|
+
description: "`YYYY-MM-DD` bucket (company time zone) — sets the whole time range; overrides from_time / to_time."
|
|
198
|
+
schema: { type: string }
|
|
199
|
+
month:
|
|
200
|
+
in: query
|
|
201
|
+
name: month
|
|
202
|
+
description: "`YYYY-MM` bucket — sets the whole time range."
|
|
203
|
+
schema: { type: string }
|
|
204
|
+
week:
|
|
205
|
+
in: query
|
|
206
|
+
name: week
|
|
207
|
+
description: "ISO week bucket `GGGG-Www` (e.g. `2026-W29`) — sets the whole time range."
|
|
208
|
+
schema: { type: string }
|
|
209
|
+
metric:
|
|
210
|
+
in: query
|
|
211
|
+
name: metric
|
|
212
|
+
description: Metric definition id(s).
|
|
213
|
+
schema:
|
|
214
|
+
oneOf:
|
|
215
|
+
- type: string
|
|
216
|
+
- type: array
|
|
217
|
+
items: { type: string }
|
|
218
|
+
type:
|
|
219
|
+
in: query
|
|
220
|
+
name: type
|
|
221
|
+
description: Metric type(s).
|
|
222
|
+
schema:
|
|
223
|
+
oneOf:
|
|
224
|
+
- type: string
|
|
225
|
+
enum:
|
|
226
|
+
[
|
|
227
|
+
adjacent_block,
|
|
228
|
+
facings_count,
|
|
229
|
+
on_shelf_availability,
|
|
230
|
+
share_of_shelf,
|
|
231
|
+
]
|
|
232
|
+
- type: array
|
|
233
|
+
items: { type: string }
|
|
234
|
+
output:
|
|
235
|
+
in: query
|
|
236
|
+
name: output
|
|
237
|
+
description: Output family.
|
|
238
|
+
schema:
|
|
239
|
+
oneOf:
|
|
240
|
+
- type: string
|
|
241
|
+
enum: [compatibility, numerical, share_of_shelf]
|
|
242
|
+
- type: array
|
|
243
|
+
items: { type: string }
|
|
244
|
+
flag:
|
|
245
|
+
in: query
|
|
246
|
+
name: flag
|
|
247
|
+
description: Flagged results only (true) / unflagged only (false).
|
|
248
|
+
schema: { type: boolean }
|
|
249
|
+
client:
|
|
250
|
+
in: query
|
|
251
|
+
name: client
|
|
252
|
+
description: Client id(s) of the scanned session.
|
|
253
|
+
schema:
|
|
254
|
+
oneOf:
|
|
255
|
+
- type: string
|
|
256
|
+
- type: array
|
|
257
|
+
items: { type: string }
|
|
258
|
+
channel:
|
|
259
|
+
in: query
|
|
260
|
+
name: channel
|
|
261
|
+
description: Client-channel id(s).
|
|
262
|
+
schema:
|
|
263
|
+
oneOf:
|
|
264
|
+
- type: string
|
|
265
|
+
- type: array
|
|
266
|
+
items: { type: string }
|
|
267
|
+
rep:
|
|
268
|
+
in: query
|
|
269
|
+
name: rep
|
|
270
|
+
description: Rep id(s) — the session creator.
|
|
271
|
+
schema:
|
|
272
|
+
oneOf:
|
|
273
|
+
- type: string
|
|
274
|
+
- type: array
|
|
275
|
+
items: { type: string }
|
|
276
|
+
team:
|
|
277
|
+
in: query
|
|
278
|
+
name: team
|
|
279
|
+
description: Team id(s) on the client.
|
|
280
|
+
schema:
|
|
281
|
+
oneOf:
|
|
282
|
+
- type: string
|
|
283
|
+
- type: array
|
|
284
|
+
items: { type: string }
|
|
285
|
+
mission:
|
|
286
|
+
in: query
|
|
287
|
+
name: mission
|
|
288
|
+
description: "Mission id(s) the session was STARTED FROM — narrows to mission-driven sessions."
|
|
289
|
+
schema:
|
|
290
|
+
oneOf:
|
|
291
|
+
- type: string
|
|
292
|
+
- type: array
|
|
293
|
+
items: { type: string }
|
|
294
|
+
segment:
|
|
295
|
+
in: query
|
|
296
|
+
name: segment
|
|
297
|
+
description: Segment id(s) — segments view only (ignored on metrics).
|
|
298
|
+
schema:
|
|
299
|
+
oneOf:
|
|
300
|
+
- type: string
|
|
301
|
+
- type: array
|
|
302
|
+
items: { type: string }
|
|
303
|
+
label:
|
|
304
|
+
in: query
|
|
305
|
+
name: label
|
|
306
|
+
description: "Label id(s) — rows whose metric INVOLVES any of them (args or resolved SOS segments)."
|
|
307
|
+
schema:
|
|
308
|
+
oneOf:
|
|
309
|
+
- type: string
|
|
310
|
+
- type: array
|
|
311
|
+
items: { type: string }
|
|
312
|
+
label_group:
|
|
313
|
+
in: query
|
|
314
|
+
name: label_group
|
|
315
|
+
description: Label-group id(s) — resolved to the group's labels, then matched like `label`.
|
|
316
|
+
schema:
|
|
317
|
+
oneOf:
|
|
318
|
+
- type: string
|
|
319
|
+
- type: array
|
|
320
|
+
items: { type: string }
|
|
321
|
+
product_brand:
|
|
322
|
+
in: query
|
|
323
|
+
name: product_brand
|
|
324
|
+
description: Product-brand id(s) — resolved to the labels linked to the brand.
|
|
325
|
+
schema:
|
|
326
|
+
oneOf:
|
|
327
|
+
- type: string
|
|
328
|
+
- type: array
|
|
329
|
+
items: { type: string }
|
|
330
|
+
product_category:
|
|
331
|
+
in: query
|
|
332
|
+
name: product_category
|
|
333
|
+
description: Product-category id(s) — resolved to the labels linked to the category.
|
|
334
|
+
schema:
|
|
335
|
+
oneOf:
|
|
336
|
+
- type: string
|
|
337
|
+
- type: array
|
|
338
|
+
items: { type: string }
|
|
339
|
+
sortBy:
|
|
340
|
+
in: query
|
|
341
|
+
name: sortBy
|
|
342
|
+
description: "Query-string sort (`sortBy[0][field]=score&sortBy[0][type]=desc`); takes precedence over `options.sort`. Accepted fields: _id, time, createdAt, score, answer, metric_name, client_name, channel_name, segment_name, segment_ratio, segment_answer, row_count, avg_score, avg_ratio, avg_answer."
|
|
343
|
+
schema:
|
|
344
|
+
type: array
|
|
345
|
+
items:
|
|
346
|
+
type: object
|
|
347
|
+
properties:
|
|
348
|
+
field: { type: string }
|
|
349
|
+
type:
|
|
350
|
+
type: string
|
|
351
|
+
enum: [asc, desc]
|
|
352
|
+
export:
|
|
353
|
+
in: query
|
|
354
|
+
name: export
|
|
355
|
+
description: "`excel` schedules the emailed export instead of returning rows (the response is then the acknowledgement)."
|
|
356
|
+
schema:
|
|
357
|
+
type: string
|
|
358
|
+
enum: [excel]
|
|
359
|
+
emailSubject:
|
|
360
|
+
in: query
|
|
361
|
+
name: emailSubject
|
|
362
|
+
description: Subject / name of the scheduled export email (default "Detection Analytics").
|
|
363
|
+
schema: { type: string }
|
|
364
|
+
schemas:
|
|
365
|
+
AnalyticsBody:
|
|
366
|
+
type: object
|
|
367
|
+
properties:
|
|
368
|
+
view:
|
|
369
|
+
type: string
|
|
370
|
+
enum: [metrics, segments]
|
|
371
|
+
default: metrics
|
|
372
|
+
anyOf:
|
|
373
|
+
type: array
|
|
374
|
+
description: "Filter groups — only the FIRST group is read; its criteria are AND-ed."
|
|
375
|
+
items:
|
|
376
|
+
type: object
|
|
377
|
+
properties:
|
|
378
|
+
criteria:
|
|
379
|
+
type: array
|
|
380
|
+
items:
|
|
381
|
+
type: object
|
|
382
|
+
required: [key]
|
|
383
|
+
properties:
|
|
384
|
+
key:
|
|
385
|
+
type: string
|
|
386
|
+
enum:
|
|
387
|
+
[
|
|
388
|
+
time,
|
|
389
|
+
createdAt,
|
|
390
|
+
metric,
|
|
391
|
+
type,
|
|
392
|
+
output,
|
|
393
|
+
flag,
|
|
394
|
+
client,
|
|
395
|
+
channel,
|
|
396
|
+
rep,
|
|
397
|
+
team,
|
|
398
|
+
mission,
|
|
399
|
+
segment,
|
|
400
|
+
label,
|
|
401
|
+
label_group,
|
|
402
|
+
product_brand,
|
|
403
|
+
product_category,
|
|
404
|
+
business_day,
|
|
405
|
+
month,
|
|
406
|
+
week,
|
|
407
|
+
]
|
|
408
|
+
operator:
|
|
409
|
+
type: string
|
|
410
|
+
description: "in/nin/eq/ne for id & enum keys (default in); between/gte/lte or a preset for time / createdAt; ignored for label and bucket keys."
|
|
411
|
+
enum:
|
|
412
|
+
[
|
|
413
|
+
in,
|
|
414
|
+
nin,
|
|
415
|
+
eq,
|
|
416
|
+
ne,
|
|
417
|
+
between,
|
|
418
|
+
gte,
|
|
419
|
+
lte,
|
|
420
|
+
today,
|
|
421
|
+
yesterday,
|
|
422
|
+
last_seven_days,
|
|
423
|
+
last_thirty_days,
|
|
424
|
+
last_month,
|
|
425
|
+
last_three_months,
|
|
426
|
+
last_six_months,
|
|
427
|
+
last_twelve_months,
|
|
428
|
+
]
|
|
429
|
+
value:
|
|
430
|
+
description: "Ids / strings / booleans (array or single). time between: [from_ms, to_ms]; gte/lte: ms; presets: omitted; buckets: one bucket string."
|
|
431
|
+
oneOf:
|
|
432
|
+
- type: array
|
|
433
|
+
items: {}
|
|
434
|
+
- type: string
|
|
435
|
+
- type: number
|
|
436
|
+
- type: boolean
|
|
437
|
+
group:
|
|
438
|
+
type: array
|
|
439
|
+
description: 'Group keys, e.g. [{ _id: "channel" }, { _id: "month" }]. type/output are metrics-view only, segment is segments-view only.'
|
|
440
|
+
items:
|
|
441
|
+
type: object
|
|
442
|
+
properties:
|
|
443
|
+
_id:
|
|
444
|
+
type: string
|
|
445
|
+
enum:
|
|
446
|
+
[
|
|
447
|
+
metric,
|
|
448
|
+
type,
|
|
449
|
+
output,
|
|
450
|
+
client,
|
|
451
|
+
channel,
|
|
452
|
+
rep,
|
|
453
|
+
mission,
|
|
454
|
+
segment,
|
|
455
|
+
business_day,
|
|
456
|
+
month,
|
|
457
|
+
week,
|
|
458
|
+
]
|
|
459
|
+
projection:
|
|
460
|
+
type: array
|
|
461
|
+
description: Column keys to show (ungrouped rows only).
|
|
462
|
+
items: { type: string }
|
|
463
|
+
columns:
|
|
464
|
+
type: array
|
|
465
|
+
description: Optional column override (defaults come from the report metadata).
|
|
466
|
+
items:
|
|
467
|
+
$ref: "#/components/schemas/ReportColumn"
|
|
468
|
+
options:
|
|
469
|
+
type: object
|
|
470
|
+
properties:
|
|
471
|
+
limit:
|
|
472
|
+
type: number
|
|
473
|
+
default: 50
|
|
474
|
+
description: "Rows per page — replaces the query-string `per_page`, which is not honoured."
|
|
475
|
+
page: { type: number, default: 1 }
|
|
476
|
+
sort:
|
|
477
|
+
type: array
|
|
478
|
+
description: "Fields must exist in the report's sort metadata (`sort_fields`), else the default applies (row_count desc grouped, time desc flat)."
|
|
479
|
+
items:
|
|
480
|
+
type: object
|
|
481
|
+
properties:
|
|
482
|
+
field: { type: string }
|
|
483
|
+
type:
|
|
484
|
+
type: string
|
|
485
|
+
enum: [asc, desc]
|
|
486
|
+
totals_summary:
|
|
487
|
+
type: string
|
|
488
|
+
enum: [all, page, none]
|
|
489
|
+
default: none
|
|
490
|
+
ReportColumn:
|
|
491
|
+
type: object
|
|
492
|
+
description: A shared report-metadata column definition.
|
|
493
|
+
properties:
|
|
494
|
+
_id: { type: string }
|
|
495
|
+
key: { type: string }
|
|
496
|
+
name: { type: string }
|
|
497
|
+
position: { type: number }
|
|
498
|
+
selectable: { type: boolean }
|
|
499
|
+
show:
|
|
500
|
+
type: string
|
|
501
|
+
enum: [default, hide, show]
|
|
502
|
+
default_show: { type: boolean }
|
|
503
|
+
totals_key: { type: string }
|
|
504
|
+
column_group: { type: string }
|
|
505
|
+
report_types:
|
|
506
|
+
type: array
|
|
507
|
+
items: { type: string }
|
|
508
|
+
disabled: { type: boolean }
|
|
509
|
+
AnalyticsRow:
|
|
510
|
+
type: object
|
|
511
|
+
description: "Flat rows carry the result fields (segments view adds the segment_* fields); grouped rows carry drilldown + row_count/avg_* + the grouped identity names / buckets."
|
|
512
|
+
properties:
|
|
513
|
+
_id:
|
|
514
|
+
type: string
|
|
515
|
+
description: Metric result id (flat rows only).
|
|
516
|
+
time: { type: number, description: "Result creation time (ms)." }
|
|
517
|
+
business_day:
|
|
518
|
+
{ type: string, description: "YYYY-MM-DD (company time zone)." }
|
|
519
|
+
timestamp: { type: string, description: "YYYY-MM-DD HH:mm:ss." }
|
|
520
|
+
month: { type: string, description: "YYYY-MM." }
|
|
521
|
+
week: { type: string, description: "ISO week GGGG-Www." }
|
|
522
|
+
metric_id: { type: string }
|
|
523
|
+
metric_name: { type: string }
|
|
524
|
+
metric_type:
|
|
525
|
+
type: string
|
|
526
|
+
enum:
|
|
527
|
+
[
|
|
528
|
+
adjacent_block,
|
|
529
|
+
facings_count,
|
|
530
|
+
on_shelf_availability,
|
|
531
|
+
share_of_shelf,
|
|
532
|
+
]
|
|
533
|
+
output:
|
|
534
|
+
type: string
|
|
535
|
+
enum: [compatibility, numerical, share_of_shelf]
|
|
536
|
+
flag: { type: boolean }
|
|
537
|
+
score: { type: number, description: "0..1, rounded to 4 decimals." }
|
|
538
|
+
client_id: { type: string }
|
|
539
|
+
client_name: { type: string }
|
|
540
|
+
channel_id: { type: string }
|
|
541
|
+
channel_name: { type: string }
|
|
542
|
+
rep_id: { type: string }
|
|
543
|
+
rep_name: { type: string }
|
|
544
|
+
mission_id:
|
|
545
|
+
type: string
|
|
546
|
+
description: The mission the session was STARTED FROM — absent on generic scans.
|
|
547
|
+
mission_name: { type: string }
|
|
548
|
+
teams_ids:
|
|
549
|
+
type: array
|
|
550
|
+
items: { type: string }
|
|
551
|
+
session_id: { type: string }
|
|
552
|
+
analysis_id: { type: string }
|
|
553
|
+
answer:
|
|
554
|
+
description: "metrics view — effective answer (confirmed override wins): boolean for compatibility, number otherwise."
|
|
555
|
+
oneOf:
|
|
556
|
+
- type: boolean
|
|
557
|
+
- type: number
|
|
558
|
+
nullable: true
|
|
559
|
+
ratio: { type: number, description: "metrics view — effective ratio." }
|
|
560
|
+
segment_id: { type: string, description: segments view. }
|
|
561
|
+
segment_name: { type: string, description: segments view. }
|
|
562
|
+
is_main:
|
|
563
|
+
type: string
|
|
564
|
+
enum: [main, context]
|
|
565
|
+
description: "segments view — main = the row the target is defined for."
|
|
566
|
+
segment_answer:
|
|
567
|
+
{
|
|
568
|
+
type: number,
|
|
569
|
+
description: "segments view — measured quantity (2 decimals).",
|
|
570
|
+
}
|
|
571
|
+
segment_ratio:
|
|
572
|
+
{
|
|
573
|
+
type: number,
|
|
574
|
+
description: "segments view — the segment's share 0..1.",
|
|
575
|
+
}
|
|
576
|
+
target_ratio:
|
|
577
|
+
{ type: number, description: "segments view — main rows only." }
|
|
578
|
+
target_answer:
|
|
579
|
+
{ type: number, description: "segments view — main rows only." }
|
|
580
|
+
segment_score:
|
|
581
|
+
{ type: number, description: "segments view — main rows only." }
|
|
582
|
+
measure:
|
|
583
|
+
type: string
|
|
584
|
+
enum: [width_cm, area_cm2, facings]
|
|
585
|
+
drilldown:
|
|
586
|
+
type: object
|
|
587
|
+
description: "grouped rows — filter-compatible ids / buckets keyed by the group keys (metric, type, output, client, channel, rep, mission, segment, business_day, month, week)."
|
|
588
|
+
additionalProperties: { type: string }
|
|
589
|
+
row_count: { type: number, description: grouped rows. }
|
|
590
|
+
avg_score: { type: number, description: grouped rows. }
|
|
591
|
+
avg_answer: { type: number, description: grouped rows. }
|
|
592
|
+
avg_ratio:
|
|
593
|
+
{
|
|
594
|
+
type: number,
|
|
595
|
+
description: "grouped rows, segments view — average share.",
|
|
596
|
+
}
|
|
597
|
+
main_rows: { type: number, description: "grouped rows, segments view." }
|
|
598
|
+
flagged: { type: number, description: "grouped rows, metrics view." }
|
|
599
|
+
type:
|
|
600
|
+
type: string
|
|
601
|
+
description: "grouped by type — the metric-type bucket."
|
|
602
|
+
additionalProperties: true
|
|
603
|
+
AnalyticsResponse:
|
|
604
|
+
type: object
|
|
605
|
+
properties:
|
|
606
|
+
total_result: { type: number }
|
|
607
|
+
current_count: { type: number }
|
|
608
|
+
total_pages: { type: number }
|
|
609
|
+
current_page: { type: number }
|
|
610
|
+
per_page: { type: number }
|
|
611
|
+
first_page_url: { type: string }
|
|
612
|
+
last_page_url: { type: string }
|
|
613
|
+
next_page_url: { type: string, nullable: true }
|
|
614
|
+
prev_page_url: { type: string, nullable: true }
|
|
615
|
+
path: { type: string }
|
|
616
|
+
data:
|
|
617
|
+
type: array
|
|
618
|
+
items:
|
|
619
|
+
$ref: "#/components/schemas/AnalyticsRow"
|
|
620
|
+
keys:
|
|
621
|
+
type: array
|
|
622
|
+
description: Table columns for the current state (grouped vs flat).
|
|
623
|
+
items:
|
|
624
|
+
type: object
|
|
625
|
+
properties:
|
|
626
|
+
key: { type: string }
|
|
627
|
+
value: { type: string, description: Translated label. }
|
|
628
|
+
type:
|
|
629
|
+
type: string
|
|
630
|
+
enum: [string, number]
|
|
631
|
+
visible: { type: boolean }
|
|
632
|
+
columns:
|
|
633
|
+
type: array
|
|
634
|
+
description: "The report's column metadata sorted by position (or the `columns` override echoed back)."
|
|
635
|
+
items:
|
|
636
|
+
$ref: "#/components/schemas/ReportColumn"
|
|
637
|
+
totals:
|
|
638
|
+
type: object
|
|
639
|
+
description: "When options.totals_summary is all (absolute_total) / page (page_total): Rows, Average Score (+ Average Share on segments)."
|
|
640
|
+
properties:
|
|
641
|
+
absolute_total:
|
|
642
|
+
type: object
|
|
643
|
+
additionalProperties: { type: number }
|
|
644
|
+
page_total:
|
|
645
|
+
type: object
|
|
646
|
+
additionalProperties: { type: number }
|
|
647
|
+
labels:
|
|
648
|
+
type: array
|
|
649
|
+
items:
|
|
650
|
+
type: object
|
|
651
|
+
properties:
|
|
652
|
+
key: { type: string }
|
|
653
|
+
value: { type: string }
|
|
654
|
+
sort_fields:
|
|
655
|
+
type: array
|
|
656
|
+
description: The report's sort metadata rows — the valid options.sort fields.
|
|
657
|
+
items:
|
|
658
|
+
type: object
|
|
659
|
+
properties:
|
|
660
|
+
_id: { type: string }
|
|
661
|
+
key: { type: string }
|
|
662
|
+
name: { type: string }
|
|
663
|
+
selectable: { type: boolean }
|
|
664
|
+
report_types:
|
|
665
|
+
type: array
|
|
666
|
+
items: { type: string }
|
|
667
|
+
ExportAck:
|
|
668
|
+
type: object
|
|
669
|
+
description: "Returned when `export` is set — the report was queued to be emailed."
|
|
670
|
+
properties:
|
|
671
|
+
_id: { type: string }
|
|
672
|
+
success: { type: boolean }
|
|
673
|
+
msg: { type: string }
|
|
674
|
+
isExport: { type: boolean }
|