@proveanything/smartlinks 1.8.10 → 1.8.11

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 { AdminInteractionsCountsByOutcomeRequest, AdminInteractionsQueryRequest, AppendInteractionBody, UpdateInteractionBody, OutcomeCount, InteractionEventRow, PublicInteractionsCountsByOutcomeRequest, PublicInteractionsByUserRequest, CreateInteractionTypeBody, UpdateInteractionTypeBody, ListInteractionTypesQuery, InteractionTypeRecord, InteractionTypeList } from "../types/interaction";
1
+ import type { AdminInteractionsCountsByOutcomeRequest, AdminInteractionsQueryRequest, AdminInteractionsAggregateRequest, AdminInteractionsAggregateResponse, AppendInteractionBody, UpdateInteractionBody, OutcomeCount, InteractionEventRow, PublicInteractionsCountsByOutcomeRequest, PublicInteractionsByUserRequest, CreateInteractionTypeBody, UpdateInteractionTypeBody, ListInteractionTypesQuery, InteractionTypeRecord, InteractionTypeList } from "../types/interaction";
2
2
  export declare namespace interactions {
3
3
  /**
4
4
  * POST /admin/collection/:collectionId/interactions/query
@@ -10,6 +10,15 @@ export declare namespace interactions {
10
10
  * Returns array of { outcome, count }.
11
11
  */
12
12
  function countsByOutcome(collectionId: string, query?: AdminInteractionsCountsByOutcomeRequest): Promise<OutcomeCount[]>;
13
+ /**
14
+ * POST /admin/collection/:collectionId/interactions/aggregate
15
+ * Returns grouped numeric aggregates (sum, avg, min, max, count).
16
+ */
17
+ function aggregate(collectionId: string, body: AdminInteractionsAggregateRequest): Promise<AdminInteractionsAggregateResponse>;
18
+ /**
19
+ * Legacy-friendly alias for aggregate().
20
+ */
21
+ function aggregateByOutcome(collectionId: string, body: AdminInteractionsAggregateRequest): Promise<AdminInteractionsAggregateResponse>;
13
22
  /**
14
23
  * POST /admin/collection/:collectionId/interactions/append
15
24
  * Appends one interaction event.
@@ -35,6 +35,22 @@ export var interactions;
35
35
  return post(path, query);
36
36
  }
37
37
  interactions.countsByOutcome = countsByOutcome;
38
+ /**
39
+ * POST /admin/collection/:collectionId/interactions/aggregate
40
+ * Returns grouped numeric aggregates (sum, avg, min, max, count).
41
+ */
42
+ async function aggregate(collectionId, body) {
43
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/interactions/aggregate`;
44
+ return post(path, body);
45
+ }
46
+ interactions.aggregate = aggregate;
47
+ /**
48
+ * Legacy-friendly alias for aggregate().
49
+ */
50
+ async function aggregateByOutcome(collectionId, body) {
51
+ return aggregate(collectionId, body);
52
+ }
53
+ interactions.aggregateByOutcome = aggregateByOutcome;
38
54
  // Deprecated endpoint removed: actorIdsByInteraction
39
55
  /**
40
56
  * POST /admin/collection/:collectionId/interactions/append
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.8.10 | Generated: 2026-03-19T15:24:09.009Z
3
+ Version: 1.8.11 | Generated: 2026-03-19T19:58:44.820Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -4401,6 +4401,52 @@ interface AdminInteractionsCountsByOutcomeRequest {
4401
4401
  }
4402
4402
  ```
4403
4403
 
4404
+ **AdminInteractionsAggregateRequest** (interface)
4405
+ ```typescript
4406
+ interface AdminInteractionsAggregateRequest {
4407
+ appId?: string
4408
+ interactionId?: string
4409
+ interactionIds?: string[]
4410
+ scope?: string
4411
+ outcome?: string | null
4412
+ from?: string
4413
+ to?: string
4414
+ limit?: number
4415
+ dedupeLatest?: boolean
4416
+ groupBy: string
4417
+ aggregate: {
4418
+ field: string
4419
+ ops: Array<'count' | 'sum' | 'avg' | 'min' | 'max'>
4420
+ }
4421
+ }
4422
+ ```
4423
+
4424
+ **AdminInteractionsAggregateResponse** (interface)
4425
+ ```typescript
4426
+ interface AdminInteractionsAggregateResponse {
4427
+ groupBy: string
4428
+ aggregate: {
4429
+ field: string
4430
+ ops: Array<'count' | 'sum' | 'avg' | 'min' | 'max'>
4431
+ dedupeLatest?: boolean
4432
+ }
4433
+ rows: AdminInteractionsAggregateRow[]
4434
+ }
4435
+ ```
4436
+
4437
+ **AdminInteractionsAggregateRow** (interface)
4438
+ ```typescript
4439
+ interface AdminInteractionsAggregateRow {
4440
+ groupValue: string | null
4441
+ eventCount: number
4442
+ count?: number
4443
+ sum?: number
4444
+ avg?: number
4445
+ min?: number
4446
+ max?: number
4447
+ }
4448
+ ```
4449
+
4404
4450
  **PublicInteractionsCountsByOutcomeRequest** (interface)
4405
4451
  ```typescript
4406
4452
  interface PublicInteractionsCountsByOutcomeRequest {
@@ -6894,6 +6940,14 @@ POST /admin/collection/:collectionId/interactions/query Flexible query for inter
6894
6940
  query: AdminInteractionsCountsByOutcomeRequest = {}) → `Promise<OutcomeCount[]>`
6895
6941
  POST /admin/collection/:collectionId/interactions/counts-by-outcome Returns array of { outcome, count }.
6896
6942
 
6943
+ **aggregate**(collectionId: string,
6944
+ body: AdminInteractionsAggregateRequest) → `Promise<AdminInteractionsAggregateResponse>`
6945
+ POST /admin/collection/:collectionId/interactions/aggregate Returns grouped numeric aggregates (sum, avg, min, max, count).
6946
+
6947
+ **aggregateByOutcome**(collectionId: string,
6948
+ body: AdminInteractionsAggregateRequest) → `Promise<AdminInteractionsAggregateResponse>`
6949
+ Legacy-friendly alias for aggregate().
6950
+
6897
6951
  **appendEvent**(collectionId: string,
6898
6952
  body: AppendInteractionBody) → `Promise<`
6899
6953
  POST /admin/collection/:collectionId/interactions/append Appends one interaction event.
package/dist/openapi.yaml CHANGED
@@ -3382,6 +3382,39 @@ paths:
3382
3382
  application/json:
3383
3383
  schema:
3384
3384
  $ref: "#/components/schemas/CreateInteractionTypeBody"
3385
+ /admin/collection/{collectionId}/interactions/aggregate:
3386
+ post:
3387
+ tags:
3388
+ - interactions
3389
+ summary: "POST /admin/collection/:collectionId/interactions/counts-by-outcome Returns array of { outcome, count }."
3390
+ operationId: interactions_aggregate
3391
+ security:
3392
+ - bearerAuth: []
3393
+ parameters:
3394
+ - name: collectionId
3395
+ in: path
3396
+ required: true
3397
+ schema:
3398
+ type: string
3399
+ responses:
3400
+ 200:
3401
+ description: Success
3402
+ content:
3403
+ application/json:
3404
+ schema:
3405
+ $ref: "#/components/schemas/AdminInteractionsAggregateResponse"
3406
+ 400:
3407
+ description: Bad request
3408
+ 401:
3409
+ description: Unauthorized
3410
+ 404:
3411
+ description: Not found
3412
+ requestBody:
3413
+ required: true
3414
+ content:
3415
+ application/json:
3416
+ schema:
3417
+ $ref: "#/components/schemas/AdminInteractionsAggregateRequest"
3385
3418
  /admin/collection/{collectionId}/interactions/counts-by-outcome:
3386
3419
  post:
3387
3420
  tags:
@@ -15773,6 +15806,103 @@ components:
15773
15806
  type: boolean
15774
15807
  idField:
15775
15808
  $ref: "#/components/schemas/IdField"
15809
+ AdminInteractionsAggregateRequest:
15810
+ type: object
15811
+ properties:
15812
+ appId:
15813
+ type: string
15814
+ interactionId:
15815
+ type: string
15816
+ interactionIds:
15817
+ type: array
15818
+ items:
15819
+ type: string
15820
+ scope:
15821
+ type: string
15822
+ outcome:
15823
+ type: string
15824
+ from:
15825
+ type: string
15826
+ to:
15827
+ type: string
15828
+ limit:
15829
+ type: number
15830
+ dedupeLatest:
15831
+ type: boolean
15832
+ groupBy:
15833
+ type: string
15834
+ aggregate:
15835
+ type: object
15836
+ additionalProperties: true
15837
+ field:
15838
+ type: string
15839
+ ops:
15840
+ type: array
15841
+ items:
15842
+ type: string
15843
+ enum:
15844
+ - count
15845
+ - sum
15846
+ - avg
15847
+ - min
15848
+ - max
15849
+ required:
15850
+ - groupBy
15851
+ - aggregate
15852
+ - field
15853
+ - ops
15854
+ AdminInteractionsAggregateResponse:
15855
+ type: object
15856
+ properties:
15857
+ groupBy:
15858
+ type: string
15859
+ aggregate:
15860
+ type: object
15861
+ additionalProperties: true
15862
+ field:
15863
+ type: string
15864
+ ops:
15865
+ type: array
15866
+ items:
15867
+ type: string
15868
+ enum:
15869
+ - count
15870
+ - sum
15871
+ - avg
15872
+ - min
15873
+ - max
15874
+ dedupeLatest:
15875
+ type: boolean
15876
+ rows:
15877
+ type: array
15878
+ items:
15879
+ $ref: "#/components/schemas/AdminInteractionsAggregateRow"
15880
+ required:
15881
+ - groupBy
15882
+ - aggregate
15883
+ - field
15884
+ - ops
15885
+ - rows
15886
+ AdminInteractionsAggregateRow:
15887
+ type: object
15888
+ properties:
15889
+ groupValue:
15890
+ type: string
15891
+ eventCount:
15892
+ type: number
15893
+ count:
15894
+ type: number
15895
+ sum:
15896
+ type: number
15897
+ avg:
15898
+ type: number
15899
+ min:
15900
+ type: number
15901
+ max:
15902
+ type: number
15903
+ required:
15904
+ - groupValue
15905
+ - eventCount
15776
15906
  PublicInteractionsCountsByOutcomeRequest:
15777
15907
  type: object
15778
15908
  properties:
@@ -26,6 +26,40 @@ export interface AdminInteractionsCountsByOutcomeRequest {
26
26
  dedupeLatest?: boolean;
27
27
  idField?: IdField;
28
28
  }
29
+ export interface AdminInteractionsAggregateRequest {
30
+ appId?: string;
31
+ interactionId?: string;
32
+ interactionIds?: string[];
33
+ scope?: string;
34
+ outcome?: string | null;
35
+ from?: string;
36
+ to?: string;
37
+ limit?: number;
38
+ dedupeLatest?: boolean;
39
+ groupBy: string;
40
+ aggregate: {
41
+ field: string;
42
+ ops: Array<'count' | 'sum' | 'avg' | 'min' | 'max'>;
43
+ };
44
+ }
45
+ export interface AdminInteractionsAggregateResponse {
46
+ groupBy: string;
47
+ aggregate: {
48
+ field: string;
49
+ ops: Array<'count' | 'sum' | 'avg' | 'min' | 'max'>;
50
+ dedupeLatest?: boolean;
51
+ };
52
+ rows: AdminInteractionsAggregateRow[];
53
+ }
54
+ export interface AdminInteractionsAggregateRow {
55
+ groupValue: string | null;
56
+ eventCount: number;
57
+ count?: number;
58
+ sum?: number;
59
+ avg?: number;
60
+ min?: number;
61
+ max?: number;
62
+ }
29
63
  export interface PublicInteractionsCountsByOutcomeRequest {
30
64
  appId: string;
31
65
  interactionId: string;
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.8.10 | Generated: 2026-03-19T15:24:09.009Z
3
+ Version: 1.8.11 | Generated: 2026-03-19T19:58:44.820Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -4401,6 +4401,52 @@ interface AdminInteractionsCountsByOutcomeRequest {
4401
4401
  }
4402
4402
  ```
4403
4403
 
4404
+ **AdminInteractionsAggregateRequest** (interface)
4405
+ ```typescript
4406
+ interface AdminInteractionsAggregateRequest {
4407
+ appId?: string
4408
+ interactionId?: string
4409
+ interactionIds?: string[]
4410
+ scope?: string
4411
+ outcome?: string | null
4412
+ from?: string
4413
+ to?: string
4414
+ limit?: number
4415
+ dedupeLatest?: boolean
4416
+ groupBy: string
4417
+ aggregate: {
4418
+ field: string
4419
+ ops: Array<'count' | 'sum' | 'avg' | 'min' | 'max'>
4420
+ }
4421
+ }
4422
+ ```
4423
+
4424
+ **AdminInteractionsAggregateResponse** (interface)
4425
+ ```typescript
4426
+ interface AdminInteractionsAggregateResponse {
4427
+ groupBy: string
4428
+ aggregate: {
4429
+ field: string
4430
+ ops: Array<'count' | 'sum' | 'avg' | 'min' | 'max'>
4431
+ dedupeLatest?: boolean
4432
+ }
4433
+ rows: AdminInteractionsAggregateRow[]
4434
+ }
4435
+ ```
4436
+
4437
+ **AdminInteractionsAggregateRow** (interface)
4438
+ ```typescript
4439
+ interface AdminInteractionsAggregateRow {
4440
+ groupValue: string | null
4441
+ eventCount: number
4442
+ count?: number
4443
+ sum?: number
4444
+ avg?: number
4445
+ min?: number
4446
+ max?: number
4447
+ }
4448
+ ```
4449
+
4404
4450
  **PublicInteractionsCountsByOutcomeRequest** (interface)
4405
4451
  ```typescript
4406
4452
  interface PublicInteractionsCountsByOutcomeRequest {
@@ -6894,6 +6940,14 @@ POST /admin/collection/:collectionId/interactions/query Flexible query for inter
6894
6940
  query: AdminInteractionsCountsByOutcomeRequest = {}) → `Promise<OutcomeCount[]>`
6895
6941
  POST /admin/collection/:collectionId/interactions/counts-by-outcome Returns array of { outcome, count }.
6896
6942
 
6943
+ **aggregate**(collectionId: string,
6944
+ body: AdminInteractionsAggregateRequest) → `Promise<AdminInteractionsAggregateResponse>`
6945
+ POST /admin/collection/:collectionId/interactions/aggregate Returns grouped numeric aggregates (sum, avg, min, max, count).
6946
+
6947
+ **aggregateByOutcome**(collectionId: string,
6948
+ body: AdminInteractionsAggregateRequest) → `Promise<AdminInteractionsAggregateResponse>`
6949
+ Legacy-friendly alias for aggregate().
6950
+
6897
6951
  **appendEvent**(collectionId: string,
6898
6952
  body: AppendInteractionBody) → `Promise<`
6899
6953
  POST /admin/collection/:collectionId/interactions/append Appends one interaction event.
package/openapi.yaml CHANGED
@@ -3382,6 +3382,39 @@ paths:
3382
3382
  application/json:
3383
3383
  schema:
3384
3384
  $ref: "#/components/schemas/CreateInteractionTypeBody"
3385
+ /admin/collection/{collectionId}/interactions/aggregate:
3386
+ post:
3387
+ tags:
3388
+ - interactions
3389
+ summary: "POST /admin/collection/:collectionId/interactions/counts-by-outcome Returns array of { outcome, count }."
3390
+ operationId: interactions_aggregate
3391
+ security:
3392
+ - bearerAuth: []
3393
+ parameters:
3394
+ - name: collectionId
3395
+ in: path
3396
+ required: true
3397
+ schema:
3398
+ type: string
3399
+ responses:
3400
+ 200:
3401
+ description: Success
3402
+ content:
3403
+ application/json:
3404
+ schema:
3405
+ $ref: "#/components/schemas/AdminInteractionsAggregateResponse"
3406
+ 400:
3407
+ description: Bad request
3408
+ 401:
3409
+ description: Unauthorized
3410
+ 404:
3411
+ description: Not found
3412
+ requestBody:
3413
+ required: true
3414
+ content:
3415
+ application/json:
3416
+ schema:
3417
+ $ref: "#/components/schemas/AdminInteractionsAggregateRequest"
3385
3418
  /admin/collection/{collectionId}/interactions/counts-by-outcome:
3386
3419
  post:
3387
3420
  tags:
@@ -15773,6 +15806,103 @@ components:
15773
15806
  type: boolean
15774
15807
  idField:
15775
15808
  $ref: "#/components/schemas/IdField"
15809
+ AdminInteractionsAggregateRequest:
15810
+ type: object
15811
+ properties:
15812
+ appId:
15813
+ type: string
15814
+ interactionId:
15815
+ type: string
15816
+ interactionIds:
15817
+ type: array
15818
+ items:
15819
+ type: string
15820
+ scope:
15821
+ type: string
15822
+ outcome:
15823
+ type: string
15824
+ from:
15825
+ type: string
15826
+ to:
15827
+ type: string
15828
+ limit:
15829
+ type: number
15830
+ dedupeLatest:
15831
+ type: boolean
15832
+ groupBy:
15833
+ type: string
15834
+ aggregate:
15835
+ type: object
15836
+ additionalProperties: true
15837
+ field:
15838
+ type: string
15839
+ ops:
15840
+ type: array
15841
+ items:
15842
+ type: string
15843
+ enum:
15844
+ - count
15845
+ - sum
15846
+ - avg
15847
+ - min
15848
+ - max
15849
+ required:
15850
+ - groupBy
15851
+ - aggregate
15852
+ - field
15853
+ - ops
15854
+ AdminInteractionsAggregateResponse:
15855
+ type: object
15856
+ properties:
15857
+ groupBy:
15858
+ type: string
15859
+ aggregate:
15860
+ type: object
15861
+ additionalProperties: true
15862
+ field:
15863
+ type: string
15864
+ ops:
15865
+ type: array
15866
+ items:
15867
+ type: string
15868
+ enum:
15869
+ - count
15870
+ - sum
15871
+ - avg
15872
+ - min
15873
+ - max
15874
+ dedupeLatest:
15875
+ type: boolean
15876
+ rows:
15877
+ type: array
15878
+ items:
15879
+ $ref: "#/components/schemas/AdminInteractionsAggregateRow"
15880
+ required:
15881
+ - groupBy
15882
+ - aggregate
15883
+ - field
15884
+ - ops
15885
+ - rows
15886
+ AdminInteractionsAggregateRow:
15887
+ type: object
15888
+ properties:
15889
+ groupValue:
15890
+ type: string
15891
+ eventCount:
15892
+ type: number
15893
+ count:
15894
+ type: number
15895
+ sum:
15896
+ type: number
15897
+ avg:
15898
+ type: number
15899
+ min:
15900
+ type: number
15901
+ max:
15902
+ type: number
15903
+ required:
15904
+ - groupValue
15905
+ - eventCount
15776
15906
  PublicInteractionsCountsByOutcomeRequest:
15777
15907
  type: object
15778
15908
  properties:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.8.10",
3
+ "version": "1.8.11",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",