featurebase-node 0.8.1 → 0.10.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/CHANGELOG.md +18 -0
- package/client.d.mts +3 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -1
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +15 -0
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +15 -0
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +25 -1
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +23 -0
- package/core/pagination.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/support/conversations/conversations.d.mts +817 -8
- package/resources/support/conversations/conversations.d.mts.map +1 -1
- package/resources/support/conversations/conversations.d.ts +817 -8
- package/resources/support/conversations/conversations.d.ts.map +1 -1
- package/resources/support/conversations/conversations.js +244 -4
- package/resources/support/conversations/conversations.js.map +1 -1
- package/resources/support/conversations/conversations.mjs +244 -4
- package/resources/support/conversations/conversations.mjs.map +1 -1
- package/resources/support/conversations/index.d.mts +1 -2
- package/resources/support/conversations/index.d.mts.map +1 -1
- package/resources/support/conversations/index.d.ts +1 -2
- package/resources/support/conversations/index.d.ts.map +1 -1
- package/resources/support/conversations/index.js +1 -3
- package/resources/support/conversations/index.js.map +1 -1
- package/resources/support/conversations/index.mjs +0 -1
- package/resources/support/conversations/index.mjs.map +1 -1
- package/resources/support/index.d.mts +1 -1
- package/resources/support/index.d.mts.map +1 -1
- package/resources/support/index.d.ts +1 -1
- package/resources/support/index.d.ts.map +1 -1
- package/resources/support/index.js.map +1 -1
- package/resources/support/index.mjs.map +1 -1
- package/resources/support/support.d.mts +2 -2
- package/resources/support/support.d.mts.map +1 -1
- package/resources/support/support.d.ts +2 -2
- package/resources/support/support.d.ts.map +1 -1
- package/resources/support/support.js.map +1 -1
- package/resources/support/support.mjs.map +1 -1
- package/src/client.ts +13 -1
- package/src/core/pagination.ts +49 -0
- package/src/resources/support/conversations/conversations.ts +1068 -88
- package/src/resources/support/conversations/index.ts +6 -7
- package/src/resources/support/index.ts +6 -0
- package/src/resources/support/support.ts +12 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/support/conversations/tags.d.mts +0 -200
- package/resources/support/conversations/tags.d.mts.map +0 -1
- package/resources/support/conversations/tags.d.ts +0 -200
- package/resources/support/conversations/tags.d.ts.map +0 -1
- package/resources/support/conversations/tags.js +0 -146
- package/resources/support/conversations/tags.js.map +0 -1
- package/resources/support/conversations/tags.mjs +0 -142
- package/resources/support/conversations/tags.mjs.map +0 -1
- package/src/resources/support/conversations/tags.ts +0 -260
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Tags = void 0;
|
|
5
|
-
const resource_1 = require("../../../core/resource.js");
|
|
6
|
-
const headers_1 = require("../../../internal/headers.js");
|
|
7
|
-
const path_1 = require("../../../internal/utils/path.js");
|
|
8
|
-
/**
|
|
9
|
-
* Conversations are messenger/inbox conversations in your Featurebase organization. Use this endpoint to list and retrieve conversation information.
|
|
10
|
-
*/
|
|
11
|
-
class Tags extends resource_1.APIResource {
|
|
12
|
-
/**
|
|
13
|
-
* Attaches a workspace tag to a conversation.
|
|
14
|
-
*
|
|
15
|
-
* This endpoint requires both the tag ID to attach and the `actingAdminId` of the
|
|
16
|
-
* admin on whose behalf the mutation is recorded.
|
|
17
|
-
*
|
|
18
|
-
* ### Path Parameters
|
|
19
|
-
*
|
|
20
|
-
* - `id` - The conversation ID (short ID)
|
|
21
|
-
*
|
|
22
|
-
* ### Request Body
|
|
23
|
-
*
|
|
24
|
-
* | Field | Type | Required | Description |
|
|
25
|
-
* | --------------- | ------ | -------- | ------------------------------------------------------------------------ |
|
|
26
|
-
* | `tagId` | string | Yes | The Featurebase tag ID to attach |
|
|
27
|
-
* | `actingAdminId` | string | Yes | The admin performing the mutation. Must be a member of the organization. |
|
|
28
|
-
*
|
|
29
|
-
* ### Behavior
|
|
30
|
-
*
|
|
31
|
-
* Featurebase resolves the latest taggable reply/message in the conversation and
|
|
32
|
-
* records the tag attachment against that part so audit metadata remains
|
|
33
|
-
* deterministic.
|
|
34
|
-
*
|
|
35
|
-
* ### Response
|
|
36
|
-
*
|
|
37
|
-
* Returns the affected tag plus attachment metadata such as `targetPartId`,
|
|
38
|
-
* `appliedAt`, and `appliedBy`.
|
|
39
|
-
*
|
|
40
|
-
* ### Example Request
|
|
41
|
-
*
|
|
42
|
-
* ```json
|
|
43
|
-
* {
|
|
44
|
-
* "tagId": "67ec1234abcd5678ef901234",
|
|
45
|
-
* "actingAdminId": "507f1f77bcf86cd799439011"
|
|
46
|
-
* }
|
|
47
|
-
* ```
|
|
48
|
-
*
|
|
49
|
-
* ### Version Availability
|
|
50
|
-
*
|
|
51
|
-
* This endpoint is only available in API version 2026-01-01.nova and newer.
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```ts
|
|
55
|
-
* const attachedConversationTag =
|
|
56
|
-
* await client.support.conversations.tags.attach('12345', {
|
|
57
|
-
* actingAdminId: '507f1f77bcf86cd799439011',
|
|
58
|
-
* tagId: '67ec1234abcd5678ef901234',
|
|
59
|
-
* });
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
attach(id, params, options) {
|
|
63
|
-
const { 'Featurebase-Version': featurebaseVersion, ...body } = params;
|
|
64
|
-
return this._client.post((0, path_1.path) `/v2/conversations/${id}/tags`, {
|
|
65
|
-
body,
|
|
66
|
-
...options,
|
|
67
|
-
headers: (0, headers_1.buildHeaders)([
|
|
68
|
-
{
|
|
69
|
-
...(featurebaseVersion?.toString() != null ?
|
|
70
|
-
{ 'Featurebase-Version': featurebaseVersion?.toString() }
|
|
71
|
-
: undefined),
|
|
72
|
-
},
|
|
73
|
-
options?.headers,
|
|
74
|
-
]),
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Removes a workspace tag from a conversation.
|
|
79
|
-
*
|
|
80
|
-
* This endpoint requires the `actingAdminId` of the admin on whose behalf the
|
|
81
|
-
* mutation is recorded.
|
|
82
|
-
*
|
|
83
|
-
* ### Path Parameters
|
|
84
|
-
*
|
|
85
|
-
* - `id` - The conversation ID (short ID)
|
|
86
|
-
* - `tagId` - The Featurebase tag ID to remove
|
|
87
|
-
*
|
|
88
|
-
* ### Request Body
|
|
89
|
-
*
|
|
90
|
-
* | Field | Type | Required | Description |
|
|
91
|
-
* | --------------- | ------ | -------- | ------------------------------------------------------------------------ |
|
|
92
|
-
* | `actingAdminId` | string | Yes | The admin performing the mutation. Must be a member of the organization. |
|
|
93
|
-
*
|
|
94
|
-
* ### Behavior
|
|
95
|
-
*
|
|
96
|
-
* Featurebase resolves the latest taggable reply/message in the conversation and
|
|
97
|
-
* records the tag removal against that part so audit metadata remains
|
|
98
|
-
* deterministic.
|
|
99
|
-
*
|
|
100
|
-
* ### Response
|
|
101
|
-
*
|
|
102
|
-
* Returns the affected tag payload with the most relevant attachment metadata
|
|
103
|
-
* available for that relationship.
|
|
104
|
-
*
|
|
105
|
-
* ### Example Request
|
|
106
|
-
*
|
|
107
|
-
* ```json
|
|
108
|
-
* {
|
|
109
|
-
* "actingAdminId": "507f1f77bcf86cd799439011"
|
|
110
|
-
* }
|
|
111
|
-
* ```
|
|
112
|
-
*
|
|
113
|
-
* ### Version Availability
|
|
114
|
-
*
|
|
115
|
-
* This endpoint is only available in API version 2026-01-01.nova and newer.
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
* ```ts
|
|
119
|
-
* const attachedConversationTag =
|
|
120
|
-
* await client.support.conversations.tags.detach(
|
|
121
|
-
* '67ec1234abcd5678ef901234',
|
|
122
|
-
* {
|
|
123
|
-
* id: '12345',
|
|
124
|
-
* actingAdminId: '507f1f77bcf86cd799439011',
|
|
125
|
-
* },
|
|
126
|
-
* );
|
|
127
|
-
* ```
|
|
128
|
-
*/
|
|
129
|
-
detach(tagID, params, options) {
|
|
130
|
-
const { id, 'Featurebase-Version': featurebaseVersion, ...body } = params;
|
|
131
|
-
return this._client.delete((0, path_1.path) `/v2/conversations/${id}/tags/${tagID}`, {
|
|
132
|
-
body,
|
|
133
|
-
...options,
|
|
134
|
-
headers: (0, headers_1.buildHeaders)([
|
|
135
|
-
{
|
|
136
|
-
...(featurebaseVersion?.toString() != null ?
|
|
137
|
-
{ 'Featurebase-Version': featurebaseVersion?.toString() }
|
|
138
|
-
: undefined),
|
|
139
|
-
},
|
|
140
|
-
options?.headers,
|
|
141
|
-
]),
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
exports.Tags = Tags;
|
|
146
|
-
//# sourceMappingURL=tags.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../../src/resources/support/conversations/tags.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,0DAAyD;AAEzD,0DAAoD;AAEpD;;GAEG;AACH,MAAa,IAAK,SAAQ,sBAAW;IACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiDG;IACH,MAAM,CAAC,EAAU,EAAE,MAAuB,EAAE,OAAwB;QAClE,MAAM,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,qBAAqB,EAAE,OAAO,EAAE;YAC3D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB;oBACE,GAAG,CAAC,kBAAkB,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC;wBAC1C,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,EAAE;wBAC3D,CAAC,CAAC,SAAS,CAAC;iBACb;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACH,MAAM,CACJ,KAAa,EACb,MAAuB,EACvB,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,qBAAqB,EAAE,SAAS,KAAK,EAAE,EAAE;YACtE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB;oBACE,GAAG,CAAC,kBAAkB,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC;wBAC1C,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,EAAE;wBAC3D,CAAC,CAAC,SAAS,CAAC;iBACb;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AA1ID,oBA0IC"}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
-
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
4
|
-
import { path } from "../../../internal/utils/path.mjs";
|
|
5
|
-
/**
|
|
6
|
-
* Conversations are messenger/inbox conversations in your Featurebase organization. Use this endpoint to list and retrieve conversation information.
|
|
7
|
-
*/
|
|
8
|
-
export class Tags extends APIResource {
|
|
9
|
-
/**
|
|
10
|
-
* Attaches a workspace tag to a conversation.
|
|
11
|
-
*
|
|
12
|
-
* This endpoint requires both the tag ID to attach and the `actingAdminId` of the
|
|
13
|
-
* admin on whose behalf the mutation is recorded.
|
|
14
|
-
*
|
|
15
|
-
* ### Path Parameters
|
|
16
|
-
*
|
|
17
|
-
* - `id` - The conversation ID (short ID)
|
|
18
|
-
*
|
|
19
|
-
* ### Request Body
|
|
20
|
-
*
|
|
21
|
-
* | Field | Type | Required | Description |
|
|
22
|
-
* | --------------- | ------ | -------- | ------------------------------------------------------------------------ |
|
|
23
|
-
* | `tagId` | string | Yes | The Featurebase tag ID to attach |
|
|
24
|
-
* | `actingAdminId` | string | Yes | The admin performing the mutation. Must be a member of the organization. |
|
|
25
|
-
*
|
|
26
|
-
* ### Behavior
|
|
27
|
-
*
|
|
28
|
-
* Featurebase resolves the latest taggable reply/message in the conversation and
|
|
29
|
-
* records the tag attachment against that part so audit metadata remains
|
|
30
|
-
* deterministic.
|
|
31
|
-
*
|
|
32
|
-
* ### Response
|
|
33
|
-
*
|
|
34
|
-
* Returns the affected tag plus attachment metadata such as `targetPartId`,
|
|
35
|
-
* `appliedAt`, and `appliedBy`.
|
|
36
|
-
*
|
|
37
|
-
* ### Example Request
|
|
38
|
-
*
|
|
39
|
-
* ```json
|
|
40
|
-
* {
|
|
41
|
-
* "tagId": "67ec1234abcd5678ef901234",
|
|
42
|
-
* "actingAdminId": "507f1f77bcf86cd799439011"
|
|
43
|
-
* }
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* ### Version Availability
|
|
47
|
-
*
|
|
48
|
-
* This endpoint is only available in API version 2026-01-01.nova and newer.
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```ts
|
|
52
|
-
* const attachedConversationTag =
|
|
53
|
-
* await client.support.conversations.tags.attach('12345', {
|
|
54
|
-
* actingAdminId: '507f1f77bcf86cd799439011',
|
|
55
|
-
* tagId: '67ec1234abcd5678ef901234',
|
|
56
|
-
* });
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
attach(id, params, options) {
|
|
60
|
-
const { 'Featurebase-Version': featurebaseVersion, ...body } = params;
|
|
61
|
-
return this._client.post(path `/v2/conversations/${id}/tags`, {
|
|
62
|
-
body,
|
|
63
|
-
...options,
|
|
64
|
-
headers: buildHeaders([
|
|
65
|
-
{
|
|
66
|
-
...(featurebaseVersion?.toString() != null ?
|
|
67
|
-
{ 'Featurebase-Version': featurebaseVersion?.toString() }
|
|
68
|
-
: undefined),
|
|
69
|
-
},
|
|
70
|
-
options?.headers,
|
|
71
|
-
]),
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Removes a workspace tag from a conversation.
|
|
76
|
-
*
|
|
77
|
-
* This endpoint requires the `actingAdminId` of the admin on whose behalf the
|
|
78
|
-
* mutation is recorded.
|
|
79
|
-
*
|
|
80
|
-
* ### Path Parameters
|
|
81
|
-
*
|
|
82
|
-
* - `id` - The conversation ID (short ID)
|
|
83
|
-
* - `tagId` - The Featurebase tag ID to remove
|
|
84
|
-
*
|
|
85
|
-
* ### Request Body
|
|
86
|
-
*
|
|
87
|
-
* | Field | Type | Required | Description |
|
|
88
|
-
* | --------------- | ------ | -------- | ------------------------------------------------------------------------ |
|
|
89
|
-
* | `actingAdminId` | string | Yes | The admin performing the mutation. Must be a member of the organization. |
|
|
90
|
-
*
|
|
91
|
-
* ### Behavior
|
|
92
|
-
*
|
|
93
|
-
* Featurebase resolves the latest taggable reply/message in the conversation and
|
|
94
|
-
* records the tag removal against that part so audit metadata remains
|
|
95
|
-
* deterministic.
|
|
96
|
-
*
|
|
97
|
-
* ### Response
|
|
98
|
-
*
|
|
99
|
-
* Returns the affected tag payload with the most relevant attachment metadata
|
|
100
|
-
* available for that relationship.
|
|
101
|
-
*
|
|
102
|
-
* ### Example Request
|
|
103
|
-
*
|
|
104
|
-
* ```json
|
|
105
|
-
* {
|
|
106
|
-
* "actingAdminId": "507f1f77bcf86cd799439011"
|
|
107
|
-
* }
|
|
108
|
-
* ```
|
|
109
|
-
*
|
|
110
|
-
* ### Version Availability
|
|
111
|
-
*
|
|
112
|
-
* This endpoint is only available in API version 2026-01-01.nova and newer.
|
|
113
|
-
*
|
|
114
|
-
* @example
|
|
115
|
-
* ```ts
|
|
116
|
-
* const attachedConversationTag =
|
|
117
|
-
* await client.support.conversations.tags.detach(
|
|
118
|
-
* '67ec1234abcd5678ef901234',
|
|
119
|
-
* {
|
|
120
|
-
* id: '12345',
|
|
121
|
-
* actingAdminId: '507f1f77bcf86cd799439011',
|
|
122
|
-
* },
|
|
123
|
-
* );
|
|
124
|
-
* ```
|
|
125
|
-
*/
|
|
126
|
-
detach(tagID, params, options) {
|
|
127
|
-
const { id, 'Featurebase-Version': featurebaseVersion, ...body } = params;
|
|
128
|
-
return this._client.delete(path `/v2/conversations/${id}/tags/${tagID}`, {
|
|
129
|
-
body,
|
|
130
|
-
...options,
|
|
131
|
-
headers: buildHeaders([
|
|
132
|
-
{
|
|
133
|
-
...(featurebaseVersion?.toString() != null ?
|
|
134
|
-
{ 'Featurebase-Version': featurebaseVersion?.toString() }
|
|
135
|
-
: undefined),
|
|
136
|
-
},
|
|
137
|
-
options?.headers,
|
|
138
|
-
]),
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
//# sourceMappingURL=tags.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tags.mjs","sourceRoot":"","sources":["../../../src/resources/support/conversations/tags.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiDG;IACH,MAAM,CAAC,EAAU,EAAE,MAAuB,EAAE,OAAwB;QAClE,MAAM,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,qBAAqB,EAAE,OAAO,EAAE;YAC3D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB;oBACE,GAAG,CAAC,kBAAkB,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC;wBAC1C,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,EAAE;wBAC3D,CAAC,CAAC,SAAS,CAAC;iBACb;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACH,MAAM,CACJ,KAAa,EACb,MAAuB,EACvB,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,qBAAqB,EAAE,SAAS,KAAK,EAAE,EAAE;YACtE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB;oBACE,GAAG,CAAC,kBAAkB,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC;wBAC1C,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,EAAE;wBAC3D,CAAC,CAAC,SAAS,CAAC;iBACb;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../../core/resource';
|
|
4
|
-
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
-
import { buildHeaders } from '../../../internal/headers';
|
|
6
|
-
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
-
import { path } from '../../../internal/utils/path';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Conversations are messenger/inbox conversations in your Featurebase organization. Use this endpoint to list and retrieve conversation information.
|
|
11
|
-
*/
|
|
12
|
-
export class Tags extends APIResource {
|
|
13
|
-
/**
|
|
14
|
-
* Attaches a workspace tag to a conversation.
|
|
15
|
-
*
|
|
16
|
-
* This endpoint requires both the tag ID to attach and the `actingAdminId` of the
|
|
17
|
-
* admin on whose behalf the mutation is recorded.
|
|
18
|
-
*
|
|
19
|
-
* ### Path Parameters
|
|
20
|
-
*
|
|
21
|
-
* - `id` - The conversation ID (short ID)
|
|
22
|
-
*
|
|
23
|
-
* ### Request Body
|
|
24
|
-
*
|
|
25
|
-
* | Field | Type | Required | Description |
|
|
26
|
-
* | --------------- | ------ | -------- | ------------------------------------------------------------------------ |
|
|
27
|
-
* | `tagId` | string | Yes | The Featurebase tag ID to attach |
|
|
28
|
-
* | `actingAdminId` | string | Yes | The admin performing the mutation. Must be a member of the organization. |
|
|
29
|
-
*
|
|
30
|
-
* ### Behavior
|
|
31
|
-
*
|
|
32
|
-
* Featurebase resolves the latest taggable reply/message in the conversation and
|
|
33
|
-
* records the tag attachment against that part so audit metadata remains
|
|
34
|
-
* deterministic.
|
|
35
|
-
*
|
|
36
|
-
* ### Response
|
|
37
|
-
*
|
|
38
|
-
* Returns the affected tag plus attachment metadata such as `targetPartId`,
|
|
39
|
-
* `appliedAt`, and `appliedBy`.
|
|
40
|
-
*
|
|
41
|
-
* ### Example Request
|
|
42
|
-
*
|
|
43
|
-
* ```json
|
|
44
|
-
* {
|
|
45
|
-
* "tagId": "67ec1234abcd5678ef901234",
|
|
46
|
-
* "actingAdminId": "507f1f77bcf86cd799439011"
|
|
47
|
-
* }
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* ### Version Availability
|
|
51
|
-
*
|
|
52
|
-
* This endpoint is only available in API version 2026-01-01.nova and newer.
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```ts
|
|
56
|
-
* const attachedConversationTag =
|
|
57
|
-
* await client.support.conversations.tags.attach('12345', {
|
|
58
|
-
* actingAdminId: '507f1f77bcf86cd799439011',
|
|
59
|
-
* tagId: '67ec1234abcd5678ef901234',
|
|
60
|
-
* });
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
attach(id: string, params: TagAttachParams, options?: RequestOptions): APIPromise<AttachedConversationTag> {
|
|
64
|
-
const { 'Featurebase-Version': featurebaseVersion, ...body } = params;
|
|
65
|
-
return this._client.post(path`/v2/conversations/${id}/tags`, {
|
|
66
|
-
body,
|
|
67
|
-
...options,
|
|
68
|
-
headers: buildHeaders([
|
|
69
|
-
{
|
|
70
|
-
...(featurebaseVersion?.toString() != null ?
|
|
71
|
-
{ 'Featurebase-Version': featurebaseVersion?.toString() }
|
|
72
|
-
: undefined),
|
|
73
|
-
},
|
|
74
|
-
options?.headers,
|
|
75
|
-
]),
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Removes a workspace tag from a conversation.
|
|
81
|
-
*
|
|
82
|
-
* This endpoint requires the `actingAdminId` of the admin on whose behalf the
|
|
83
|
-
* mutation is recorded.
|
|
84
|
-
*
|
|
85
|
-
* ### Path Parameters
|
|
86
|
-
*
|
|
87
|
-
* - `id` - The conversation ID (short ID)
|
|
88
|
-
* - `tagId` - The Featurebase tag ID to remove
|
|
89
|
-
*
|
|
90
|
-
* ### Request Body
|
|
91
|
-
*
|
|
92
|
-
* | Field | Type | Required | Description |
|
|
93
|
-
* | --------------- | ------ | -------- | ------------------------------------------------------------------------ |
|
|
94
|
-
* | `actingAdminId` | string | Yes | The admin performing the mutation. Must be a member of the organization. |
|
|
95
|
-
*
|
|
96
|
-
* ### Behavior
|
|
97
|
-
*
|
|
98
|
-
* Featurebase resolves the latest taggable reply/message in the conversation and
|
|
99
|
-
* records the tag removal against that part so audit metadata remains
|
|
100
|
-
* deterministic.
|
|
101
|
-
*
|
|
102
|
-
* ### Response
|
|
103
|
-
*
|
|
104
|
-
* Returns the affected tag payload with the most relevant attachment metadata
|
|
105
|
-
* available for that relationship.
|
|
106
|
-
*
|
|
107
|
-
* ### Example Request
|
|
108
|
-
*
|
|
109
|
-
* ```json
|
|
110
|
-
* {
|
|
111
|
-
* "actingAdminId": "507f1f77bcf86cd799439011"
|
|
112
|
-
* }
|
|
113
|
-
* ```
|
|
114
|
-
*
|
|
115
|
-
* ### Version Availability
|
|
116
|
-
*
|
|
117
|
-
* This endpoint is only available in API version 2026-01-01.nova and newer.
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* ```ts
|
|
121
|
-
* const attachedConversationTag =
|
|
122
|
-
* await client.support.conversations.tags.detach(
|
|
123
|
-
* '67ec1234abcd5678ef901234',
|
|
124
|
-
* {
|
|
125
|
-
* id: '12345',
|
|
126
|
-
* actingAdminId: '507f1f77bcf86cd799439011',
|
|
127
|
-
* },
|
|
128
|
-
* );
|
|
129
|
-
* ```
|
|
130
|
-
*/
|
|
131
|
-
detach(
|
|
132
|
-
tagID: string,
|
|
133
|
-
params: TagDetachParams,
|
|
134
|
-
options?: RequestOptions,
|
|
135
|
-
): APIPromise<AttachedConversationTag> {
|
|
136
|
-
const { id, 'Featurebase-Version': featurebaseVersion, ...body } = params;
|
|
137
|
-
return this._client.delete(path`/v2/conversations/${id}/tags/${tagID}`, {
|
|
138
|
-
body,
|
|
139
|
-
...options,
|
|
140
|
-
headers: buildHeaders([
|
|
141
|
-
{
|
|
142
|
-
...(featurebaseVersion?.toString() != null ?
|
|
143
|
-
{ 'Featurebase-Version': featurebaseVersion?.toString() }
|
|
144
|
-
: undefined),
|
|
145
|
-
},
|
|
146
|
-
options?.headers,
|
|
147
|
-
]),
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export interface AttachedConversationTag {
|
|
153
|
-
/**
|
|
154
|
-
* Unique tag identifier
|
|
155
|
-
*/
|
|
156
|
-
id: string;
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Current tag name
|
|
160
|
-
*/
|
|
161
|
-
name: string;
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Object type identifier for a tag
|
|
165
|
-
*/
|
|
166
|
-
type: 'tag';
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* ISO timestamp when the tag was applied
|
|
170
|
-
*/
|
|
171
|
-
appliedAt?: string | null;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Actor that applied the tag
|
|
175
|
-
*/
|
|
176
|
-
appliedBy?: ConversationTagMutationActor | null;
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* ISO timestamp when the tag was removed, if applicable
|
|
180
|
-
*/
|
|
181
|
-
removedAt?: string | null;
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Actor that applied the tag
|
|
185
|
-
*/
|
|
186
|
-
removedBy?: ConversationTagMutationActor | null;
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Reply/message ID used as the deterministic attachment target for this
|
|
190
|
-
* conversation tag mutation.
|
|
191
|
-
*/
|
|
192
|
-
targetPartId?: string | null;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Actor that applied the tag
|
|
197
|
-
*/
|
|
198
|
-
export interface ConversationTagMutationActor {
|
|
199
|
-
/**
|
|
200
|
-
* Actor that caused the tag mutation
|
|
201
|
-
*/
|
|
202
|
-
type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Actor identifier when available
|
|
206
|
-
*/
|
|
207
|
-
id?: string | null;
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Actor display name when available
|
|
211
|
-
*/
|
|
212
|
-
name?: string | null;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
export interface TagAttachParams {
|
|
216
|
-
/**
|
|
217
|
-
* Body param: Required admin ID performing this tag attachment. Must be a member
|
|
218
|
-
* of the organization so the mutation can be attributed to a real admin actor.
|
|
219
|
-
*/
|
|
220
|
-
actingAdminId: string;
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Body param: The Featurebase tag ID to attach to the conversation.
|
|
224
|
-
*/
|
|
225
|
-
tagId: string;
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Header param: API version for this request. Defaults to your organization's
|
|
229
|
-
* configured API version if not specified.
|
|
230
|
-
*/
|
|
231
|
-
'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export interface TagDetachParams {
|
|
235
|
-
/**
|
|
236
|
-
* Path param: Conversation ID (short ID)
|
|
237
|
-
*/
|
|
238
|
-
id: string;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Body param: Required admin ID performing this tag removal. Must be a member of
|
|
242
|
-
* the organization so the mutation can be attributed to a real admin actor.
|
|
243
|
-
*/
|
|
244
|
-
actingAdminId: string;
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Header param: API version for this request. Defaults to your organization's
|
|
248
|
-
* configured API version if not specified.
|
|
249
|
-
*/
|
|
250
|
-
'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
export declare namespace Tags {
|
|
254
|
-
export {
|
|
255
|
-
type AttachedConversationTag as AttachedConversationTag,
|
|
256
|
-
type ConversationTagMutationActor as ConversationTagMutationActor,
|
|
257
|
-
type TagAttachParams as TagAttachParams,
|
|
258
|
-
type TagDetachParams as TagDetachParams,
|
|
259
|
-
};
|
|
260
|
-
}
|