featurebase-node 0.8.0 → 0.9.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/client.d.mts +3 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/core/pagination.d.mts +15 -0
  9. package/core/pagination.d.mts.map +1 -1
  10. package/core/pagination.d.ts +15 -0
  11. package/core/pagination.d.ts.map +1 -1
  12. package/core/pagination.js +25 -1
  13. package/core/pagination.js.map +1 -1
  14. package/core/pagination.mjs +23 -0
  15. package/core/pagination.mjs.map +1 -1
  16. package/package.json +1 -1
  17. package/resources/support/conversations/conversations.d.mts +810 -8
  18. package/resources/support/conversations/conversations.d.mts.map +1 -1
  19. package/resources/support/conversations/conversations.d.ts +810 -8
  20. package/resources/support/conversations/conversations.d.ts.map +1 -1
  21. package/resources/support/conversations/conversations.js +240 -4
  22. package/resources/support/conversations/conversations.js.map +1 -1
  23. package/resources/support/conversations/conversations.mjs +240 -4
  24. package/resources/support/conversations/conversations.mjs.map +1 -1
  25. package/resources/support/conversations/index.d.mts +1 -2
  26. package/resources/support/conversations/index.d.mts.map +1 -1
  27. package/resources/support/conversations/index.d.ts +1 -2
  28. package/resources/support/conversations/index.d.ts.map +1 -1
  29. package/resources/support/conversations/index.js +1 -3
  30. package/resources/support/conversations/index.js.map +1 -1
  31. package/resources/support/conversations/index.mjs +0 -1
  32. package/resources/support/conversations/index.mjs.map +1 -1
  33. package/resources/support/index.d.mts +1 -1
  34. package/resources/support/index.d.mts.map +1 -1
  35. package/resources/support/index.d.ts +1 -1
  36. package/resources/support/index.d.ts.map +1 -1
  37. package/resources/support/index.js.map +1 -1
  38. package/resources/support/index.mjs.map +1 -1
  39. package/resources/support/support.d.mts +2 -2
  40. package/resources/support/support.d.mts.map +1 -1
  41. package/resources/support/support.d.ts +2 -2
  42. package/resources/support/support.d.ts.map +1 -1
  43. package/resources/support/support.js.map +1 -1
  44. package/resources/support/support.mjs.map +1 -1
  45. package/src/client.ts +13 -1
  46. package/src/core/pagination.ts +49 -0
  47. package/src/resources/support/conversations/conversations.ts +1059 -86
  48. package/src/resources/support/conversations/index.ts +6 -7
  49. package/src/resources/support/index.ts +6 -0
  50. package/src/resources/support/support.ts +12 -0
  51. package/src/version.ts +1 -1
  52. package/version.d.mts +1 -1
  53. package/version.d.ts +1 -1
  54. package/version.js +1 -1
  55. package/version.mjs +1 -1
  56. package/resources/support/conversations/tags.d.mts +0 -200
  57. package/resources/support/conversations/tags.d.mts.map +0 -1
  58. package/resources/support/conversations/tags.d.ts +0 -200
  59. package/resources/support/conversations/tags.d.ts.map +0 -1
  60. package/resources/support/conversations/tags.js +0 -146
  61. package/resources/support/conversations/tags.js.map +0 -1
  62. package/resources/support/conversations/tags.mjs +0 -142
  63. package/resources/support/conversations/tags.mjs.map +0 -1
  64. package/src/resources/support/conversations/tags.ts +0 -260
@@ -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
- }