@proveanything/smartlinks 2.0.30 → 2.0.31

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.
@@ -1,4 +1,4 @@
1
- import type { IntegrationFlow, CreateFlowInput, UpdateFlowInput, ListFlowsQuery, FlowList, RunFlowInput, RunFlowResult, RunFlowSummary, RunFlowEnqueued, RecordTypesResponse } from "../types/integrations.js";
1
+ import type { IntegrationFlow, CreateFlowInput, UpdateFlowInput, ListFlowsQuery, FlowList, RunFlowInput, RunFlowResult, RunFlowSummary, RunFlowEnqueued, RecordTypesResponse, FlowRun, ListRunsQuery, RunList, ListRunItemsQuery, RunItemList, LoggingWindow, SetLoggingInput } from "../types/integrations.js";
2
2
  export declare namespace integrations {
3
3
  /** List flows in a collection. GET /integrations/flows */
4
4
  function listFlows(collectionId: string, query?: ListFlowsQuery): Promise<FlowList>;
@@ -31,4 +31,30 @@ export declare namespace integrations {
31
31
  function isRunSummary(r: RunFlowResult): r is RunFlowSummary;
32
32
  /** Type guard: the run was enqueued (async). */
33
33
  function isRunEnqueued(r: RunFlowResult): r is RunFlowEnqueued;
34
+ /** List a flow's runs, newest first. GET /integrations/flows/:id/runs */
35
+ function listRuns(collectionId: string, flowId: string, query?: ListRunsQuery): Promise<RunList>;
36
+ /** Get one run's summary. GET /integrations/flows/:id/runs/:runId */
37
+ function getRun(collectionId: string, flowId: string, runId: string): Promise<FlowRun>;
38
+ /**
39
+ * List a run's per-record items. GET /integrations/flows/:id/runs/:runId/items
40
+ * `request`/`response` are populated only for items captured while enhanced logging
41
+ * was active (and before the 24h body purge).
42
+ */
43
+ function listRunItems(collectionId: string, flowId: string, runId: string, query?: ListRunItemsQuery): Promise<RunItemList>;
44
+ /** Every run touching an entity (e.g. a product), across flows. GET /integrations/runs/entity/:entityId */
45
+ function listEntityRuns(collectionId: string, entityId: string, query?: {
46
+ limit?: number;
47
+ }): Promise<RunList>;
48
+ /** Is enhanced logging active for a connection? GET /integrations/logging/:connectionId */
49
+ function getLogging(collectionId: string, connectionId: string): Promise<{
50
+ window: LoggingWindow | null;
51
+ }>;
52
+ /** Enable enhanced logging. POST /integrations/logging/:connectionId (omit ttlMinutes = until cancelled) */
53
+ function setLogging(collectionId: string, connectionId: string, input?: SetLoggingInput): Promise<{
54
+ window: LoggingWindow;
55
+ }>;
56
+ /** Cancel enhanced logging now. DELETE /integrations/logging/:connectionId */
57
+ function cancelLogging(collectionId: string, connectionId: string): Promise<{
58
+ canceled: boolean;
59
+ }>;
34
60
  }
@@ -88,4 +88,51 @@ export var integrations;
88
88
  return r.enqueued === true;
89
89
  }
90
90
  integrations.isRunEnqueued = isRunEnqueued;
91
+ // --- Run logs -----------------------------------------------------------
92
+ // A run row is written for every execution (manual, event, scheduled, test). Per-record
93
+ // request/response detail is captured only while enhanced logging is active for the
94
+ // connection (see setLogging); otherwise runs carry metadata only.
95
+ /** List a flow's runs, newest first. GET /integrations/flows/:id/runs */
96
+ async function listRuns(collectionId, flowId, query = {}) {
97
+ return request(`${base(collectionId)}/${enc(flowId)}/runs${encodeQuery(query)}`);
98
+ }
99
+ integrations.listRuns = listRuns;
100
+ /** Get one run's summary. GET /integrations/flows/:id/runs/:runId */
101
+ async function getRun(collectionId, flowId, runId) {
102
+ return request(`${base(collectionId)}/${enc(flowId)}/runs/${enc(runId)}`);
103
+ }
104
+ integrations.getRun = getRun;
105
+ /**
106
+ * List a run's per-record items. GET /integrations/flows/:id/runs/:runId/items
107
+ * `request`/`response` are populated only for items captured while enhanced logging
108
+ * was active (and before the 24h body purge).
109
+ */
110
+ async function listRunItems(collectionId, flowId, runId, query = {}) {
111
+ return request(`${base(collectionId)}/${enc(flowId)}/runs/${enc(runId)}/items${encodeQuery(query)}`);
112
+ }
113
+ integrations.listRunItems = listRunItems;
114
+ /** Every run touching an entity (e.g. a product), across flows. GET /integrations/runs/entity/:entityId */
115
+ async function listEntityRuns(collectionId, entityId, query = {}) {
116
+ return request(`/admin/collection/${enc(collectionId)}/integrations/runs/entity/${enc(entityId)}${encodeQuery(query)}`);
117
+ }
118
+ integrations.listEntityRuns = listEntityRuns;
119
+ // --- Enhanced logging window (per connection) ---------------------------
120
+ // Full request/response capture is off by default. Turn it on for a connection while
121
+ // debugging; it applies to every flow on that connection and auto-expires (or runs until
122
+ // cancelled). Bodies are redacted at capture and purged after 24h.
123
+ /** Is enhanced logging active for a connection? GET /integrations/logging/:connectionId */
124
+ async function getLogging(collectionId, connectionId) {
125
+ return request(`/admin/collection/${enc(collectionId)}/integrations/logging/${enc(connectionId)}`);
126
+ }
127
+ integrations.getLogging = getLogging;
128
+ /** Enable enhanced logging. POST /integrations/logging/:connectionId (omit ttlMinutes = until cancelled) */
129
+ async function setLogging(collectionId, connectionId, input = {}) {
130
+ return post(`/admin/collection/${enc(collectionId)}/integrations/logging/${enc(connectionId)}`, input);
131
+ }
132
+ integrations.setLogging = setLogging;
133
+ /** Cancel enhanced logging now. DELETE /integrations/logging/:connectionId */
134
+ async function cancelLogging(collectionId, connectionId) {
135
+ return del(`/admin/collection/${enc(collectionId)}/integrations/logging/${enc(connectionId)}`);
136
+ }
137
+ integrations.cancelLogging = cancelLogging;
91
138
  })(integrations || (integrations = {}));
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.0.30 | Generated: 2026-09-29T17:13:26.956Z
3
+ Version: 2.0.31 | Generated: 2026-09-29T19:37:17.528Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -6562,6 +6562,7 @@ interface FlowList {
6562
6562
  ```typescript
6563
6563
  interface RunFlowInput {
6564
6564
  entityId?: string
6565
+ trigger?: RunTrigger
6565
6566
  }
6566
6567
  ```
6567
6568
 
@@ -6574,6 +6575,128 @@ interface RunFlowSummary {
6574
6575
  sent: number
6575
6576
  failed: number
6576
6577
  status: RunStatus
6578
+ runId?: string
6579
+ }
6580
+ ```
6581
+
6582
+ **CapturedRequest** (interface)
6583
+ ```typescript
6584
+ interface CapturedRequest {
6585
+ transport: string
6586
+ method: string
6587
+ url: string
6588
+ headers: Record<string, string>
6589
+ partitionKey?: string
6590
+ body: unknown
6591
+ bodyBytes: number
6592
+ truncated: boolean
6593
+ }
6594
+ ```
6595
+
6596
+ **CapturedResponse** (interface)
6597
+ ```typescript
6598
+ interface CapturedResponse {
6599
+ status: number | null
6600
+ ok: boolean | null
6601
+ headers: Record<string, string>
6602
+ body: unknown
6603
+ bodyBytes: number
6604
+ truncated: boolean
6605
+ error: string | null
6606
+ }
6607
+ ```
6608
+
6609
+ **FlowRun** (interface)
6610
+ ```typescript
6611
+ interface FlowRun {
6612
+ id: string
6613
+ flowId: string
6614
+ connectionId?: string | null
6615
+ trigger: RunTrigger
6616
+ triggerEvent?: string | null
6617
+ triggerEntityId?: string | null
6618
+ status: FlowRunStatus
6619
+ records: number
6620
+ sent: number
6621
+ failed: number
6622
+ error?: string | null
6623
+ correlationId?: string | null
6624
+ captureLevel: CaptureLevel
6625
+ bodiesPurged: boolean
6626
+ startedAt: string
6627
+ completedAt?: string | null
6628
+ durationMs?: number | null
6629
+ }
6630
+ ```
6631
+
6632
+ **FlowRunItem** (interface)
6633
+ ```typescript
6634
+ interface FlowRunItem {
6635
+ id: string
6636
+ runId: string
6637
+ entityType: string
6638
+ entityId?: string | null
6639
+ entityLabel?: string | null
6640
+ status: FlowRunItemStatus
6641
+ skipReason?: string | null
6642
+ request?: CapturedRequest | null
6643
+ response?: CapturedResponse | null
6644
+ attempt: number
6645
+ durationMs?: number | null
6646
+ createdAt: string
6647
+ }
6648
+ ```
6649
+
6650
+ **ListRunsQuery** (interface)
6651
+ ```typescript
6652
+ interface ListRunsQuery {
6653
+ status?: FlowRunStatus
6654
+ trigger?: RunTrigger
6655
+ entityId?: string
6656
+ limit?: number
6657
+ cursor?: string
6658
+ }
6659
+ ```
6660
+
6661
+ **RunList** (interface)
6662
+ ```typescript
6663
+ interface RunList {
6664
+ runs: FlowRun[]; nextCursor?: string
6665
+ }
6666
+ ```
6667
+
6668
+ **ListRunItemsQuery** (interface)
6669
+ ```typescript
6670
+ interface ListRunItemsQuery {
6671
+ status?: FlowRunItemStatus; limit?: number; cursor?: string
6672
+ }
6673
+ ```
6674
+
6675
+ **RunItemList** (interface)
6676
+ ```typescript
6677
+ interface RunItemList {
6678
+ items: FlowRunItem[]; nextCursor?: string
6679
+ }
6680
+ ```
6681
+
6682
+ **LoggingWindow** (interface)
6683
+ ```typescript
6684
+ interface LoggingWindow {
6685
+ id: string
6686
+ connectionId: string
6687
+ level: CaptureLevel
6688
+ enabledBy?: string | null
6689
+ enabledAt: string
6690
+ expiresAt?: string | null
6691
+ canceledAt?: string | null
6692
+ }
6693
+ ```
6694
+
6695
+ **SetLoggingInput** (interface)
6696
+ ```typescript
6697
+ interface SetLoggingInput {
6698
+ ttlMinutes?: number
6699
+ level?: 'full' | 'errors_only'
6577
6700
  }
6578
6701
  ```
6579
6702
 
@@ -6660,6 +6783,14 @@ interface RecordTypesResponse {
6660
6783
 
6661
6784
  **UpdateFlowInput** = `Partial<Omit<CreateFlowInput, 'direction'>> & {`
6662
6785
 
6786
+ **RunTrigger** = `'manual' | 'event' | 'schedule' | 'test'`
6787
+
6788
+ **FlowRunStatus** = `'running' | 'success' | 'partial' | 'failed' | 'skipped'`
6789
+
6790
+ **FlowRunItemStatus** = `'sent' | 'failed' | 'skipped'`
6791
+
6792
+ **CaptureLevel** = `'metadata' | 'errors_only' | 'full'`
6793
+
6663
6794
  **RunFlowResult** = `RunFlowSummary | RunFlowEnqueued`
6664
6795
 
6665
6796
  ### interaction
@@ -10850,6 +10981,27 @@ Type guard: the run executed inline and returned a summary.
10850
10981
  **isRunEnqueued**(r: RunFlowResult) → `r is RunFlowEnqueued`
10851
10982
  Type guard: the run was enqueued (async).
10852
10983
 
10984
+ **listRuns**(collectionId: string, flowId: string, query: ListRunsQuery = {}) → `Promise<RunList>`
10985
+ List a flow's runs, newest first. GET /integrations/flows/:id/runs
10986
+
10987
+ **getRun**(collectionId: string, flowId: string, runId: string) → `Promise<FlowRun>`
10988
+ Get one run's summary. GET /integrations/flows/:id/runs/:runId
10989
+
10990
+ **listRunItems**(collectionId: string, flowId: string, runId: string, query: ListRunItemsQuery = {}) → `Promise<RunItemList>`
10991
+ List a run's per-record items. GET /integrations/flows/:id/runs/:runId/items `request`/`response` are populated only for items captured while enhanced logging was active (and before the 24h body purge).
10992
+
10993
+ **listEntityRuns**(collectionId: string, entityId: string, query: { limit?: number } = {}) → `Promise<RunList>`
10994
+ Every run touching an entity (e.g. a product), across flows. GET /integrations/runs/entity/:entityId
10995
+
10996
+ **getLogging**(collectionId: string, connectionId: string) → `Promise<`
10997
+ Is enhanced logging active for a connection? GET /integrations/logging/:connectionId
10998
+
10999
+ **setLogging**(collectionId: string, connectionId: string, input: SetLoggingInput = {}) → `Promise<`
11000
+ Enable enhanced logging. POST /integrations/logging/:connectionId (omit ttlMinutes = until cancelled)
11001
+
11002
+ **cancelLogging**(collectionId: string, connectionId: string) → `Promise<`
11003
+ Cancel enhanced logging now. DELETE /integrations/logging/:connectionId
11004
+
10853
11005
  ### interactions
10854
11006
 
10855
11007
  **query**(collectionId: string,
package/dist/openapi.yaml CHANGED
@@ -4444,6 +4444,38 @@ paths:
4444
4444
  description: Unauthorized
4445
4445
  404:
4446
4446
  description: Not found
4447
+ /admin/collection/{collectionId}/integrations/runs/entity/{entityId}:
4448
+ get:
4449
+ tags:
4450
+ - integrations
4451
+ summary: Every run touching an entity (e.g.
4452
+ operationId: integrations_listEntityRuns
4453
+ security:
4454
+ - bearerAuth: []
4455
+ parameters:
4456
+ - name: collectionId
4457
+ in: path
4458
+ required: true
4459
+ schema:
4460
+ type: string
4461
+ - name: entityId
4462
+ in: path
4463
+ required: true
4464
+ schema:
4465
+ type: string
4466
+ responses:
4467
+ 200:
4468
+ description: Success
4469
+ content:
4470
+ application/json:
4471
+ schema:
4472
+ $ref: "#/components/schemas/RunList"
4473
+ 400:
4474
+ description: Bad request
4475
+ 401:
4476
+ description: Unauthorized
4477
+ 404:
4478
+ description: Not found
4447
4479
  /admin/collection/{collectionId}/interactions:
4448
4480
  get:
4449
4481
  tags:
@@ -25250,6 +25282,8 @@ components:
25250
25282
  properties:
25251
25283
  entityId:
25252
25284
  type: string
25285
+ trigger:
25286
+ $ref: "#/components/schemas/RunTrigger"
25253
25287
  RunFlowSummary:
25254
25288
  type: object
25255
25289
  properties:
@@ -25265,6 +25299,8 @@ components:
25265
25299
  type: number
25266
25300
  status:
25267
25301
  $ref: "#/components/schemas/RunStatus"
25302
+ runId:
25303
+ type: string
25268
25304
  required:
25269
25305
  - flowId
25270
25306
  - direction
@@ -25272,6 +25308,209 @@ components:
25272
25308
  - sent
25273
25309
  - failed
25274
25310
  - status
25311
+ CapturedRequest:
25312
+ type: object
25313
+ properties:
25314
+ transport:
25315
+ type: string
25316
+ method:
25317
+ type: string
25318
+ url:
25319
+ type: string
25320
+ headers:
25321
+ type: object
25322
+ additionalProperties:
25323
+ type: string
25324
+ partitionKey:
25325
+ type: string
25326
+ body: {}
25327
+ bodyBytes:
25328
+ type: number
25329
+ truncated:
25330
+ type: boolean
25331
+ required:
25332
+ - transport
25333
+ - method
25334
+ - url
25335
+ - headers
25336
+ - body
25337
+ - bodyBytes
25338
+ - truncated
25339
+ CapturedResponse:
25340
+ type: object
25341
+ properties:
25342
+ status:
25343
+ type: number
25344
+ ok:
25345
+ type: boolean
25346
+ headers:
25347
+ type: object
25348
+ additionalProperties:
25349
+ type: string
25350
+ body: {}
25351
+ bodyBytes:
25352
+ type: number
25353
+ truncated:
25354
+ type: boolean
25355
+ error:
25356
+ type: string
25357
+ required:
25358
+ - status
25359
+ - ok
25360
+ - headers
25361
+ - body
25362
+ - bodyBytes
25363
+ - truncated
25364
+ - error
25365
+ FlowRun:
25366
+ type: object
25367
+ properties:
25368
+ id:
25369
+ type: string
25370
+ flowId:
25371
+ type: string
25372
+ connectionId:
25373
+ type: string
25374
+ trigger:
25375
+ $ref: "#/components/schemas/RunTrigger"
25376
+ triggerEvent:
25377
+ type: string
25378
+ triggerEntityId:
25379
+ type: string
25380
+ status:
25381
+ $ref: "#/components/schemas/FlowRunStatus"
25382
+ records:
25383
+ type: number
25384
+ sent:
25385
+ type: number
25386
+ failed:
25387
+ type: number
25388
+ error:
25389
+ type: string
25390
+ correlationId:
25391
+ type: string
25392
+ captureLevel:
25393
+ $ref: "#/components/schemas/CaptureLevel"
25394
+ bodiesPurged:
25395
+ type: boolean
25396
+ startedAt:
25397
+ type: string
25398
+ completedAt:
25399
+ type: string
25400
+ durationMs:
25401
+ type: number
25402
+ required:
25403
+ - id
25404
+ - flowId
25405
+ - trigger
25406
+ - status
25407
+ - records
25408
+ - sent
25409
+ - failed
25410
+ - captureLevel
25411
+ - bodiesPurged
25412
+ - startedAt
25413
+ FlowRunItem:
25414
+ type: object
25415
+ properties:
25416
+ id:
25417
+ type: string
25418
+ runId:
25419
+ type: string
25420
+ entityType:
25421
+ type: string
25422
+ entityId:
25423
+ type: string
25424
+ entityLabel:
25425
+ type: string
25426
+ status:
25427
+ $ref: "#/components/schemas/FlowRunItemStatus"
25428
+ skipReason:
25429
+ type: string
25430
+ request:
25431
+ $ref: "#/components/schemas/CapturedRequest"
25432
+ response:
25433
+ $ref: "#/components/schemas/CapturedResponse"
25434
+ attempt:
25435
+ type: number
25436
+ durationMs:
25437
+ type: number
25438
+ createdAt:
25439
+ type: string
25440
+ required:
25441
+ - id
25442
+ - runId
25443
+ - entityType
25444
+ - status
25445
+ - attempt
25446
+ - createdAt
25447
+ ListRunsQuery:
25448
+ type: object
25449
+ properties:
25450
+ status:
25451
+ $ref: "#/components/schemas/FlowRunStatus"
25452
+ trigger:
25453
+ $ref: "#/components/schemas/RunTrigger"
25454
+ entityId:
25455
+ type: string
25456
+ limit:
25457
+ type: number
25458
+ cursor:
25459
+ type: string
25460
+ RunList:
25461
+ type: object
25462
+ properties:
25463
+ runs:
25464
+ type: object
25465
+ additionalProperties: true
25466
+ required:
25467
+ - runs
25468
+ ListRunItemsQuery:
25469
+ type: object
25470
+ properties:
25471
+ status:
25472
+ type: object
25473
+ additionalProperties: true
25474
+ RunItemList:
25475
+ type: object
25476
+ properties:
25477
+ items:
25478
+ type: object
25479
+ additionalProperties: true
25480
+ required:
25481
+ - items
25482
+ LoggingWindow:
25483
+ type: object
25484
+ properties:
25485
+ id:
25486
+ type: string
25487
+ connectionId:
25488
+ type: string
25489
+ level:
25490
+ $ref: "#/components/schemas/CaptureLevel"
25491
+ enabledBy:
25492
+ type: string
25493
+ enabledAt:
25494
+ type: string
25495
+ expiresAt:
25496
+ type: string
25497
+ canceledAt:
25498
+ type: string
25499
+ required:
25500
+ - id
25501
+ - connectionId
25502
+ - level
25503
+ - enabledAt
25504
+ SetLoggingInput:
25505
+ type: object
25506
+ properties:
25507
+ ttlMinutes:
25508
+ type: number
25509
+ level:
25510
+ type: string
25511
+ enum:
25512
+ - full
25513
+ - errors_only
25275
25514
  RunFlowEnqueued:
25276
25515
  type: object
25277
25516
  properties:
@@ -25410,6 +25649,33 @@ components:
25410
25649
  - none
25411
25650
  UpdateFlowInput:
25412
25651
  $ref: "#/components/schemas/CreateFlowInput"
25652
+ RunTrigger:
25653
+ type: string
25654
+ enum:
25655
+ - manual
25656
+ - event
25657
+ - schedule
25658
+ - test
25659
+ FlowRunStatus:
25660
+ type: string
25661
+ enum:
25662
+ - running
25663
+ - success
25664
+ - partial
25665
+ - failed
25666
+ - skipped
25667
+ FlowRunItemStatus:
25668
+ type: string
25669
+ enum:
25670
+ - sent
25671
+ - failed
25672
+ - skipped
25673
+ CaptureLevel:
25674
+ type: string
25675
+ enum:
25676
+ - metadata
25677
+ - errors_only
25678
+ - full
25413
25679
  RunFlowResult:
25414
25680
  anyOf:
25415
25681
  - $ref: "#/components/schemas/RunFlowSummary"
@@ -87,6 +87,8 @@ export interface FlowList {
87
87
  export interface RunFlowInput {
88
88
  /** Run for a single source entity; omit for the flow's scheduled gather. */
89
89
  entityId?: string;
90
+ /** Trigger label recorded on the run (e.g. 'test' for a test send). Default 'manual'. */
91
+ trigger?: RunTrigger;
90
92
  }
91
93
  /** Inline (synchronous) run summary. */
92
94
  export interface RunFlowSummary {
@@ -96,6 +98,104 @@ export interface RunFlowSummary {
96
98
  sent: number;
97
99
  failed: number;
98
100
  status: RunStatus;
101
+ /** Id of the persisted run row (deep-link into its detail). */
102
+ runId?: string;
103
+ }
104
+ export type RunTrigger = 'manual' | 'event' | 'schedule' | 'test';
105
+ export type FlowRunStatus = 'running' | 'success' | 'partial' | 'failed' | 'skipped';
106
+ export type FlowRunItemStatus = 'sent' | 'failed' | 'skipped';
107
+ export type CaptureLevel = 'metadata' | 'errors_only' | 'full';
108
+ /** A redacted outbound request as captured in a run item (secrets masked, body size-capped). */
109
+ export interface CapturedRequest {
110
+ transport: string;
111
+ method: string;
112
+ url: string;
113
+ headers: Record<string, string>;
114
+ partitionKey?: string;
115
+ body: unknown;
116
+ bodyBytes: number;
117
+ truncated: boolean;
118
+ }
119
+ /** A redacted response as captured in a run item. */
120
+ export interface CapturedResponse {
121
+ status: number | null;
122
+ ok: boolean | null;
123
+ headers: Record<string, string>;
124
+ body: unknown;
125
+ bodyBytes: number;
126
+ truncated: boolean;
127
+ error: string | null;
128
+ }
129
+ /** One run of a flow. */
130
+ export interface FlowRun {
131
+ id: string;
132
+ flowId: string;
133
+ connectionId?: string | null;
134
+ trigger: RunTrigger;
135
+ triggerEvent?: string | null;
136
+ triggerEntityId?: string | null;
137
+ status: FlowRunStatus;
138
+ records: number;
139
+ sent: number;
140
+ failed: number;
141
+ error?: string | null;
142
+ correlationId?: string | null;
143
+ captureLevel: CaptureLevel;
144
+ bodiesPurged: boolean;
145
+ startedAt: string;
146
+ completedAt?: string | null;
147
+ durationMs?: number | null;
148
+ }
149
+ /** One record's attempt within a run (request/response present only when captured at 'full'). */
150
+ export interface FlowRunItem {
151
+ id: string;
152
+ runId: string;
153
+ entityType: string;
154
+ entityId?: string | null;
155
+ entityLabel?: string | null;
156
+ status: FlowRunItemStatus;
157
+ skipReason?: string | null;
158
+ request?: CapturedRequest | null;
159
+ response?: CapturedResponse | null;
160
+ attempt: number;
161
+ durationMs?: number | null;
162
+ createdAt: string;
163
+ }
164
+ export interface ListRunsQuery {
165
+ status?: FlowRunStatus;
166
+ trigger?: RunTrigger;
167
+ entityId?: string;
168
+ limit?: number;
169
+ cursor?: string;
170
+ }
171
+ export interface RunList {
172
+ runs: FlowRun[];
173
+ nextCursor?: string;
174
+ }
175
+ export interface ListRunItemsQuery {
176
+ status?: FlowRunItemStatus;
177
+ limit?: number;
178
+ cursor?: string;
179
+ }
180
+ export interface RunItemList {
181
+ items: FlowRunItem[];
182
+ nextCursor?: string;
183
+ }
184
+ /** A per-connection enhanced-logging window (full capture) while active. */
185
+ export interface LoggingWindow {
186
+ id: string;
187
+ connectionId: string;
188
+ level: CaptureLevel;
189
+ enabledBy?: string | null;
190
+ enabledAt: string;
191
+ expiresAt?: string | null;
192
+ canceledAt?: string | null;
193
+ }
194
+ export interface SetLoggingInput {
195
+ /** Minutes until the window auto-expires; omit for on-until-cancelled. */
196
+ ttlMinutes?: number;
197
+ /** Capture level while active (default 'full'). */
198
+ level?: 'full' | 'errors_only';
99
199
  }
100
200
  /** Response when a run is enqueued (?async=true). */
101
201
  export interface RunFlowEnqueued {
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.0.30 | Generated: 2026-09-29T17:13:26.956Z
3
+ Version: 2.0.31 | Generated: 2026-09-29T19:37:17.528Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -6562,6 +6562,7 @@ interface FlowList {
6562
6562
  ```typescript
6563
6563
  interface RunFlowInput {
6564
6564
  entityId?: string
6565
+ trigger?: RunTrigger
6565
6566
  }
6566
6567
  ```
6567
6568
 
@@ -6574,6 +6575,128 @@ interface RunFlowSummary {
6574
6575
  sent: number
6575
6576
  failed: number
6576
6577
  status: RunStatus
6578
+ runId?: string
6579
+ }
6580
+ ```
6581
+
6582
+ **CapturedRequest** (interface)
6583
+ ```typescript
6584
+ interface CapturedRequest {
6585
+ transport: string
6586
+ method: string
6587
+ url: string
6588
+ headers: Record<string, string>
6589
+ partitionKey?: string
6590
+ body: unknown
6591
+ bodyBytes: number
6592
+ truncated: boolean
6593
+ }
6594
+ ```
6595
+
6596
+ **CapturedResponse** (interface)
6597
+ ```typescript
6598
+ interface CapturedResponse {
6599
+ status: number | null
6600
+ ok: boolean | null
6601
+ headers: Record<string, string>
6602
+ body: unknown
6603
+ bodyBytes: number
6604
+ truncated: boolean
6605
+ error: string | null
6606
+ }
6607
+ ```
6608
+
6609
+ **FlowRun** (interface)
6610
+ ```typescript
6611
+ interface FlowRun {
6612
+ id: string
6613
+ flowId: string
6614
+ connectionId?: string | null
6615
+ trigger: RunTrigger
6616
+ triggerEvent?: string | null
6617
+ triggerEntityId?: string | null
6618
+ status: FlowRunStatus
6619
+ records: number
6620
+ sent: number
6621
+ failed: number
6622
+ error?: string | null
6623
+ correlationId?: string | null
6624
+ captureLevel: CaptureLevel
6625
+ bodiesPurged: boolean
6626
+ startedAt: string
6627
+ completedAt?: string | null
6628
+ durationMs?: number | null
6629
+ }
6630
+ ```
6631
+
6632
+ **FlowRunItem** (interface)
6633
+ ```typescript
6634
+ interface FlowRunItem {
6635
+ id: string
6636
+ runId: string
6637
+ entityType: string
6638
+ entityId?: string | null
6639
+ entityLabel?: string | null
6640
+ status: FlowRunItemStatus
6641
+ skipReason?: string | null
6642
+ request?: CapturedRequest | null
6643
+ response?: CapturedResponse | null
6644
+ attempt: number
6645
+ durationMs?: number | null
6646
+ createdAt: string
6647
+ }
6648
+ ```
6649
+
6650
+ **ListRunsQuery** (interface)
6651
+ ```typescript
6652
+ interface ListRunsQuery {
6653
+ status?: FlowRunStatus
6654
+ trigger?: RunTrigger
6655
+ entityId?: string
6656
+ limit?: number
6657
+ cursor?: string
6658
+ }
6659
+ ```
6660
+
6661
+ **RunList** (interface)
6662
+ ```typescript
6663
+ interface RunList {
6664
+ runs: FlowRun[]; nextCursor?: string
6665
+ }
6666
+ ```
6667
+
6668
+ **ListRunItemsQuery** (interface)
6669
+ ```typescript
6670
+ interface ListRunItemsQuery {
6671
+ status?: FlowRunItemStatus; limit?: number; cursor?: string
6672
+ }
6673
+ ```
6674
+
6675
+ **RunItemList** (interface)
6676
+ ```typescript
6677
+ interface RunItemList {
6678
+ items: FlowRunItem[]; nextCursor?: string
6679
+ }
6680
+ ```
6681
+
6682
+ **LoggingWindow** (interface)
6683
+ ```typescript
6684
+ interface LoggingWindow {
6685
+ id: string
6686
+ connectionId: string
6687
+ level: CaptureLevel
6688
+ enabledBy?: string | null
6689
+ enabledAt: string
6690
+ expiresAt?: string | null
6691
+ canceledAt?: string | null
6692
+ }
6693
+ ```
6694
+
6695
+ **SetLoggingInput** (interface)
6696
+ ```typescript
6697
+ interface SetLoggingInput {
6698
+ ttlMinutes?: number
6699
+ level?: 'full' | 'errors_only'
6577
6700
  }
6578
6701
  ```
6579
6702
 
@@ -6660,6 +6783,14 @@ interface RecordTypesResponse {
6660
6783
 
6661
6784
  **UpdateFlowInput** = `Partial<Omit<CreateFlowInput, 'direction'>> & {`
6662
6785
 
6786
+ **RunTrigger** = `'manual' | 'event' | 'schedule' | 'test'`
6787
+
6788
+ **FlowRunStatus** = `'running' | 'success' | 'partial' | 'failed' | 'skipped'`
6789
+
6790
+ **FlowRunItemStatus** = `'sent' | 'failed' | 'skipped'`
6791
+
6792
+ **CaptureLevel** = `'metadata' | 'errors_only' | 'full'`
6793
+
6663
6794
  **RunFlowResult** = `RunFlowSummary | RunFlowEnqueued`
6664
6795
 
6665
6796
  ### interaction
@@ -10850,6 +10981,27 @@ Type guard: the run executed inline and returned a summary.
10850
10981
  **isRunEnqueued**(r: RunFlowResult) → `r is RunFlowEnqueued`
10851
10982
  Type guard: the run was enqueued (async).
10852
10983
 
10984
+ **listRuns**(collectionId: string, flowId: string, query: ListRunsQuery = {}) → `Promise<RunList>`
10985
+ List a flow's runs, newest first. GET /integrations/flows/:id/runs
10986
+
10987
+ **getRun**(collectionId: string, flowId: string, runId: string) → `Promise<FlowRun>`
10988
+ Get one run's summary. GET /integrations/flows/:id/runs/:runId
10989
+
10990
+ **listRunItems**(collectionId: string, flowId: string, runId: string, query: ListRunItemsQuery = {}) → `Promise<RunItemList>`
10991
+ List a run's per-record items. GET /integrations/flows/:id/runs/:runId/items `request`/`response` are populated only for items captured while enhanced logging was active (and before the 24h body purge).
10992
+
10993
+ **listEntityRuns**(collectionId: string, entityId: string, query: { limit?: number } = {}) → `Promise<RunList>`
10994
+ Every run touching an entity (e.g. a product), across flows. GET /integrations/runs/entity/:entityId
10995
+
10996
+ **getLogging**(collectionId: string, connectionId: string) → `Promise<`
10997
+ Is enhanced logging active for a connection? GET /integrations/logging/:connectionId
10998
+
10999
+ **setLogging**(collectionId: string, connectionId: string, input: SetLoggingInput = {}) → `Promise<`
11000
+ Enable enhanced logging. POST /integrations/logging/:connectionId (omit ttlMinutes = until cancelled)
11001
+
11002
+ **cancelLogging**(collectionId: string, connectionId: string) → `Promise<`
11003
+ Cancel enhanced logging now. DELETE /integrations/logging/:connectionId
11004
+
10853
11005
  ### interactions
10854
11006
 
10855
11007
  **query**(collectionId: string,
package/openapi.yaml CHANGED
@@ -4444,6 +4444,38 @@ paths:
4444
4444
  description: Unauthorized
4445
4445
  404:
4446
4446
  description: Not found
4447
+ /admin/collection/{collectionId}/integrations/runs/entity/{entityId}:
4448
+ get:
4449
+ tags:
4450
+ - integrations
4451
+ summary: Every run touching an entity (e.g.
4452
+ operationId: integrations_listEntityRuns
4453
+ security:
4454
+ - bearerAuth: []
4455
+ parameters:
4456
+ - name: collectionId
4457
+ in: path
4458
+ required: true
4459
+ schema:
4460
+ type: string
4461
+ - name: entityId
4462
+ in: path
4463
+ required: true
4464
+ schema:
4465
+ type: string
4466
+ responses:
4467
+ 200:
4468
+ description: Success
4469
+ content:
4470
+ application/json:
4471
+ schema:
4472
+ $ref: "#/components/schemas/RunList"
4473
+ 400:
4474
+ description: Bad request
4475
+ 401:
4476
+ description: Unauthorized
4477
+ 404:
4478
+ description: Not found
4447
4479
  /admin/collection/{collectionId}/interactions:
4448
4480
  get:
4449
4481
  tags:
@@ -25250,6 +25282,8 @@ components:
25250
25282
  properties:
25251
25283
  entityId:
25252
25284
  type: string
25285
+ trigger:
25286
+ $ref: "#/components/schemas/RunTrigger"
25253
25287
  RunFlowSummary:
25254
25288
  type: object
25255
25289
  properties:
@@ -25265,6 +25299,8 @@ components:
25265
25299
  type: number
25266
25300
  status:
25267
25301
  $ref: "#/components/schemas/RunStatus"
25302
+ runId:
25303
+ type: string
25268
25304
  required:
25269
25305
  - flowId
25270
25306
  - direction
@@ -25272,6 +25308,209 @@ components:
25272
25308
  - sent
25273
25309
  - failed
25274
25310
  - status
25311
+ CapturedRequest:
25312
+ type: object
25313
+ properties:
25314
+ transport:
25315
+ type: string
25316
+ method:
25317
+ type: string
25318
+ url:
25319
+ type: string
25320
+ headers:
25321
+ type: object
25322
+ additionalProperties:
25323
+ type: string
25324
+ partitionKey:
25325
+ type: string
25326
+ body: {}
25327
+ bodyBytes:
25328
+ type: number
25329
+ truncated:
25330
+ type: boolean
25331
+ required:
25332
+ - transport
25333
+ - method
25334
+ - url
25335
+ - headers
25336
+ - body
25337
+ - bodyBytes
25338
+ - truncated
25339
+ CapturedResponse:
25340
+ type: object
25341
+ properties:
25342
+ status:
25343
+ type: number
25344
+ ok:
25345
+ type: boolean
25346
+ headers:
25347
+ type: object
25348
+ additionalProperties:
25349
+ type: string
25350
+ body: {}
25351
+ bodyBytes:
25352
+ type: number
25353
+ truncated:
25354
+ type: boolean
25355
+ error:
25356
+ type: string
25357
+ required:
25358
+ - status
25359
+ - ok
25360
+ - headers
25361
+ - body
25362
+ - bodyBytes
25363
+ - truncated
25364
+ - error
25365
+ FlowRun:
25366
+ type: object
25367
+ properties:
25368
+ id:
25369
+ type: string
25370
+ flowId:
25371
+ type: string
25372
+ connectionId:
25373
+ type: string
25374
+ trigger:
25375
+ $ref: "#/components/schemas/RunTrigger"
25376
+ triggerEvent:
25377
+ type: string
25378
+ triggerEntityId:
25379
+ type: string
25380
+ status:
25381
+ $ref: "#/components/schemas/FlowRunStatus"
25382
+ records:
25383
+ type: number
25384
+ sent:
25385
+ type: number
25386
+ failed:
25387
+ type: number
25388
+ error:
25389
+ type: string
25390
+ correlationId:
25391
+ type: string
25392
+ captureLevel:
25393
+ $ref: "#/components/schemas/CaptureLevel"
25394
+ bodiesPurged:
25395
+ type: boolean
25396
+ startedAt:
25397
+ type: string
25398
+ completedAt:
25399
+ type: string
25400
+ durationMs:
25401
+ type: number
25402
+ required:
25403
+ - id
25404
+ - flowId
25405
+ - trigger
25406
+ - status
25407
+ - records
25408
+ - sent
25409
+ - failed
25410
+ - captureLevel
25411
+ - bodiesPurged
25412
+ - startedAt
25413
+ FlowRunItem:
25414
+ type: object
25415
+ properties:
25416
+ id:
25417
+ type: string
25418
+ runId:
25419
+ type: string
25420
+ entityType:
25421
+ type: string
25422
+ entityId:
25423
+ type: string
25424
+ entityLabel:
25425
+ type: string
25426
+ status:
25427
+ $ref: "#/components/schemas/FlowRunItemStatus"
25428
+ skipReason:
25429
+ type: string
25430
+ request:
25431
+ $ref: "#/components/schemas/CapturedRequest"
25432
+ response:
25433
+ $ref: "#/components/schemas/CapturedResponse"
25434
+ attempt:
25435
+ type: number
25436
+ durationMs:
25437
+ type: number
25438
+ createdAt:
25439
+ type: string
25440
+ required:
25441
+ - id
25442
+ - runId
25443
+ - entityType
25444
+ - status
25445
+ - attempt
25446
+ - createdAt
25447
+ ListRunsQuery:
25448
+ type: object
25449
+ properties:
25450
+ status:
25451
+ $ref: "#/components/schemas/FlowRunStatus"
25452
+ trigger:
25453
+ $ref: "#/components/schemas/RunTrigger"
25454
+ entityId:
25455
+ type: string
25456
+ limit:
25457
+ type: number
25458
+ cursor:
25459
+ type: string
25460
+ RunList:
25461
+ type: object
25462
+ properties:
25463
+ runs:
25464
+ type: object
25465
+ additionalProperties: true
25466
+ required:
25467
+ - runs
25468
+ ListRunItemsQuery:
25469
+ type: object
25470
+ properties:
25471
+ status:
25472
+ type: object
25473
+ additionalProperties: true
25474
+ RunItemList:
25475
+ type: object
25476
+ properties:
25477
+ items:
25478
+ type: object
25479
+ additionalProperties: true
25480
+ required:
25481
+ - items
25482
+ LoggingWindow:
25483
+ type: object
25484
+ properties:
25485
+ id:
25486
+ type: string
25487
+ connectionId:
25488
+ type: string
25489
+ level:
25490
+ $ref: "#/components/schemas/CaptureLevel"
25491
+ enabledBy:
25492
+ type: string
25493
+ enabledAt:
25494
+ type: string
25495
+ expiresAt:
25496
+ type: string
25497
+ canceledAt:
25498
+ type: string
25499
+ required:
25500
+ - id
25501
+ - connectionId
25502
+ - level
25503
+ - enabledAt
25504
+ SetLoggingInput:
25505
+ type: object
25506
+ properties:
25507
+ ttlMinutes:
25508
+ type: number
25509
+ level:
25510
+ type: string
25511
+ enum:
25512
+ - full
25513
+ - errors_only
25275
25514
  RunFlowEnqueued:
25276
25515
  type: object
25277
25516
  properties:
@@ -25410,6 +25649,33 @@ components:
25410
25649
  - none
25411
25650
  UpdateFlowInput:
25412
25651
  $ref: "#/components/schemas/CreateFlowInput"
25652
+ RunTrigger:
25653
+ type: string
25654
+ enum:
25655
+ - manual
25656
+ - event
25657
+ - schedule
25658
+ - test
25659
+ FlowRunStatus:
25660
+ type: string
25661
+ enum:
25662
+ - running
25663
+ - success
25664
+ - partial
25665
+ - failed
25666
+ - skipped
25667
+ FlowRunItemStatus:
25668
+ type: string
25669
+ enum:
25670
+ - sent
25671
+ - failed
25672
+ - skipped
25673
+ CaptureLevel:
25674
+ type: string
25675
+ enum:
25676
+ - metadata
25677
+ - errors_only
25678
+ - full
25413
25679
  RunFlowResult:
25414
25680
  anyOf:
25415
25681
  - $ref: "#/components/schemas/RunFlowSummary"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "2.0.30",
3
+ "version": "2.0.31",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",