@shipeasy/openapi 3.2.0 → 3.4.0
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/README.md +1 -1
- package/dist/{chunk-RTN572TI.js → chunk-JJA7XEPU.js} +91 -1
- package/dist/chunk-JJA7XEPU.js.map +1 -0
- package/dist/{chunk-DW33MG4B.js → chunk-Z3CY5Y44.js} +514 -126
- package/dist/chunk-Z3CY5Y44.js.map +1 -0
- package/dist/{client-BPVn4hMC.d.ts → client-CkRbr8I2.d.ts} +1544 -212
- package/dist/client.d.ts +1 -1
- package/dist/client.js +23 -1
- package/dist/custom.d.ts +5 -5
- package/dist/custom.js +128 -84
- package/dist/custom.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +24 -2
- package/dist/index.js.map +1 -1
- package/dist/schemas.d.ts +1935 -963
- package/dist/schemas.js +141 -1
- package/openapi-sdk.json +31 -9
- package/openapi.json +10449 -8118
- package/openapi.yaml +2274 -634
- package/package.json +1 -1
- package/spec/components/schemas/alert-rules.yaml +434 -10
- package/spec/components/schemas/alerts.yaml +9 -7
- package/spec/components/schemas/common.yaml +2 -2
- package/spec/components/schemas/connectors.yaml +69 -6
- package/spec/components/schemas/events.yaml +20 -9
- package/spec/components/schemas/keys.yaml +39 -0
- package/spec/components/schemas/metrics.yaml +131 -251
- package/spec/components/schemas/ops.yaml +471 -29
- package/spec/components/schemas/projects.yaml +18 -0
- package/spec/components/schemas/search.yaml +1 -0
- package/spec/components/schemas/tags.yaml +91 -0
- package/spec/openapi.yaml +56 -0
- package/spec/paths/alerts.yaml +5 -3
- package/spec/paths/i18n.yaml +2 -1
- package/spec/paths/keys.yaml +79 -0
- package/spec/paths/metrics.yaml +26 -17
- package/spec/paths/ops.yaml +514 -11
- package/spec/paths/tags.yaml +270 -0
- package/dist/chunk-DW33MG4B.js.map +0 -1
- package/dist/chunk-RTN572TI.js.map +0 -1
|
@@ -171,6 +171,12 @@ GetCurrentProjectResponse:
|
|
|
171
171
|
- type: boolean
|
|
172
172
|
- type: number
|
|
173
173
|
description: Whether key-authenticated public ticket creation (`POST /cli/report`) is allowed into this project. Off by default.
|
|
174
|
+
errorAutocloseDays:
|
|
175
|
+
type: integer
|
|
176
|
+
description: Days an `open` tracked error may go unseen before the nightly sweep auto-resolves it. `0` disables auto-close for this project. Ingest reopens a resolved error the moment it recurs, so this never hides a live issue.
|
|
177
|
+
errorTicketMinOccurrences:
|
|
178
|
+
type: integer
|
|
179
|
+
description: Occurrence count a tracked error must cross before an `error` ticket is auto-filed into the ops queue. Customising it requires a paid plan; unentitled projects always run at the platform default of 10.
|
|
174
180
|
stripeSubscriptionId:
|
|
175
181
|
anyOf:
|
|
176
182
|
- type: string
|
|
@@ -250,6 +256,8 @@ GetCurrentProjectResponse:
|
|
|
250
256
|
- moduleUser
|
|
251
257
|
- moduleEvents
|
|
252
258
|
- allowPublicTickets
|
|
259
|
+
- errorAutocloseDays
|
|
260
|
+
- errorTicketMinOccurrences
|
|
253
261
|
- slug
|
|
254
262
|
- logo
|
|
255
263
|
- defaultEnv
|
|
@@ -462,5 +470,15 @@ UpdateProjectRequest:
|
|
|
462
470
|
minimum: 0.0001
|
|
463
471
|
maximum: 0.05
|
|
464
472
|
description: SRM chi-square p-value below which the run is called invalid.
|
|
473
|
+
errorAutocloseDays:
|
|
474
|
+
type: integer
|
|
475
|
+
minimum: 0
|
|
476
|
+
maximum: 365
|
|
477
|
+
description: Days an `open` tracked error may go unseen before the nightly sweep auto-resolves it. `0` disables auto-close for this project.
|
|
478
|
+
errorTicketMinOccurrences:
|
|
479
|
+
type: integer
|
|
480
|
+
minimum: 1
|
|
481
|
+
maximum: 10000
|
|
482
|
+
description: Occurrence count a tracked error must cross before an `error` ticket is auto-filed into the ops queue. Requires a paid plan — the request is rejected with 403 on a plan without the `ops_auto_error_issues` entitlement.
|
|
465
483
|
additionalProperties: false
|
|
466
484
|
description: "Body for `PATCH /api/admin/projects/{id}`. Partial — every field is optional; only supplied fields change. The project id in the path must match the caller's own project."
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
TaggableEntityType:
|
|
2
|
+
type: string
|
|
3
|
+
enum:
|
|
4
|
+
- ops
|
|
5
|
+
- flag
|
|
6
|
+
- config
|
|
7
|
+
- killswitch
|
|
8
|
+
- metric
|
|
9
|
+
- error
|
|
10
|
+
- alert_rule
|
|
11
|
+
- experiment
|
|
12
|
+
description: >-
|
|
13
|
+
The kind of item a tag set hangs off: `ops` (any queue item — bug, feature
|
|
14
|
+
request, error/alert/measure-plan ticket), `flag` (feature gate), `config`
|
|
15
|
+
(dynamic config), `killswitch`, `metric`, `error` (tracked error group),
|
|
16
|
+
`alert_rule`, or `experiment`.
|
|
17
|
+
TagName:
|
|
18
|
+
type: string
|
|
19
|
+
minLength: 1
|
|
20
|
+
maxLength: 64
|
|
21
|
+
description: A tag name. Trimmed; matched case-insensitively against the project's existing tags.
|
|
22
|
+
Tag:
|
|
23
|
+
type: object
|
|
24
|
+
properties:
|
|
25
|
+
id:
|
|
26
|
+
type: string
|
|
27
|
+
description: Stable opaque tag id.
|
|
28
|
+
name:
|
|
29
|
+
type: string
|
|
30
|
+
description: Display name — also the tag's identity, unique case-insensitively within the project.
|
|
31
|
+
required:
|
|
32
|
+
- id
|
|
33
|
+
- name
|
|
34
|
+
additionalProperties: false
|
|
35
|
+
ListTagsResponse:
|
|
36
|
+
type: array
|
|
37
|
+
items:
|
|
38
|
+
$ref: "#/Tag"
|
|
39
|
+
description: The project's tags, sorted by name.
|
|
40
|
+
EntityTagsResponse:
|
|
41
|
+
type: object
|
|
42
|
+
properties:
|
|
43
|
+
entityType:
|
|
44
|
+
$ref: "#/TaggableEntityType"
|
|
45
|
+
entityId:
|
|
46
|
+
type: string
|
|
47
|
+
description: The item's canonical id (the handle you passed, resolved).
|
|
48
|
+
tags:
|
|
49
|
+
type: array
|
|
50
|
+
items:
|
|
51
|
+
type: string
|
|
52
|
+
description: The tag names now attached to the item, sorted by name.
|
|
53
|
+
required:
|
|
54
|
+
- entityType
|
|
55
|
+
- entityId
|
|
56
|
+
- tags
|
|
57
|
+
additionalProperties: false
|
|
58
|
+
SetEntityTagsRequest:
|
|
59
|
+
type: object
|
|
60
|
+
properties:
|
|
61
|
+
tags:
|
|
62
|
+
type: array
|
|
63
|
+
maxItems: 50
|
|
64
|
+
items:
|
|
65
|
+
$ref: "#/TagName"
|
|
66
|
+
description: >-
|
|
67
|
+
The complete tag set the item should carry — tags not listed are
|
|
68
|
+
detached. Names are get-or-created (a new name mints a project tag),
|
|
69
|
+
deduped case-insensitively; `[]` clears every tag.
|
|
70
|
+
required:
|
|
71
|
+
- tags
|
|
72
|
+
additionalProperties: false
|
|
73
|
+
UpdateEntityTagsRequest:
|
|
74
|
+
type: object
|
|
75
|
+
properties:
|
|
76
|
+
add:
|
|
77
|
+
type: array
|
|
78
|
+
maxItems: 50
|
|
79
|
+
items:
|
|
80
|
+
$ref: "#/TagName"
|
|
81
|
+
default: []
|
|
82
|
+
description: Tag names to attach (get-or-created by name, case-insensitive). Already-attached names are a no-op.
|
|
83
|
+
remove:
|
|
84
|
+
type: array
|
|
85
|
+
maxItems: 50
|
|
86
|
+
items:
|
|
87
|
+
$ref: "#/TagName"
|
|
88
|
+
default: []
|
|
89
|
+
description: Tag names to detach (case-insensitive). Names the item doesn't carry are a no-op. A name in both lists is removed.
|
|
90
|
+
additionalProperties: false
|
|
91
|
+
description: Incremental tag edit — pass `add`, `remove`, or both. Every other tag on the item is left as is.
|
package/spec/openapi.yaml
CHANGED
|
@@ -218,6 +218,35 @@ tags:
|
|
|
218
218
|
the AI-write seam the cockpit's detail panel renders: `list` reads what a
|
|
219
219
|
previous run found, `create` appends a new record, and `update` fills in the
|
|
220
220
|
`working` run record you were handed (findings, PR, confidence) as you work.
|
|
221
|
+
- name: Questions
|
|
222
|
+
parent: Ops
|
|
223
|
+
description: |-
|
|
224
|
+
Structured questions an agent asks the team about a queue item — the
|
|
225
|
+
`AskUserQuestion` shape: a short `header`, the `question`, 2–4 `options`
|
|
226
|
+
(label + description), and `multiSelect` for checkboxes instead of radios.
|
|
227
|
+
Every question also accepts a free-text "Other" answer. Open questions sit
|
|
228
|
+
at the very top of the item's detail panel and mark the row in the queue.
|
|
229
|
+
|
|
230
|
+
**Asking.** `ask` posts 1–4 questions at once. Several agents (or several
|
|
231
|
+
runs) may have questions open on the same item at the same time.
|
|
232
|
+
|
|
233
|
+
**Getting the answer back.** `delivery: resume` (the default for a run
|
|
234
|
+
launched through a trigger connector) re-fires that same agent on the
|
|
235
|
+
item once every question its run asked is answered, continuing the same
|
|
236
|
+
run record with the answers in the prompt. `delivery: poll` (the default
|
|
237
|
+
for a live, connector-less session such as Claude Code in a terminal)
|
|
238
|
+
fires nothing — call `list` until the status reads `completed`.
|
|
239
|
+
- name: QA notes
|
|
240
|
+
parent: Ops
|
|
241
|
+
description: |-
|
|
242
|
+
Typed QA notes on a queue item — the QA follow-up that is not discussion.
|
|
243
|
+
Each note is one of four kinds: `narrowing` (only part of the bug still
|
|
244
|
+
fails), `clarification` (changes what "fixed" means), `verification` (a
|
|
245
|
+
`pass` / `fail` verdict on a fix) or `correction` (withdraws an earlier
|
|
246
|
+
framing). Notes are append-only, carry their author and time, and render in
|
|
247
|
+
their own section of the item's detail panel, separate from the comment
|
|
248
|
+
thread. A failing verification offers a "Reopen item" action in the
|
|
249
|
+
dashboard; it is always an explicit click, never a side effect of `create`.
|
|
221
250
|
- name: Projects
|
|
222
251
|
description: |-
|
|
223
252
|
Projects: the account-level container every other resource is scoped to.
|
|
@@ -260,6 +289,19 @@ tags:
|
|
|
260
289
|
Continue) schedule on their own surface — typically a GitHub Actions
|
|
261
290
|
`schedule:` cron running the platform's headless CLI with the shared
|
|
262
291
|
trigger prompt.
|
|
292
|
+
- name: Tags
|
|
293
|
+
description: |-
|
|
294
|
+
Tags: free-form, project-scoped labels any item can carry — queue items
|
|
295
|
+
(bugs, feature requests, error/alert tickets), flags, configs, kill
|
|
296
|
+
switches, metrics, tracked errors, alert rules, and experiments all share
|
|
297
|
+
one tag roster.
|
|
298
|
+
|
|
299
|
+
**Identity.** A tag is its name, unique case-insensitively per project. A
|
|
300
|
+
tag is born the first time it's attached — there is no separate create.
|
|
301
|
+
|
|
302
|
+
**Addressing.** An item is named by `entityType` + its handle (an ops
|
|
303
|
+
item's number, a resource's name, or any id). `set` replaces the full tag
|
|
304
|
+
set; `update` adds/removes names incrementally.
|
|
263
305
|
- name: Connectors
|
|
264
306
|
description: |-
|
|
265
307
|
Outbound integrations: the per-project destinations feedback + trigger
|
|
@@ -370,6 +412,14 @@ paths:
|
|
|
370
412
|
$ref: ./paths/ops.yaml#/~1api~1admin~1ops~1{handle}~1investigation
|
|
371
413
|
/api/admin/ops/{handle}/investigation/{investigationId}:
|
|
372
414
|
$ref: ./paths/ops.yaml#/~1api~1admin~1ops~1{handle}~1investigation~1{investigationId}
|
|
415
|
+
/api/admin/ops/{handle}/questions:
|
|
416
|
+
$ref: ./paths/ops.yaml#/~1api~1admin~1ops~1{handle}~1questions
|
|
417
|
+
/api/admin/ops/{handle}/questions/{questionId}/answer:
|
|
418
|
+
$ref: ./paths/ops.yaml#/~1api~1admin~1ops~1{handle}~1questions~1{questionId}~1answer
|
|
419
|
+
/api/admin/ops/{handle}/questions/{questionId}/cancel:
|
|
420
|
+
$ref: ./paths/ops.yaml#/~1api~1admin~1ops~1{handle}~1questions~1{questionId}~1cancel
|
|
421
|
+
/api/admin/ops/{handle}/qa-notes:
|
|
422
|
+
$ref: ./paths/ops.yaml#/~1api~1admin~1ops~1{handle}~1qa-notes
|
|
373
423
|
/api/admin/agent-profiles:
|
|
374
424
|
$ref: ./paths/ops.yaml#/~1api~1admin~1agent-profiles
|
|
375
425
|
/api/admin/ops/{handle}/comments:
|
|
@@ -434,10 +484,16 @@ paths:
|
|
|
434
484
|
$ref: ./paths/connectors.yaml#/~1api~1admin~1connectors~1trigger
|
|
435
485
|
/api/admin/keys:
|
|
436
486
|
$ref: ./paths/keys.yaml#/~1api~1admin~1keys
|
|
487
|
+
/api/admin/keys/{id}:
|
|
488
|
+
$ref: ./paths/keys.yaml#/~1api~1admin~1keys~1{id}
|
|
437
489
|
/api/admin/keys/{id}/revoke:
|
|
438
490
|
$ref: ./paths/keys.yaml#/~1api~1admin~1keys~1{id}~1revoke
|
|
439
491
|
/api/admin/search:
|
|
440
492
|
$ref: ./paths/search.yaml#/~1api~1admin~1search
|
|
493
|
+
/api/admin/tags:
|
|
494
|
+
$ref: ./paths/tags.yaml#/~1api~1admin~1tags
|
|
495
|
+
/api/admin/tags/{entityType}/{entityId}:
|
|
496
|
+
$ref: ./paths/tags.yaml#/~1api~1admin~1tags~1{entityType}~1{entityId}
|
|
441
497
|
components:
|
|
442
498
|
securitySchemes:
|
|
443
499
|
bearerSdkKey:
|
package/spec/paths/alerts.yaml
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
description: |-
|
|
6
6
|
Returns the project's FIRED alerts as a **bare JSON array** (no pagination envelope), ordered by `createdAt desc`. Defaults to the currently-firing ones (`status=active`); pass a `status` to widen to resolved/dismissed history or `all`.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
A fired alert is an **instance** of an alert rule, and an instance IS its ops queue item — the same row `/api/admin/ops` returns with `type: "alert"`, viewed through the alert lens. One rule produces many instances over its life and at most one is open at a time: when the condition clears the instance closes, and the next firing is a NEW instance with its own id and history. That is why `severity` reads off the rule (the queue item carries it as `priority`) and why resolving the queue item and clearing the alert are one act, not two rows to keep in step.
|
|
9
|
+
|
|
10
|
+
Instances are opened only by the platform — the UI's killswitch handlers plus the worker's analysis consumer and alerts cron — never filed by hand, so this surface is list + triage (via PATCH), with no create. The rules that *define* metric-threshold alerts live at `/api/admin/alert-rules`.
|
|
9
11
|
|
|
10
12
|
**Use case:** Snapshot what is currently firing for an on-call view or the home Alerts block, or pull `status=all` to audit how a noisy rule has behaved over time.
|
|
11
13
|
tags:
|
|
@@ -89,7 +91,7 @@
|
|
|
89
91
|
description: |-
|
|
90
92
|
Triage writes on one fired alert — the only mutations this surface allows. All body fields are optional (at least one required); only the fields present are changed.
|
|
91
93
|
|
|
92
|
-
- **`status`** — flip between `active` / `resolved` / `dismissed`. `resolved` and `dismissed` stamp `resolvedAt` / `dismissedAt`; `active` re-opens and clears both.
|
|
94
|
+
- **`status`** — flip between `active` / `resolved` / `dismissed`. `resolved` and `dismissed` stamp `resolvedAt` / `dismissedAt`; `active` re-opens and clears both. These write the underlying queue item's own status (`resolved` / `wont_fix` / `open`), so clearing an alert here and resolving it in the ops queue are the same act. A cleared instance is never revived: if the condition fires again it opens a NEW instance with its own id.
|
|
93
95
|
- **`assigneeId`** — the PERSON owner (a `users.id`), or `null` to unassign.
|
|
94
96
|
- **`agent`** — the AGENT owner: a connected trigger connector's id, or the built-in `"jarvis"` (**Enterprise plan only** — `403` otherwise), or `null` to clear. Person and agent halves are independent.
|
|
95
97
|
|
|
@@ -106,7 +108,7 @@
|
|
|
106
108
|
- name: id
|
|
107
109
|
in: path
|
|
108
110
|
required: true
|
|
109
|
-
description: Stable opaque
|
|
111
|
+
description: Stable opaque instance id — the same id as the `alert` ops item this instance is.
|
|
110
112
|
schema:
|
|
111
113
|
$ref: ../components/schemas/common.yaml#/ResourceId
|
|
112
114
|
requestBody:
|
package/spec/paths/i18n.yaml
CHANGED
|
@@ -128,11 +128,12 @@
|
|
|
128
128
|
- name: limit
|
|
129
129
|
in: query
|
|
130
130
|
required: false
|
|
131
|
-
description: Max keys to return (1–500).
|
|
131
|
+
description: Max keys to return (1–500). Defaults to 200.
|
|
132
132
|
schema:
|
|
133
133
|
type: integer
|
|
134
134
|
minimum: 1
|
|
135
135
|
maximum: 500
|
|
136
|
+
default: 200
|
|
136
137
|
- name: offset
|
|
137
138
|
in: query
|
|
138
139
|
required: false
|
package/spec/paths/keys.yaml
CHANGED
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
expires_at: null
|
|
33
33
|
created_by_email: ana@example.com
|
|
34
34
|
name: production back-end
|
|
35
|
+
description: Held by the checkout service; rotate with the quarterly credential sweep
|
|
35
36
|
scopes:
|
|
36
37
|
- gates:evaluate
|
|
37
38
|
- events:write
|
|
@@ -131,6 +132,84 @@
|
|
|
131
132
|
- PLAN_LIMIT
|
|
132
133
|
x-cli:
|
|
133
134
|
name: create
|
|
135
|
+
/api/admin/keys/{id}:
|
|
136
|
+
patch:
|
|
137
|
+
operationId: updateKey
|
|
138
|
+
summary: Update an API key's label
|
|
139
|
+
description: |-
|
|
140
|
+
Renames a key or re-notes what it is for. **Only `name` and `description` are editable** — everything that gives the key its authority (`type`, `env`, `scopes`, `expires_at`) is fixed at mint, because the worker derives the read env and permissions from the key itself. To change any of those, rotate: mint a replacement and revoke this one.
|
|
141
|
+
|
|
142
|
+
Omitted fields are left untouched; send `null` to clear one. Returns the updated key row. Revoked keys can still be relabelled (the audit trail outlives the credential). Returns `404` if no such key exists in the project.
|
|
143
|
+
|
|
144
|
+
**Use case:** A key minted by `shipeasy setup` carries an auto-composed provenance label — rename it to the service that actually holds it and note the rotation owner.
|
|
145
|
+
tags:
|
|
146
|
+
- API Keys
|
|
147
|
+
parameters:
|
|
148
|
+
- $ref: ../components/parameters.yaml#/ProjectId
|
|
149
|
+
- name: id
|
|
150
|
+
in: path
|
|
151
|
+
required: true
|
|
152
|
+
description: Stable opaque key id (UUID) returned by `create` / `list`.
|
|
153
|
+
schema:
|
|
154
|
+
$ref: ../components/schemas/common.yaml#/ResourceId
|
|
155
|
+
requestBody:
|
|
156
|
+
required: true
|
|
157
|
+
content:
|
|
158
|
+
application/json:
|
|
159
|
+
schema:
|
|
160
|
+
$ref: ../components/schemas/keys.yaml#/UpdateKeyRequest
|
|
161
|
+
examples:
|
|
162
|
+
rename:
|
|
163
|
+
summary: Rename and note the key
|
|
164
|
+
value:
|
|
165
|
+
name: checkout-service · production
|
|
166
|
+
description: Held by the checkout service; rotation owner is the payments team
|
|
167
|
+
clearDescription:
|
|
168
|
+
summary: Clear the note
|
|
169
|
+
value:
|
|
170
|
+
description: null
|
|
171
|
+
responses:
|
|
172
|
+
"200":
|
|
173
|
+
description: Update an API key's label
|
|
174
|
+
content:
|
|
175
|
+
application/json:
|
|
176
|
+
schema:
|
|
177
|
+
$ref: ../components/schemas/keys.yaml#/KeyRecord
|
|
178
|
+
example:
|
|
179
|
+
id: 3f2a9b1c-7d4e-4a8f-9c2b-1e5d6f7a8b90
|
|
180
|
+
type: server
|
|
181
|
+
env: prod
|
|
182
|
+
created_at: 2026-05-09T16:01:22.000Z
|
|
183
|
+
revoked_at: null
|
|
184
|
+
expires_at: null
|
|
185
|
+
created_by_email: ana@example.com
|
|
186
|
+
name: checkout-service · production
|
|
187
|
+
description: Held by the checkout service; rotation owner is the payments team
|
|
188
|
+
scopes:
|
|
189
|
+
- gates:evaluate
|
|
190
|
+
- events:write
|
|
191
|
+
last4: a1b2
|
|
192
|
+
"400":
|
|
193
|
+
$ref: ../components/responses.yaml#/BadRequest
|
|
194
|
+
"401":
|
|
195
|
+
$ref: ../components/responses.yaml#/Unauthorized
|
|
196
|
+
"403":
|
|
197
|
+
$ref: ../components/responses.yaml#/Forbidden
|
|
198
|
+
"404":
|
|
199
|
+
$ref: ../components/responses.yaml#/NotFound
|
|
200
|
+
"409":
|
|
201
|
+
$ref: ../components/responses.yaml#/Conflict
|
|
202
|
+
"422":
|
|
203
|
+
$ref: ../components/responses.yaml#/UnprocessableEntity
|
|
204
|
+
x-error-codes:
|
|
205
|
+
- UNAUTHORIZED
|
|
206
|
+
- FORBIDDEN
|
|
207
|
+
- NOT_FOUND
|
|
208
|
+
- VALIDATION
|
|
209
|
+
x-cli:
|
|
210
|
+
name: update
|
|
211
|
+
positional:
|
|
212
|
+
- id
|
|
134
213
|
/api/admin/keys/{id}/revoke:
|
|
135
214
|
post:
|
|
136
215
|
operationId: revokeKey
|
package/spec/paths/metrics.yaml
CHANGED
|
@@ -23,11 +23,14 @@
|
|
|
23
23
|
name: checkouts
|
|
24
24
|
folder: null
|
|
25
25
|
eventName: checkout_completed
|
|
26
|
-
query:
|
|
26
|
+
query: count(checkout_completed)
|
|
27
27
|
queryIr:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
v: 2
|
|
29
|
+
expr:
|
|
30
|
+
node: agg
|
|
31
|
+
event: checkout_completed
|
|
32
|
+
agg: { kind: count }
|
|
33
|
+
filters: []
|
|
31
34
|
direction: higher_better
|
|
32
35
|
version: 1
|
|
33
36
|
"400":
|
|
@@ -61,7 +64,7 @@
|
|
|
61
64
|
|
|
62
65
|
**Use cases**
|
|
63
66
|
|
|
64
|
-
- **Track an event** — `
|
|
67
|
+
- **Track an event** — `count(<event>)` for event counts.
|
|
65
68
|
- **Sum a value** — `sum(<event>, <label>)` for revenue / quantity metrics.
|
|
66
69
|
- **Experiment success metric** — create the metric, then attach its id to an experiment.
|
|
67
70
|
tags:
|
|
@@ -75,13 +78,13 @@
|
|
|
75
78
|
schema:
|
|
76
79
|
$ref: ../components/schemas/metrics.yaml#/CreateMetricRequest
|
|
77
80
|
examples:
|
|
78
|
-
|
|
79
|
-
summary: Count
|
|
80
|
-
description:
|
|
81
|
+
countEvents:
|
|
82
|
+
summary: Count an event (DSL)
|
|
83
|
+
description: Completed checkouts, expressed with the query DSL.
|
|
81
84
|
value:
|
|
82
85
|
name: checkouts
|
|
83
86
|
event_name: checkout_completed
|
|
84
|
-
query:
|
|
87
|
+
query: count(checkout_completed)
|
|
85
88
|
sumRevenue:
|
|
86
89
|
summary: Sum a value label (DSL)
|
|
87
90
|
description: Total revenue, summing the `amount` property of the `purchase` event.
|
|
@@ -98,10 +101,13 @@
|
|
|
98
101
|
name: checkouts
|
|
99
102
|
event_name: checkout_completed
|
|
100
103
|
query_ir:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
v: 2
|
|
105
|
+
expr:
|
|
106
|
+
node: agg
|
|
107
|
+
event: checkout_completed
|
|
108
|
+
agg:
|
|
109
|
+
kind: count
|
|
110
|
+
filters: []
|
|
105
111
|
responses:
|
|
106
112
|
"201":
|
|
107
113
|
description: Create a metric
|
|
@@ -179,10 +185,13 @@
|
|
|
179
185
|
eventName: purchase
|
|
180
186
|
query: sum(purchase, amount)
|
|
181
187
|
queryIr:
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
188
|
+
v: 2
|
|
189
|
+
expr:
|
|
190
|
+
node: agg
|
|
191
|
+
event: purchase
|
|
192
|
+
agg: { kind: sum }
|
|
193
|
+
valueLabel: amount
|
|
194
|
+
filters: []
|
|
186
195
|
direction: higher_better
|
|
187
196
|
winsorizePct: 99
|
|
188
197
|
version: 1
|