repzo 1.0.291 → 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.
Files changed (34) hide show
  1. package/changelog.md +28 -0
  2. package/lib/index.d.ts +244 -2
  3. package/lib/index.js +541 -0
  4. package/lib/types/index.d.ts +4533 -1
  5. package/package.json +1 -1
  6. package/src/index.ts +1270 -0
  7. package/src/oas/activity-ai-object-detection-session-frame.yaml +600 -0
  8. package/src/oas/ai-object-detection-assigned-missions.yaml +283 -0
  9. package/src/oas/ai-object-detection-assignment-rule.yaml +357 -0
  10. package/src/oas/ai-object-detection-category.yaml +338 -0
  11. package/src/oas/ai-object-detection-dataset.yaml +342 -0
  12. package/src/oas/ai-object-detection-detection-settings.yaml +410 -0
  13. package/src/oas/ai-object-detection-inference.yaml +818 -0
  14. package/src/oas/ai-object-detection-label-group.yaml +265 -0
  15. package/src/oas/ai-object-detection-label-report.yaml +366 -0
  16. package/src/oas/ai-object-detection-label.yaml +395 -0
  17. package/src/oas/ai-object-detection-metric-result.yaml +734 -0
  18. package/src/oas/ai-object-detection-metric.yaml +559 -0
  19. package/src/oas/ai-object-detection-mission-results.yaml +370 -0
  20. package/src/oas/ai-object-detection-mission-set.yaml +250 -0
  21. package/src/oas/ai-object-detection-mission.yaml +349 -0
  22. package/src/oas/ai-object-detection-model-version-epoch.yaml +214 -0
  23. package/src/oas/ai-object-detection-model-version-train-agent.yaml +88 -0
  24. package/src/oas/ai-object-detection-model-version.yaml +567 -0
  25. package/src/oas/ai-object-detection-model.yaml +369 -0
  26. package/src/oas/ai-object-detection-segment.yaml +301 -0
  27. package/src/oas/ai-object-detection-session-analysis.yaml +1306 -0
  28. package/src/oas/ai-object-detection-session-election.yaml +193 -0
  29. package/src/oas/ai-object-detection-session-insight.yaml +418 -0
  30. package/src/oas/ai-object-detection-session.yaml +840 -0
  31. package/src/oas/ai-object-detection-settings.yaml +249 -0
  32. package/src/oas/ai-object-detection-task.yaml +1007 -0
  33. package/src/oas/object-detection-analytics-report.yaml +674 -0
  34. package/src/types/index.ts +5159 -1
@@ -0,0 +1,410 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: Repzo API - AI Object Detection Detection Settings
4
+ version: 1.0.0
5
+ description: |
6
+ **Unified detection settings** — the per-namespace configuration of the
7
+ AR shelf-scan CAPTURE pipeline: how the mobile app captures frames
8
+ (`capture`: mode, rate, resolution, torch, exposure lock), the two-tier
9
+ per-frame quality limits (`frame`: sharpness, yaw/pitch/roll deltas,
10
+ depth variation, distance, tracking score — each with a `warn` bound that
11
+ only shows guidance and an `error` bound that excludes the frame from
12
+ election while it still counts toward coverage), the frame-election
13
+ formula (`election`: coverage target, sliver fraction, redundancy exponent
14
+ and quality weights) and the session acceptance gates (`session`:
15
+ coverage target, jump tolerance, elected-frame budget, verdict score
16
+ bands). It is the single source of truth for knobs that used to live
17
+ scattered across the mobile validator, the election engine and the
18
+ backend session gates.
19
+
20
+ **Who calls it.** The MOBILE app pulls `GET` on session start with a rep
21
+ token (reads are open to any authenticated scope); the dashboard (admin)
22
+ writes. The auto-seeded permission grid governs per-scope access.
23
+
24
+ **Multi-tenancy & lifecycle.** One logical document per
25
+ `company_namespace` (keyed from the caller's token — never sent in the
26
+ body; unique index). The stored document holds only PARTIAL OVERRIDES
27
+ over the engine defaults (`DEFAULT_DETECTION_CONFIG`); every read returns
28
+ the MERGED result (`config`) alongside the raw `overrides`, so partial
29
+ overrides stay partial and new engine defaults reach every namespace
30
+ automatically. `GET` never 404s — an untouched namespace answers
31
+ `is_default: true` with the pure defaults. `POST` upserts (`PUT` / `PATCH`
32
+ behave identically and ignore the path id) and REPLACES the stored
33
+ overrides object wholesale (it is not merged into previously saved
34
+ overrides — send the complete set you want kept). `DELETE` resets to the
35
+ factory defaults by dropping the document (id ignored) and answers only
36
+ `{ is_default: true, config }`. No query parameters are honoured;
37
+ responses are single objects, never paginated.
38
+
39
+ **Relationships.** Frames submitted by the app stamp
40
+ `frame_meta.detection_settings_polled_at` on their
41
+ `ai-object-detection-task` so an analysis can tell which settings a
42
+ capture ran under; the backend election
43
+ (`ai-object-detection-session-election`) enforces the same `frame` /
44
+ `election` / `session` values server-side.
45
+
46
+ **Not to be confused with** `ai-object-detection-settings`, which stores
47
+ the dashboard-only ANALYZE defaults (scene-math knobs) and never reaches
48
+ the device.
49
+ servers:
50
+ - url: https://sv.api.repzo.me
51
+ security:
52
+ - ApiKeyAuth: []
53
+ - JwtAuth: []
54
+ paths:
55
+ /ai-object-detection-detection-settings:
56
+ get:
57
+ summary: Read the namespace's merged detection config
58
+ description: |
59
+ Returns the engine defaults deep-merged with the namespace's saved
60
+ overrides, plus the raw overrides. Never 404s. Query parameters are
61
+ ignored. This is what the mobile app pulls on session start.
62
+ operationId: findAiObjectDetectionDetectionSettings
63
+ responses:
64
+ "200":
65
+ description: The merged detection config (or the pure defaults when nothing is saved).
66
+ content:
67
+ application/json:
68
+ schema:
69
+ $ref: "#/components/schemas/DetectionSettings"
70
+ post:
71
+ summary: Save the namespace's detection overrides
72
+ description: |
73
+ Upserts the single document for the caller's namespace, REPLACING the
74
+ stored overrides object with `config`, and returns the fresh merged
75
+ read. `config` must be an object (else `400`); any subset of the
76
+ `DetectionConfig` tree is accepted and deep-merged over the defaults
77
+ on read.
78
+ operationId: createAiObjectDetectionDetectionSettings
79
+ requestBody:
80
+ required: true
81
+ content:
82
+ application/json:
83
+ schema:
84
+ $ref: "#/components/schemas/DetectionSettingsCreateBody"
85
+ responses:
86
+ "201":
87
+ description: The merged config, re-read after the upsert.
88
+ content:
89
+ application/json:
90
+ schema:
91
+ $ref: "#/components/schemas/DetectionSettings"
92
+ "400":
93
+ description: "`config` is missing or not an object."
94
+ /ai-object-detection-detection-settings/{id}:
95
+ get:
96
+ summary: Read the merged detection config (id ignored)
97
+ description: One logical document per namespace — this mirrors the collection read.
98
+ operationId: getAiObjectDetectionDetectionSettings
99
+ parameters:
100
+ - in: path
101
+ name: id
102
+ required: true
103
+ description: Ignored — there is a single document per namespace.
104
+ schema: { type: string }
105
+ responses:
106
+ "200":
107
+ description: Same shape as the collection read.
108
+ content:
109
+ application/json:
110
+ schema:
111
+ $ref: "#/components/schemas/DetectionSettings"
112
+ put:
113
+ summary: Save the detection overrides (id ignored)
114
+ description: Identical to POST — upserts the namespace's single document.
115
+ operationId: updateAiObjectDetectionDetectionSettings
116
+ parameters:
117
+ - in: path
118
+ name: id
119
+ required: true
120
+ description: Ignored — the namespace keys the document.
121
+ schema: { type: string }
122
+ requestBody:
123
+ required: true
124
+ content:
125
+ application/json:
126
+ schema:
127
+ $ref: "#/components/schemas/DetectionSettingsWrite"
128
+ responses:
129
+ "200":
130
+ description: The merged config, re-read after the upsert.
131
+ content:
132
+ application/json:
133
+ schema:
134
+ $ref: "#/components/schemas/DetectionSettings"
135
+ "400":
136
+ description: "`config` is missing or not an object."
137
+ patch:
138
+ summary: Save the detection overrides (identical to PUT)
139
+ operationId: patchAiObjectDetectionDetectionSettings
140
+ parameters:
141
+ - in: path
142
+ name: id
143
+ required: true
144
+ description: Ignored — the namespace keys the document.
145
+ schema: { type: string }
146
+ requestBody:
147
+ required: true
148
+ content:
149
+ application/json:
150
+ schema:
151
+ $ref: "#/components/schemas/DetectionSettingsWrite"
152
+ responses:
153
+ "200":
154
+ description: The merged config, re-read after the upsert.
155
+ content:
156
+ application/json:
157
+ schema:
158
+ $ref: "#/components/schemas/DetectionSettings"
159
+ "400":
160
+ description: "`config` is missing or not an object."
161
+ delete:
162
+ summary: Reset to the factory defaults
163
+ description: |
164
+ Drops the namespace's overrides document. The id is ignored. Note the
165
+ reduced response shape — only `is_default` and the default `config`.
166
+ operationId: removeAiObjectDetectionDetectionSettings
167
+ parameters:
168
+ - in: path
169
+ name: id
170
+ required: true
171
+ description: Ignored — any value works.
172
+ schema: { type: string }
173
+ example: defaults
174
+ responses:
175
+ "200":
176
+ description: Reset acknowledgement with the pure engine defaults.
177
+ content:
178
+ application/json:
179
+ schema:
180
+ $ref: "#/components/schemas/DetectionSettingsResetResult"
181
+ components:
182
+ securitySchemes:
183
+ ApiKeyAuth:
184
+ type: apiKey
185
+ in: header
186
+ name: api-key
187
+ description: |
188
+ Server-issued API key. Also accepted via the `x-api-key` header or the
189
+ `?apiKey=` query parameter as fallbacks.
190
+ JwtAuth:
191
+ type: apiKey
192
+ in: header
193
+ name: Authorization
194
+ description: |
195
+ Raw JWT in the `Authorization` header — **no `Bearer ` prefix**.
196
+ Obtained from `POST /authenticate` (admin / rep / client login).
197
+ schemas:
198
+ WarnError:
199
+ type: object
200
+ description: |
201
+ Two-tier frame limit. `warn` = guidance shown on the device, frame
202
+ still usable; `error` = frame excluded from election (it still counts
203
+ toward the coverage total). `warn` is always the softer bound.
204
+ required: [warn, error]
205
+ properties:
206
+ warn: { type: number }
207
+ error: { type: number }
208
+ CaptureConfig:
209
+ type: object
210
+ properties:
211
+ mode:
212
+ type: string
213
+ enum: [stack_elect, continuous, burst]
214
+ default: stack_elect
215
+ rate_hz:
216
+ type: number
217
+ default: 4
218
+ description: Capture rate, frames per second.
219
+ resolution:
220
+ type: string
221
+ enum: [medium, high, max]
222
+ default: max
223
+ stack_timeout_s:
224
+ type: number
225
+ default: 30
226
+ description: Seconds before a stack-elect capture times out.
227
+ sweep_guide:
228
+ type: boolean
229
+ default: true
230
+ description: Show the sweep guide overlay.
231
+ torch:
232
+ type: boolean
233
+ default: true
234
+ exposure_lock:
235
+ type: boolean
236
+ default: true
237
+ FrameConfig:
238
+ type: object
239
+ description: Per-frame quality limits, each a `WarnError` pair.
240
+ properties:
241
+ min_sharpness:
242
+ allOf:
243
+ - $ref: "#/components/schemas/WarnError"
244
+ description: "Variance-of-Laplacian sharpness floor. `warn` = live-guidance floor, `error` = election hard floor (the blur limit). Default `{ warn: 200, error: 50 }`."
245
+ max_yaw_delta_deg:
246
+ allOf:
247
+ - $ref: "#/components/schemas/WarnError"
248
+ description: "Degrees. Default `{ warn: 18, error: 30 }`."
249
+ max_pitch_delta_deg:
250
+ allOf:
251
+ - $ref: "#/components/schemas/WarnError"
252
+ description: "Degrees. Default `{ warn: 15, error: 28 }`."
253
+ max_roll_delta_deg:
254
+ allOf:
255
+ - $ref: "#/components/schemas/WarnError"
256
+ description: "Degrees. Default `{ warn: 12, error: 25 }`."
257
+ max_depth_variation_m:
258
+ allOf:
259
+ - $ref: "#/components/schemas/WarnError"
260
+ description: "Metres. Default `{ warn: 0.8, error: 1.5 }`."
261
+ min_distance_m:
262
+ allOf:
263
+ - $ref: "#/components/schemas/WarnError"
264
+ description: "Metres — `error` is the NEARER bound (worse). Default `{ warn: 0.5, error: 0.3 }`."
265
+ max_distance_m:
266
+ allOf:
267
+ - $ref: "#/components/schemas/WarnError"
268
+ description: "Metres — `error` is the FARTHER bound (worse). Default `{ warn: 2.0, error: 3.0 }`."
269
+ min_tracking_score:
270
+ allOf:
271
+ - $ref: "#/components/schemas/WarnError"
272
+ description: "0..100. Default `{ warn: 60, error: 35 }`."
273
+ ElectionConfig:
274
+ type: object
275
+ properties:
276
+ cover_target:
277
+ type: number
278
+ default: 0.985
279
+ description: Stop electing at this union coverage (0..1).
280
+ sliver_frac:
281
+ type: number
282
+ default: 0.02
283
+ description: Ignore gains under this fraction of a median footprint.
284
+ gain_exp:
285
+ type: number
286
+ default: 1.5
287
+ description: "Redundancy penalty exponent (score = quality · gain^exp)."
288
+ w_sharp:
289
+ type: number
290
+ default: 0.4
291
+ description: Quality geometric-mean weight — sharpness.
292
+ w_depth:
293
+ type: number
294
+ default: 0.3
295
+ description: Quality geometric-mean weight — depth.
296
+ w_track:
297
+ type: number
298
+ default: 0.2
299
+ description: Quality geometric-mean weight — tracking.
300
+ w_lux:
301
+ type: number
302
+ default: 0.1
303
+ description: Quality geometric-mean weight — lux.
304
+ SessionScoreBands:
305
+ type: object
306
+ description: "Average-quality verdict bands; below `acceptable` = rejected."
307
+ properties:
308
+ excellent: { type: number, default: 0.8 }
309
+ good: { type: number, default: 0.65 }
310
+ acceptable: { type: number, default: 0.45 }
311
+ SessionConfig:
312
+ type: object
313
+ properties:
314
+ coverage_target_m2:
315
+ type: number
316
+ default: 0.5
317
+ description: Reject when the device-reported covered area (m²) is below this.
318
+ allow_jump:
319
+ type: boolean
320
+ default: false
321
+ description: When false, a spatial jump (after removing error frames) rejects the session.
322
+ elected_allowance:
323
+ type: number
324
+ default: 1.6
325
+ description: "Elected-count budget: ceil(total_area / avg_frame_area × allowance). More elected frames than that rejects the session."
326
+ score:
327
+ $ref: "#/components/schemas/SessionScoreBands"
328
+ DetectionConfig:
329
+ type: object
330
+ description: The full merged detection config (defaults deep-merged with the namespace overrides).
331
+ properties:
332
+ capture:
333
+ $ref: "#/components/schemas/CaptureConfig"
334
+ frame:
335
+ $ref: "#/components/schemas/FrameConfig"
336
+ election:
337
+ $ref: "#/components/schemas/ElectionConfig"
338
+ session:
339
+ $ref: "#/components/schemas/SessionConfig"
340
+ DetectionConfigOverrides:
341
+ type: object
342
+ description: |
343
+ Deep-partial subset of `DetectionConfig`. Objects merge recursively
344
+ over the defaults, scalars replace (a `WarnError` may carry only
345
+ `warn` or only `error`). Unknown keys are kept by the merge so the
346
+ config can grow.
347
+ properties:
348
+ capture:
349
+ $ref: "#/components/schemas/CaptureConfig"
350
+ frame:
351
+ $ref: "#/components/schemas/FrameConfig"
352
+ election:
353
+ $ref: "#/components/schemas/ElectionConfig"
354
+ session:
355
+ $ref: "#/components/schemas/SessionConfig"
356
+ example:
357
+ capture: { torch: false }
358
+ frame: { min_sharpness: { error: 80 } }
359
+ session: { coverage_target_m2: 0.8 }
360
+ DetectionSettings:
361
+ type: object
362
+ description: Response of find / get / create / update / patch.
363
+ properties:
364
+ _id:
365
+ type: string
366
+ nullable: true
367
+ description: "`null` while the namespace has never saved overrides."
368
+ is_default:
369
+ type: boolean
370
+ description: "true = no overrides saved; `config` is the pure engine default."
371
+ config:
372
+ $ref: "#/components/schemas/DetectionConfig"
373
+ overrides:
374
+ allOf:
375
+ - $ref: "#/components/schemas/DetectionConfigOverrides"
376
+ description: "The raw saved overrides (`{}` when `is_default`)."
377
+ updatedAt:
378
+ type: string
379
+ format: date-time
380
+ nullable: true
381
+ description: "When the overrides were last saved; `null` when `is_default`."
382
+ DetectionSettingsWrite:
383
+ type: object
384
+ description: PUT / PATCH body — the same single document is upserted.
385
+ required: [config]
386
+ properties:
387
+ config:
388
+ $ref: "#/components/schemas/DetectionConfigOverrides"
389
+ DetectionSettingsCreateBody:
390
+ description: |
391
+ POST body. The tenant key is taken from the caller's token; the
392
+ optional `company_namespace` exists for SDK-call uniformity and is not
393
+ read by this endpoint.
394
+ allOf:
395
+ - $ref: "#/components/schemas/DetectionSettingsWrite"
396
+ - type: object
397
+ properties:
398
+ company_namespace:
399
+ type: array
400
+ items: { type: string }
401
+ description: Optional tenant namespace override for SDK callers. Not read by this endpoint — the document is keyed from the caller's token namespace.
402
+ DetectionSettingsResetResult:
403
+ type: object
404
+ description: "DELETE response — note there is no `_id` / `overrides` / `updatedAt`."
405
+ properties:
406
+ is_default:
407
+ type: boolean
408
+ enum: [true]
409
+ config:
410
+ $ref: "#/components/schemas/DetectionConfig"