featurebase-node 0.14.2 → 0.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/resources/feedback/feedback.d.mts +2 -2
- package/resources/feedback/feedback.d.mts.map +1 -1
- package/resources/feedback/feedback.d.ts +2 -2
- package/resources/feedback/feedback.d.ts.map +1 -1
- package/resources/feedback/feedback.js.map +1 -1
- package/resources/feedback/feedback.mjs.map +1 -1
- package/resources/feedback/index.d.mts +1 -1
- package/resources/feedback/index.d.mts.map +1 -1
- package/resources/feedback/index.d.ts +1 -1
- package/resources/feedback/index.d.ts.map +1 -1
- package/resources/feedback/index.js.map +1 -1
- package/resources/feedback/index.mjs.map +1 -1
- package/resources/feedback/posts/index.d.mts +1 -1
- package/resources/feedback/posts/index.d.mts.map +1 -1
- package/resources/feedback/posts/index.d.ts +1 -1
- package/resources/feedback/posts/index.d.ts.map +1 -1
- package/resources/feedback/posts/index.js.map +1 -1
- package/resources/feedback/posts/index.mjs.map +1 -1
- package/resources/feedback/posts/posts.d.mts +68 -1
- package/resources/feedback/posts/posts.d.mts.map +1 -1
- package/resources/feedback/posts/posts.d.ts +68 -1
- package/resources/feedback/posts/posts.d.ts.map +1 -1
- package/resources/feedback/posts/posts.js +69 -0
- package/resources/feedback/posts/posts.js.map +1 -1
- package/resources/feedback/posts/posts.mjs +69 -0
- package/resources/feedback/posts/posts.mjs.map +1 -1
- package/resources/reports.d.mts +138 -5
- package/resources/reports.d.mts.map +1 -1
- package/resources/reports.d.ts +138 -5
- package/resources/reports.d.ts.map +1 -1
- package/resources/reports.js +27 -2
- package/resources/reports.js.map +1 -1
- package/resources/reports.mjs +27 -2
- package/resources/reports.mjs.map +1 -1
- package/resources/support/conversations/conversations.d.mts +60 -19
- package/resources/support/conversations/conversations.d.mts.map +1 -1
- package/resources/support/conversations/conversations.d.ts +60 -19
- package/resources/support/conversations/conversations.d.ts.map +1 -1
- package/resources/support/conversations/conversations.js +47 -12
- package/resources/support/conversations/conversations.js.map +1 -1
- package/resources/support/conversations/conversations.mjs +47 -12
- package/resources/support/conversations/conversations.mjs.map +1 -1
- package/src/resources/feedback/feedback.ts +4 -0
- package/src/resources/feedback/index.ts +2 -0
- package/src/resources/feedback/posts/index.ts +2 -0
- package/src/resources/feedback/posts/posts.ts +104 -0
- package/src/resources/reports.ts +177 -4
- package/src/resources/support/conversations/conversations.ts +60 -19
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -954,18 +954,53 @@ class Conversations extends resource_1.APIResource {
|
|
|
954
954
|
* `participant_id`, `company_id`, `created_at`) are still accepted for back-compat
|
|
955
955
|
* but are deprecated — please migrate to camelCase in new code.
|
|
956
956
|
*
|
|
957
|
-
* | Field
|
|
958
|
-
* |
|
|
959
|
-
* | `state`
|
|
960
|
-
* | `priority`
|
|
961
|
-
* | `adminAssigneeId`
|
|
962
|
-
* | `teamAssigneeId`
|
|
963
|
-
* | `brandId`
|
|
964
|
-
* | `tagIds`
|
|
965
|
-
* | `userId` / `participantId`
|
|
966
|
-
* | `companyId`
|
|
967
|
-
* | `mentionedAdminIds`
|
|
968
|
-
* | `createdAt`
|
|
957
|
+
* | Field | Type | Operators |
|
|
958
|
+
* | -------------------------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
959
|
+
* | `state` | enum (`open` / `closed` / `snoozed`) | `=`, `!=`, `IN`, `NIN` |
|
|
960
|
+
* | `priority` | boolean | `=`, `!=` |
|
|
961
|
+
* | `adminAssigneeId` | id or null (unassigned) | `=`, `!=`, `IN`, `NIN` |
|
|
962
|
+
* | `teamAssigneeId` | id or null (unassigned) | `=`, `!=`, `IN`, `NIN` |
|
|
963
|
+
* | `brandId` | id or null | `=`, `!=`, `IN`, `NIN` |
|
|
964
|
+
* | `tagIds` | id (matches any conversation containing this tag) | `=`, `!=`, `IN`, `NIN` |
|
|
965
|
+
* | `userId` / `participantId` | id of a conversation participant | `=`, `!=`, `IN`, `NIN` |
|
|
966
|
+
* | `companyId` | company id (matches conversations whose participants belong to the company) | `=`, `!=`, `IN`, `NIN` |
|
|
967
|
+
* | `mentionedAdminIds` | admin id | `=`, `!=`, `IN`, `NIN` |
|
|
968
|
+
* | `createdAt` | unix seconds | `=`, `>`, `<` |
|
|
969
|
+
* | `customAttributes.<attributeId>` | conversation custom attribute (see below) | `=`, `!=`, `IN`, `NIN`; plus `>`, `<`, `>=`, `<=` for `number` / `date` |
|
|
970
|
+
*
|
|
971
|
+
* ### Filtering by custom attributes
|
|
972
|
+
*
|
|
973
|
+
* Any non-archived conversation custom attribute can be used as a filter field via
|
|
974
|
+
* `customAttributes.<attributeId>`, where `<attributeId>` is the attribute's `id`
|
|
975
|
+
* from `GET /v2/conversation_attributes`. The accepted value shape follows the
|
|
976
|
+
* attribute's `fieldSubType`:
|
|
977
|
+
*
|
|
978
|
+
* - `select` / `multi-select` — pass an option **label** (e.g.
|
|
979
|
+
* `"Product question"`) or an option **id**; both are matched interchangeably,
|
|
980
|
+
* and id-based filters keep working after options are renamed
|
|
981
|
+
* - `text` — string
|
|
982
|
+
* - `number` — number; range operators (`>`, `<`, `>=`, `<=`) are supported
|
|
983
|
+
* - `date` — ISO 8601 string or unix seconds; range operators are supported
|
|
984
|
+
* - `checkbox` — boolean
|
|
985
|
+
*
|
|
986
|
+
* Example — all conversations where the "Issue type" select attribute is "Product
|
|
987
|
+
* question":
|
|
988
|
+
*
|
|
989
|
+
* ```json
|
|
990
|
+
* {
|
|
991
|
+
* "query": {
|
|
992
|
+
* "field": "customAttributes.6863d3fca1234b0d5e15c86c",
|
|
993
|
+
* "operator": "=",
|
|
994
|
+
* "value": "Product question"
|
|
995
|
+
* },
|
|
996
|
+
* "include": ["customAttributeDefinitions"]
|
|
997
|
+
* }
|
|
998
|
+
* ```
|
|
999
|
+
*
|
|
1000
|
+
* Referencing an attribute id that does not exist (or has been archived) returns a
|
|
1001
|
+
* `field_unknown` error. Set `include` to `["customAttributeDefinitions"]` to get
|
|
1002
|
+
* each returned conversation's attribute values resolved with names and types
|
|
1003
|
+
* alongside the ID-keyed `customAttributes` map.
|
|
969
1004
|
*
|
|
970
1005
|
* For unbounded fields a query consisting only of `!=` or `NIN` clauses is
|
|
971
1006
|
* rejected with `query_too_broad` to prevent full-org scans. Combine the negation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../../src/resources/support/conversations/conversations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AAKrD,2EAAkD;AAClD,oDAA6F;AAE7F,4DAA0F;AAC1F,0DAAyD;AAEzD,0DAAoD;AAEpD;;GAEG;AACH,MAAa,aAAc,SAAQ,sBAAW;IAA9C;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../../src/resources/support/conversations/conversations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AAKrD,2EAAkD;AAClD,oDAA6F;AAE7F,4DAA0F;AAC1F,0DAAyD;AAEzD,0DAAoD;AAEpD;;GAEG;AACH,MAAa,aAAc,SAAQ,sBAAW;IAA9C;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAojC9F,CAAC;IAljCC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqEG;IACH,IAAI,CACF,SAAoD,EAAE,EACtD,OAAwB;QAExB,MAAM,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAC7E,OAAO,IAAI,CAAC,OAAO,CAAC,U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CAqjCC;AA+7ED,aAAa,CAAC,YAAY,GAAG,2BAAY,CAAC"}
|
|
@@ -950,18 +950,53 @@ export class Conversations extends APIResource {
|
|
|
950
950
|
* `participant_id`, `company_id`, `created_at`) are still accepted for back-compat
|
|
951
951
|
* but are deprecated — please migrate to camelCase in new code.
|
|
952
952
|
*
|
|
953
|
-
* | Field
|
|
954
|
-
* |
|
|
955
|
-
* | `state`
|
|
956
|
-
* | `priority`
|
|
957
|
-
* | `adminAssigneeId`
|
|
958
|
-
* | `teamAssigneeId`
|
|
959
|
-
* | `brandId`
|
|
960
|
-
* | `tagIds`
|
|
961
|
-
* | `userId` / `participantId`
|
|
962
|
-
* | `companyId`
|
|
963
|
-
* | `mentionedAdminIds`
|
|
964
|
-
* | `createdAt`
|
|
953
|
+
* | Field | Type | Operators |
|
|
954
|
+
* | -------------------------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
955
|
+
* | `state` | enum (`open` / `closed` / `snoozed`) | `=`, `!=`, `IN`, `NIN` |
|
|
956
|
+
* | `priority` | boolean | `=`, `!=` |
|
|
957
|
+
* | `adminAssigneeId` | id or null (unassigned) | `=`, `!=`, `IN`, `NIN` |
|
|
958
|
+
* | `teamAssigneeId` | id or null (unassigned) | `=`, `!=`, `IN`, `NIN` |
|
|
959
|
+
* | `brandId` | id or null | `=`, `!=`, `IN`, `NIN` |
|
|
960
|
+
* | `tagIds` | id (matches any conversation containing this tag) | `=`, `!=`, `IN`, `NIN` |
|
|
961
|
+
* | `userId` / `participantId` | id of a conversation participant | `=`, `!=`, `IN`, `NIN` |
|
|
962
|
+
* | `companyId` | company id (matches conversations whose participants belong to the company) | `=`, `!=`, `IN`, `NIN` |
|
|
963
|
+
* | `mentionedAdminIds` | admin id | `=`, `!=`, `IN`, `NIN` |
|
|
964
|
+
* | `createdAt` | unix seconds | `=`, `>`, `<` |
|
|
965
|
+
* | `customAttributes.<attributeId>` | conversation custom attribute (see below) | `=`, `!=`, `IN`, `NIN`; plus `>`, `<`, `>=`, `<=` for `number` / `date` |
|
|
966
|
+
*
|
|
967
|
+
* ### Filtering by custom attributes
|
|
968
|
+
*
|
|
969
|
+
* Any non-archived conversation custom attribute can be used as a filter field via
|
|
970
|
+
* `customAttributes.<attributeId>`, where `<attributeId>` is the attribute's `id`
|
|
971
|
+
* from `GET /v2/conversation_attributes`. The accepted value shape follows the
|
|
972
|
+
* attribute's `fieldSubType`:
|
|
973
|
+
*
|
|
974
|
+
* - `select` / `multi-select` — pass an option **label** (e.g.
|
|
975
|
+
* `"Product question"`) or an option **id**; both are matched interchangeably,
|
|
976
|
+
* and id-based filters keep working after options are renamed
|
|
977
|
+
* - `text` — string
|
|
978
|
+
* - `number` — number; range operators (`>`, `<`, `>=`, `<=`) are supported
|
|
979
|
+
* - `date` — ISO 8601 string or unix seconds; range operators are supported
|
|
980
|
+
* - `checkbox` — boolean
|
|
981
|
+
*
|
|
982
|
+
* Example — all conversations where the "Issue type" select attribute is "Product
|
|
983
|
+
* question":
|
|
984
|
+
*
|
|
985
|
+
* ```json
|
|
986
|
+
* {
|
|
987
|
+
* "query": {
|
|
988
|
+
* "field": "customAttributes.6863d3fca1234b0d5e15c86c",
|
|
989
|
+
* "operator": "=",
|
|
990
|
+
* "value": "Product question"
|
|
991
|
+
* },
|
|
992
|
+
* "include": ["customAttributeDefinitions"]
|
|
993
|
+
* }
|
|
994
|
+
* ```
|
|
995
|
+
*
|
|
996
|
+
* Referencing an attribute id that does not exist (or has been archived) returns a
|
|
997
|
+
* `field_unknown` error. Set `include` to `["customAttributeDefinitions"]` to get
|
|
998
|
+
* each returned conversation's attribute values resolved with names and types
|
|
999
|
+
* alongside the ID-keyed `customAttributes` map.
|
|
965
1000
|
*
|
|
966
1001
|
* For unbounded fields a query consisting only of `!=` or `NIN` clauses is
|
|
967
1002
|
* rejected with `query_too_broad` to prevent full-org scans. Combine the negation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.mjs","sourceRoot":"","sources":["../../../src/resources/support/conversations/conversations.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAKrD,OAAO,KAAK,eAAe,2BAAuB;AAClD,OAAO,EAAiD,YAAY,EAAE,2BAAuB;AAE7F,OAAO,EAAE,UAAU,EAAsC,qCAAiC;AAC1F,OAAO,EAAE,YAAY,EAAE,sCAAkC;AAEzD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IAA9C;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"conversations.mjs","sourceRoot":"","sources":["../../../src/resources/support/conversations/conversations.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAKrD,OAAO,KAAK,eAAe,2BAAuB;AAClD,OAAO,EAAiD,YAAY,EAAE,2BAAuB;AAE7F,OAAO,EAAE,UAAU,EAAsC,qCAAiC;AAC1F,OAAO,EAAE,YAAY,EAAE,sCAAkC;AAEzD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IAA9C;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAojC9F,CAAC;IAljCC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqEG;IACH,IAAI,CACF,SAAoD,EAAE,EACtD,OAAwB;QAExB,MAAM,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAC7E,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAA,UAAwB,CA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MergeParams,
|
|
49
50
|
PostRetrieveParams,
|
|
50
51
|
PostSearchParams,
|
|
51
52
|
PostSearchResponse,
|
|
52
53
|
PostTag,
|
|
54
|
+
PostUnmergeParams,
|
|
53
55
|
PostUpdateParams,
|
|
54
56
|
Posts,
|
|
55
57
|
PostsCursorPage,
|
|
@@ -97,6 +99,8 @@ export declare namespace Feedback {
|
|
|
97
99
|
type PostRetrieveParams as PostRetrieveParams,
|
|
98
100
|
type PostUpdateParams as PostUpdateParams,
|
|
99
101
|
type PostDeleteParams as PostDeleteParams,
|
|
102
|
+
type PostMergeParams as PostMergeParams,
|
|
103
|
+
type PostUnmergeParams as PostUnmergeParams,
|
|
100
104
|
type PostSearchParams as PostSearchParams,
|
|
101
105
|
};
|
|
102
106
|
|
|
@@ -315,6 +315,77 @@ export class Posts extends APIResource {
|
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
+
/**
|
|
319
|
+
* Merges a source post into a destination post.
|
|
320
|
+
*
|
|
321
|
+
* The source post is removed from public post lists. Its votes, comments, and
|
|
322
|
+
* supported integration links are moved to the destination post.
|
|
323
|
+
*
|
|
324
|
+
* Both posts must belong to the authenticated organization. Neither post can
|
|
325
|
+
* already be merged, and a post cannot be merged into itself.
|
|
326
|
+
*
|
|
327
|
+
* Retrying the same source and destination after a successful merge is safe and
|
|
328
|
+
* returns the destination post without merging the data again.
|
|
329
|
+
*
|
|
330
|
+
* The response contains the updated destination post.
|
|
331
|
+
*
|
|
332
|
+
* @example
|
|
333
|
+
* ```ts
|
|
334
|
+
* const post = await client.feedback.posts.merge({
|
|
335
|
+
* destinationPostId: '507f1f77bcf86cd799439012',
|
|
336
|
+
* sourcePostId: '507f1f77bcf86cd799439011',
|
|
337
|
+
* });
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
340
|
+
merge(params: PostMergeParams, options?: RequestOptions): APIPromise<Post> {
|
|
341
|
+
const { 'Featurebase-Version': featurebaseVersion, ...body } = params;
|
|
342
|
+
return this._client.post('/v2/posts/merge', {
|
|
343
|
+
body,
|
|
344
|
+
...options,
|
|
345
|
+
headers: buildHeaders([
|
|
346
|
+
{
|
|
347
|
+
...(featurebaseVersion?.toString() != null ?
|
|
348
|
+
{ 'Featurebase-Version': featurebaseVersion?.toString() }
|
|
349
|
+
: undefined),
|
|
350
|
+
},
|
|
351
|
+
options?.headers,
|
|
352
|
+
]),
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Restores a post that was previously merged.
|
|
358
|
+
*
|
|
359
|
+
* The restored post returns to public post lists. Its votes and comments are
|
|
360
|
+
* removed from the destination post and restored on the source post.
|
|
361
|
+
*
|
|
362
|
+
* Retrying an unmerge after it succeeds is safe and returns the restored post.
|
|
363
|
+
*
|
|
364
|
+
* The response contains the restored post.
|
|
365
|
+
*
|
|
366
|
+
* @example
|
|
367
|
+
* ```ts
|
|
368
|
+
* const post = await client.feedback.posts.unmerge({
|
|
369
|
+
* postId: '507f1f77bcf86cd799439011',
|
|
370
|
+
* });
|
|
371
|
+
* ```
|
|
372
|
+
*/
|
|
373
|
+
unmerge(params: PostUnmergeParams, options?: RequestOptions): APIPromise<Post> {
|
|
374
|
+
const { 'Featurebase-Version': featurebaseVersion, ...body } = params;
|
|
375
|
+
return this._client.post('/v2/posts/unmerge', {
|
|
376
|
+
body,
|
|
377
|
+
...options,
|
|
378
|
+
headers: buildHeaders([
|
|
379
|
+
{
|
|
380
|
+
...(featurebaseVersion?.toString() != null ?
|
|
381
|
+
{ 'Featurebase-Version': featurebaseVersion?.toString() }
|
|
382
|
+
: undefined),
|
|
383
|
+
},
|
|
384
|
+
options?.headers,
|
|
385
|
+
]),
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
|
|
318
389
|
/**
|
|
319
390
|
* Search feedback posts with a structured filter AST, full-text search, sorting,
|
|
320
391
|
* and cursor pagination.
|
|
@@ -1476,6 +1547,37 @@ export interface PostDeleteParams {
|
|
|
1476
1547
|
'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
|
|
1477
1548
|
}
|
|
1478
1549
|
|
|
1550
|
+
export interface PostMergeParams {
|
|
1551
|
+
/**
|
|
1552
|
+
* Body param: ID of the post that receives the source post data
|
|
1553
|
+
*/
|
|
1554
|
+
destinationPostId: string;
|
|
1555
|
+
|
|
1556
|
+
/**
|
|
1557
|
+
* Body param: ID of the post to merge into the destination post
|
|
1558
|
+
*/
|
|
1559
|
+
sourcePostId: string;
|
|
1560
|
+
|
|
1561
|
+
/**
|
|
1562
|
+
* Header param: API version for this request. Defaults to your organization's
|
|
1563
|
+
* configured API version if not specified.
|
|
1564
|
+
*/
|
|
1565
|
+
'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
export interface PostUnmergeParams {
|
|
1569
|
+
/**
|
|
1570
|
+
* Body param: ID of the merged post to restore
|
|
1571
|
+
*/
|
|
1572
|
+
postId: string;
|
|
1573
|
+
|
|
1574
|
+
/**
|
|
1575
|
+
* Header param: API version for this request. Defaults to your organization's
|
|
1576
|
+
* configured API version if not specified.
|
|
1577
|
+
*/
|
|
1578
|
+
'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1479
1581
|
export interface PostSearchParams {
|
|
1480
1582
|
/**
|
|
1481
1583
|
* Body param: An opaque cursor for pagination. Use the `nextCursor` value from a
|
|
@@ -1561,6 +1663,8 @@ export declare namespace Posts {
|
|
|
1561
1663
|
type PostRetrieveParams as PostRetrieveParams,
|
|
1562
1664
|
type PostUpdateParams as PostUpdateParams,
|
|
1563
1665
|
type PostDeleteParams as PostDeleteParams,
|
|
1666
|
+
type PostMergeParams as PostMergeParams,
|
|
1667
|
+
type PostUnmergeParams as PostUnmergeParams,
|
|
1564
1668
|
type PostSearchParams as PostSearchParams,
|
|
1565
1669
|
};
|
|
1566
1670
|
|
package/src/resources/reports.ts
CHANGED
|
@@ -81,6 +81,31 @@ export class Reports extends APIResource {
|
|
|
81
81
|
* 5. Optionally pass `compareStartDate` / `compareEndDate` to get `previousValue`
|
|
82
82
|
* / `deltaPercent` alongside every data point.
|
|
83
83
|
*
|
|
84
|
+
* ### Top-N and Show Other
|
|
85
|
+
*
|
|
86
|
+
* For high-cardinality breakdowns, cap the number of returned series:
|
|
87
|
+
*
|
|
88
|
+
* - `topValuesLimit` keeps only the top **N** `groupBy` values;
|
|
89
|
+
* `segmentTopValuesLimit` does the same for `segmentBy`. Allowed values: **5, 7,
|
|
90
|
+
* 10, 15, 20**. `topValuesLimit` requires `groupBy`; `segmentTopValuesLimit`
|
|
91
|
+
* requires `segmentBy`.
|
|
92
|
+
* - Members are ranked by the selected metric/aggregation over the **full filtered
|
|
93
|
+
* primary range**, so the ranked set is **stable across every time bucket** (a
|
|
94
|
+
* value that spikes in one bucket but is small overall does not enter the set).
|
|
95
|
+
* A comparison period reuses the **primary period's** ranked set — it is never
|
|
96
|
+
* re-ranked, so the legend stays identical period-over-period.
|
|
97
|
+
* - `showOther` / `segmentShowOther` append a single synthetic bucket with id
|
|
98
|
+
* `__other__` and label `Other` that sums every value outside the top set.
|
|
99
|
+
* Because the values are summed, Show Other is only supported for **additive
|
|
100
|
+
* aggregations** (`count`, `sum`, `value`); it is rejected for `avg`, `median`,
|
|
101
|
+
* `min`, `max`, `range`, `percentile`, and for percentage metrics (whose ratios
|
|
102
|
+
* cannot be summed). `showOther` also requires `topValuesLimit` (and
|
|
103
|
+
* `segmentShowOther` requires `segmentTopValuesLimit`). Plain `topValuesLimit`
|
|
104
|
+
* (without Show Other) works with any aggregation.
|
|
105
|
+
* - The `__other__` group/segment aggregates rows outside the selected top groups
|
|
106
|
+
* and **cannot be drilled into** (`POST /v2/reports/drill-in` rejects
|
|
107
|
+
* `dataPointFilters.groupValue` / `segmentValue` equal to `__other__`).
|
|
108
|
+
*
|
|
84
109
|
* ### Example
|
|
85
110
|
*
|
|
86
111
|
* ```json
|
|
@@ -225,10 +250,10 @@ export class Reports extends APIResource {
|
|
|
225
250
|
* @example
|
|
226
251
|
* ```ts
|
|
227
252
|
* const response = await client.reports.drillIn({
|
|
228
|
-
* endDate: '
|
|
253
|
+
* endDate: '2026-07-15',
|
|
229
254
|
* granularity: 'day',
|
|
230
255
|
* metric: 'new_conversations',
|
|
231
|
-
* startDate: '
|
|
256
|
+
* startDate: '2026-07-12',
|
|
232
257
|
* });
|
|
233
258
|
* ```
|
|
234
259
|
*/
|
|
@@ -446,6 +471,36 @@ export interface ReportMetric {
|
|
|
446
471
|
type: 'count' | 'percentage' | 'duration' | 'number';
|
|
447
472
|
|
|
448
473
|
unit: 'count' | 'percentage' | 'duration_ms' | 'number';
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Local calendar date (ISO 8601) from which this specific metric has data, when it
|
|
477
|
+
* differs from the global reporting floor. Windows ending before this date are
|
|
478
|
+
* rejected for this metric.
|
|
479
|
+
*/
|
|
480
|
+
dataAvailableFromIso?: string;
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Whether this variant is the default selection for its `variantGroupId`.
|
|
484
|
+
*/
|
|
485
|
+
isDefaultVariant?: boolean;
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Metrics sharing a `variantGroupId` are timestamp variants of one logical metric
|
|
489
|
+
* (same display `name`); each measures the same population at a different
|
|
490
|
+
* timestamp. Query the concrete metric `id` to pick a variant.
|
|
491
|
+
*/
|
|
492
|
+
variantGroupId?: string;
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Stable identifier for this variant within its group (e.g. `created_at`,
|
|
496
|
+
* `started_at`).
|
|
497
|
+
*/
|
|
498
|
+
variantId?: string;
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Human-readable variant label for pickers (e.g. `Created at`, `Started at`).
|
|
502
|
+
*/
|
|
503
|
+
variantLabel?: string;
|
|
449
504
|
}
|
|
450
505
|
|
|
451
506
|
export interface ReportSegmentDatum {
|
|
@@ -497,6 +552,7 @@ export interface ReportDrillInResponse {
|
|
|
497
552
|
| boolean
|
|
498
553
|
| Array<string>
|
|
499
554
|
| ReportDrillInResponse.ReportDrillInIdentityCell
|
|
555
|
+
| ReportDrillInResponse.ReportDrillInSourceDetailsCell
|
|
500
556
|
| null;
|
|
501
557
|
}>;
|
|
502
558
|
|
|
@@ -514,6 +570,11 @@ export namespace ReportDrillInResponse {
|
|
|
514
570
|
|
|
515
571
|
name: string;
|
|
516
572
|
|
|
573
|
+
/**
|
|
574
|
+
* Whether this column may be used in the drill-in sort request.
|
|
575
|
+
*/
|
|
576
|
+
supportsSort: boolean;
|
|
577
|
+
|
|
517
578
|
valueType: string;
|
|
518
579
|
|
|
519
580
|
category?: string;
|
|
@@ -523,6 +584,43 @@ export namespace ReportDrillInResponse {
|
|
|
523
584
|
datasetId: string;
|
|
524
585
|
|
|
525
586
|
metricId: string;
|
|
587
|
+
|
|
588
|
+
rawMetricId: string;
|
|
589
|
+
|
|
590
|
+
reconciliation: Meta.Reconciliation;
|
|
591
|
+
|
|
592
|
+
rowGrain: string;
|
|
593
|
+
|
|
594
|
+
rowSemantics: 'metric_rows' | 'numerator_rows';
|
|
595
|
+
|
|
596
|
+
sourceFact: string;
|
|
597
|
+
|
|
598
|
+
emptyReason?: 'no_matching_rows' | 'denominator_unavailable';
|
|
599
|
+
|
|
600
|
+
metricRowId?: string;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
export namespace Meta {
|
|
604
|
+
export interface Reconciliation {
|
|
605
|
+
kind:
|
|
606
|
+
| 'rows'
|
|
607
|
+
| 'actions_across_conversations'
|
|
608
|
+
| 'active_hour_rate'
|
|
609
|
+
| 'positive_ratings_over_eligible_ratings'
|
|
610
|
+
| 'missed_over_evaluated';
|
|
611
|
+
|
|
612
|
+
rowCount: number;
|
|
613
|
+
|
|
614
|
+
status: 'not_applicable' | 'available' | 'denominator_unavailable';
|
|
615
|
+
|
|
616
|
+
denominatorHours?: number;
|
|
617
|
+
|
|
618
|
+
displayedRate?: number;
|
|
619
|
+
|
|
620
|
+
eligibleDenominatorTotal?: number;
|
|
621
|
+
|
|
622
|
+
rawNumeratorTotal?: number;
|
|
623
|
+
}
|
|
526
624
|
}
|
|
527
625
|
|
|
528
626
|
export interface ReportDrillInIdentityCell {
|
|
@@ -535,6 +633,26 @@ export namespace ReportDrillInResponse {
|
|
|
535
633
|
avatarUrl?: string;
|
|
536
634
|
|
|
537
635
|
color?: string;
|
|
636
|
+
|
|
637
|
+
provenance?: 'current' | 'historical' | 'fallback' | 'unassigned';
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
export interface ReportDrillInSourceDetailsCell {
|
|
641
|
+
items: Array<ReportDrillInSourceDetailsCell.Item>;
|
|
642
|
+
|
|
643
|
+
kind: 'source_details';
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
export namespace ReportDrillInSourceDetailsCell {
|
|
647
|
+
export interface Item {
|
|
648
|
+
label: string;
|
|
649
|
+
|
|
650
|
+
id?: string;
|
|
651
|
+
|
|
652
|
+
type?: string;
|
|
653
|
+
|
|
654
|
+
url?: string;
|
|
655
|
+
}
|
|
538
656
|
}
|
|
539
657
|
}
|
|
540
658
|
|
|
@@ -802,12 +920,48 @@ export interface ReportQueryParams {
|
|
|
802
920
|
*/
|
|
803
921
|
segmentBy?: string;
|
|
804
922
|
|
|
923
|
+
/**
|
|
924
|
+
* Body param: When `true`, fold `segmentBy` values outside the top set into a
|
|
925
|
+
* synthetic `__other__` / `Other` segment. Only supported for additive
|
|
926
|
+
* aggregations (`count`, `sum`, `value`) and not for percentage metrics. The
|
|
927
|
+
* `__other__` segment cannot be drilled into. Requires `segmentBy` and
|
|
928
|
+
* `segmentTopValuesLimit`.
|
|
929
|
+
*/
|
|
930
|
+
segmentShowOther?: boolean;
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Body param: Keep only the top N `segmentBy` values per series, ranked by the
|
|
934
|
+
* selected metric over the full filtered primary range. Under a time View-by the
|
|
935
|
+
* ranked segment set is identical across every bucket; under a dimension View-by
|
|
936
|
+
* the ranking is applied within each retained parent group. Allowed values: `5`,
|
|
937
|
+
* `7`, `10`, `15`, `20`. Requires `segmentBy`.
|
|
938
|
+
*/
|
|
939
|
+
segmentTopValuesLimit?: 5 | 7 | 10 | 15 | 20;
|
|
940
|
+
|
|
941
|
+
/**
|
|
942
|
+
* Body param: When `true`, append a single synthetic group with id `__other__` and
|
|
943
|
+
* label `Other` that sums the values of every `groupBy` value outside the top set.
|
|
944
|
+
* Only supported for additive aggregations (`count`, `sum`, `value`) and not for
|
|
945
|
+
* percentage metrics. The `__other__` group cannot be drilled into. Requires
|
|
946
|
+
* `groupBy` and `topValuesLimit`.
|
|
947
|
+
*/
|
|
948
|
+
showOther?: boolean;
|
|
949
|
+
|
|
805
950
|
/**
|
|
806
951
|
* Body param: IANA timezone for date bucketing (e.g. `America/New_York`). Defaults
|
|
807
952
|
* to UTC.
|
|
808
953
|
*/
|
|
809
954
|
timezone?: string;
|
|
810
955
|
|
|
956
|
+
/**
|
|
957
|
+
* Body param: Keep only the top N `groupBy` (View-by) values, ranked by the
|
|
958
|
+
* selected metric/aggregation over the full filtered primary range. Allowed
|
|
959
|
+
* values: `5`, `7`, `10`, `15`, `20`. The ranked set is stable across every time
|
|
960
|
+
* bucket, and a comparison period reuses the primary period's ranked set (never
|
|
961
|
+
* re-ranked). Requires `groupBy`.
|
|
962
|
+
*/
|
|
963
|
+
topValuesLimit?: 5 | 7 | 10 | 15 | 20;
|
|
964
|
+
|
|
811
965
|
/**
|
|
812
966
|
* Body param: Result shape. `standard` returns a time series (plus grouped/segment
|
|
813
967
|
* data when requested), `hourly_heatmap` buckets by day-of-week × hour-of-day,
|
|
@@ -855,7 +1009,8 @@ export interface ReportLookupFilterValuesParams {
|
|
|
855
1009
|
|
|
856
1010
|
export interface ReportDrillInParams {
|
|
857
1011
|
/**
|
|
858
|
-
* Body param
|
|
1012
|
+
* Body param: End of the reporting window (ISO 8601 date or datetime, inclusive).
|
|
1013
|
+
* Windows ending before 2026-07-12 are rejected.
|
|
859
1014
|
*/
|
|
860
1015
|
endDate: string;
|
|
861
1016
|
|
|
@@ -870,10 +1025,23 @@ export interface ReportDrillInParams {
|
|
|
870
1025
|
metric: string;
|
|
871
1026
|
|
|
872
1027
|
/**
|
|
873
|
-
* Body param
|
|
1028
|
+
* Body param: Start of the reporting window (ISO 8601 date or datetime,
|
|
1029
|
+
* inclusive). Reporting data is available from 2026-07-12; crossing windows are
|
|
1030
|
+
* clamped to that boundary.
|
|
874
1031
|
*/
|
|
875
1032
|
startDate: string;
|
|
876
1033
|
|
|
1034
|
+
/**
|
|
1035
|
+
* Body param: Stable editor ID of the saved chart that launched this drill-in.
|
|
1036
|
+
*/
|
|
1037
|
+
chartEditorId?: string;
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* Body param: Column IDs to include in each returned row. Omit for legacy
|
|
1041
|
+
* full-width static rows; pass an empty array to use `defaultColumnIds`.
|
|
1042
|
+
*/
|
|
1043
|
+
columns?: Array<string>;
|
|
1044
|
+
|
|
877
1045
|
/**
|
|
878
1046
|
* Body param: Narrows the drill-in to one data point from a previous query (time
|
|
879
1047
|
* bucket, group value, heatmap cell, or flow edge). Pass `{}` to list all
|
|
@@ -920,6 +1088,11 @@ export interface ReportDrillInParams {
|
|
|
920
1088
|
*/
|
|
921
1089
|
selectedMetricId?: string;
|
|
922
1090
|
|
|
1091
|
+
/**
|
|
1092
|
+
* Body param: Stable metric-row ID selected within the launching chart.
|
|
1093
|
+
*/
|
|
1094
|
+
selectedMetricRowId?: string;
|
|
1095
|
+
|
|
923
1096
|
/**
|
|
924
1097
|
* Body param
|
|
925
1098
|
*/
|