featurebase-node 0.15.2 → 0.15.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.
Files changed (127) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/client.d.mts +16 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +16 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +12 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +12 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/away-reasons.d.mts +37 -0
  12. package/resources/away-reasons.d.mts.map +1 -0
  13. package/resources/away-reasons.d.ts +37 -0
  14. package/resources/away-reasons.d.ts.map +1 -0
  15. package/resources/away-reasons.js +31 -0
  16. package/resources/away-reasons.js.map +1 -0
  17. package/resources/away-reasons.mjs +27 -0
  18. package/resources/away-reasons.mjs.map +1 -0
  19. package/resources/feedback/feedback.d.mts +2 -2
  20. package/resources/feedback/feedback.d.mts.map +1 -1
  21. package/resources/feedback/feedback.d.ts +2 -2
  22. package/resources/feedback/feedback.d.ts.map +1 -1
  23. package/resources/feedback/feedback.js.map +1 -1
  24. package/resources/feedback/feedback.mjs.map +1 -1
  25. package/resources/feedback/index.d.mts +1 -1
  26. package/resources/feedback/index.d.mts.map +1 -1
  27. package/resources/feedback/index.d.ts +1 -1
  28. package/resources/feedback/index.d.ts.map +1 -1
  29. package/resources/feedback/index.js.map +1 -1
  30. package/resources/feedback/index.mjs.map +1 -1
  31. package/resources/feedback/posts/index.d.mts +1 -1
  32. package/resources/feedback/posts/index.d.mts.map +1 -1
  33. package/resources/feedback/posts/index.d.ts +1 -1
  34. package/resources/feedback/posts/index.d.ts.map +1 -1
  35. package/resources/feedback/posts/index.js.map +1 -1
  36. package/resources/feedback/posts/index.mjs.map +1 -1
  37. package/resources/feedback/posts/posts.d.mts +123 -161
  38. package/resources/feedback/posts/posts.d.mts.map +1 -1
  39. package/resources/feedback/posts/posts.d.ts +123 -161
  40. package/resources/feedback/posts/posts.d.ts.map +1 -1
  41. package/resources/feedback/posts/posts.js.map +1 -1
  42. package/resources/feedback/posts/posts.mjs.map +1 -1
  43. package/resources/index.d.mts +4 -2
  44. package/resources/index.d.mts.map +1 -1
  45. package/resources/index.d.ts +4 -2
  46. package/resources/index.d.ts.map +1 -1
  47. package/resources/index.js +5 -1
  48. package/resources/index.js.map +1 -1
  49. package/resources/index.mjs +2 -0
  50. package/resources/index.mjs.map +1 -1
  51. package/resources/organization/admins.d.mts +151 -4
  52. package/resources/organization/admins.d.mts.map +1 -1
  53. package/resources/organization/admins.d.ts +151 -4
  54. package/resources/organization/admins.d.ts.map +1 -1
  55. package/resources/organization/admins.js +58 -3
  56. package/resources/organization/admins.js.map +1 -1
  57. package/resources/organization/admins.mjs +58 -3
  58. package/resources/organization/admins.mjs.map +1 -1
  59. package/resources/organization/index.d.mts +2 -2
  60. package/resources/organization/index.d.mts.map +1 -1
  61. package/resources/organization/index.d.ts +2 -2
  62. package/resources/organization/index.d.ts.map +1 -1
  63. package/resources/organization/index.js.map +1 -1
  64. package/resources/organization/index.mjs.map +1 -1
  65. package/resources/organization/organization.d.mts +4 -4
  66. package/resources/organization/organization.d.mts.map +1 -1
  67. package/resources/organization/organization.d.ts +4 -4
  68. package/resources/organization/organization.d.ts.map +1 -1
  69. package/resources/organization/organization.js.map +1 -1
  70. package/resources/organization/organization.mjs +1 -1
  71. package/resources/organization/organization.mjs.map +1 -1
  72. package/resources/organization/teams.d.mts +34 -4
  73. package/resources/organization/teams.d.mts.map +1 -1
  74. package/resources/organization/teams.d.ts +34 -4
  75. package/resources/organization/teams.d.ts.map +1 -1
  76. package/resources/organization/teams.js +18 -3
  77. package/resources/organization/teams.js.map +1 -1
  78. package/resources/organization/teams.mjs +18 -3
  79. package/resources/organization/teams.mjs.map +1 -1
  80. package/resources/reports.d.mts +45 -1
  81. package/resources/reports.d.mts.map +1 -1
  82. package/resources/reports.d.ts +45 -1
  83. package/resources/reports.d.ts.map +1 -1
  84. package/resources/reports.js +35 -0
  85. package/resources/reports.js.map +1 -1
  86. package/resources/reports.mjs +35 -0
  87. package/resources/reports.mjs.map +1 -1
  88. package/resources/training-data/index.d.mts +1 -1
  89. package/resources/training-data/index.d.mts.map +1 -1
  90. package/resources/training-data/index.d.ts +1 -1
  91. package/resources/training-data/index.d.ts.map +1 -1
  92. package/resources/training-data/index.js.map +1 -1
  93. package/resources/training-data/index.mjs.map +1 -1
  94. package/resources/training-data/training-data.d.mts +66 -161
  95. package/resources/training-data/training-data.d.mts.map +1 -1
  96. package/resources/training-data/training-data.d.ts +66 -161
  97. package/resources/training-data/training-data.d.ts.map +1 -1
  98. package/resources/training-data/training-data.js.map +1 -1
  99. package/resources/training-data/training-data.mjs.map +1 -1
  100. package/resources/workload.d.mts +103 -0
  101. package/resources/workload.d.mts.map +1 -0
  102. package/resources/workload.d.ts +103 -0
  103. package/resources/workload.d.ts.map +1 -0
  104. package/resources/workload.js +32 -0
  105. package/resources/workload.js.map +1 -0
  106. package/resources/workload.mjs +28 -0
  107. package/resources/workload.mjs.map +1 -0
  108. package/src/client.ts +34 -0
  109. package/src/resources/away-reasons.ts +68 -0
  110. package/src/resources/feedback/feedback.ts +4 -0
  111. package/src/resources/feedback/index.ts +2 -0
  112. package/src/resources/feedback/posts/index.ts +2 -0
  113. package/src/resources/feedback/posts/posts.ts +154 -204
  114. package/src/resources/index.ts +9 -0
  115. package/src/resources/organization/admins.ts +254 -3
  116. package/src/resources/organization/index.ts +8 -0
  117. package/src/resources/organization/organization.ts +23 -1
  118. package/src/resources/organization/teams.ts +69 -3
  119. package/src/resources/reports.ts +70 -0
  120. package/src/resources/training-data/index.ts +1 -0
  121. package/src/resources/training-data/training-data.ts +77 -193
  122. package/src/resources/workload.ts +179 -0
  123. package/src/version.ts +1 -1
  124. package/version.d.mts +1 -1
  125. package/version.d.ts +1 -1
  126. package/version.js +1 -1
  127. package/version.mjs +1 -1
@@ -1,6 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
+ import * as TrainingDataAPI from './training-data';
4
5
  import * as FilesAPI from './files';
5
6
  import {
6
7
  FileCreateParams,
@@ -119,13 +120,77 @@ export class TrainingData extends APIResource {
119
120
  }
120
121
  }
121
122
 
123
+ export interface KnowledgeMatchCandidate {
124
+ /**
125
+ * ID of the existing item
126
+ */
127
+ id: string;
128
+
129
+ /**
130
+ * The item's source identity, for training files and Q&A
131
+ */
132
+ externalId: string | null;
133
+
134
+ /**
135
+ * What kind of knowledge item matched: a Q&A entry, a training file / crawled
136
+ * page, or a live help-center article.
137
+ */
138
+ kind: 'qna' | 'training_file' | 'help_center_article';
139
+
140
+ /**
141
+ * Question variants, for Q&A entries
142
+ */
143
+ questions: Array<string> | null;
144
+
145
+ /**
146
+ * Q&A revision compared by the judge; null for other kinds. Use with PATCH
147
+ * expectedRevision.
148
+ */
149
+ revision: number | null;
150
+
151
+ /**
152
+ * Heading breadcrumb of the matching section, for training files
153
+ */
154
+ section: string | null;
155
+
156
+ /**
157
+ * Cosine similarity between the query and item. Calibrate any threshold using
158
+ * representative examples; it is not a correctness or contradiction score. `null`
159
+ * when the item was found by keywords only. Arrays are already ordered closest
160
+ * first.
161
+ */
162
+ similarity: number | null;
163
+
164
+ /**
165
+ * The item's `source` label, for Q&A entries and training files
166
+ */
167
+ source: string | null;
168
+
169
+ /**
170
+ * Excerpt of the existing content the judge compared against (Q&A answer, matching
171
+ * document section, or article body), up to 1200 characters plus an ellipsis when
172
+ * cut.
173
+ */
174
+ text: string;
175
+
176
+ /**
177
+ * Title of the existing item
178
+ */
179
+ title: string;
180
+
181
+ /**
182
+ * Public URL of the item when it has one
183
+ */
184
+ url: string | null;
185
+ }
186
+
122
187
  export interface KnowledgeSearch {
123
188
  /**
124
189
  * Existing items closest to the query, best first, at most `topK`. `text` is an
125
190
  * excerpt focused on the query; `section` is the heading path inside a file when
126
191
  * known.
127
192
  */
128
- candidates: Array<KnowledgeSearch.Candidate>;
193
+ candidates: Array<KnowledgeMatchCandidate>;
129
194
 
130
195
  /**
131
196
  * Object type identifier
@@ -144,70 +209,6 @@ export interface KnowledgeSearch {
144
209
  }
145
210
 
146
211
  export namespace KnowledgeSearch {
147
- export interface Candidate {
148
- /**
149
- * ID of the existing item
150
- */
151
- id: string;
152
-
153
- /**
154
- * The item's source identity, for training files and Q&A
155
- */
156
- externalId: string | null;
157
-
158
- /**
159
- * What kind of knowledge item matched: a Q&A entry, a training file / crawled
160
- * page, or a live help-center article.
161
- */
162
- kind: 'qna' | 'training_file' | 'help_center_article';
163
-
164
- /**
165
- * Question variants, for Q&A entries
166
- */
167
- questions: Array<string> | null;
168
-
169
- /**
170
- * Q&A revision compared by the judge; null for other kinds. Use with PATCH
171
- * expectedRevision.
172
- */
173
- revision: number | null;
174
-
175
- /**
176
- * Heading breadcrumb of the matching section, for training files
177
- */
178
- section: string | null;
179
-
180
- /**
181
- * Cosine similarity between the query and item. Calibrate any threshold using
182
- * representative examples; it is not a correctness or contradiction score. `null`
183
- * when the item was found by keywords only. Arrays are already ordered closest
184
- * first.
185
- */
186
- similarity: number | null;
187
-
188
- /**
189
- * The item's `source` label, for Q&A entries and training files
190
- */
191
- source: string | null;
192
-
193
- /**
194
- * Excerpt of the existing content the judge compared against (Q&A answer, matching
195
- * document section, or article body), up to 1200 characters plus an ellipsis when
196
- * cut.
197
- */
198
- text: string;
199
-
200
- /**
201
- * Title of the existing item
202
- */
203
- title: string;
204
-
205
- /**
206
- * Public URL of the item when it has one
207
- */
208
- url: string | null;
209
- }
210
-
211
212
  /**
212
213
  * Where the time went
213
214
  */
@@ -246,7 +247,7 @@ export interface Oracle {
246
247
  * Retrieved items and the addressed entry (first when present), at most 10.
247
248
  * Excerpts are partial evidence.
248
249
  */
249
- candidates: Array<Oracle.Candidate>;
250
+ candidates: Array<KnowledgeMatchCandidate>;
250
251
 
251
252
  /**
252
253
  * A candidate or text budget limited verification (including clipped proposed
@@ -279,6 +280,10 @@ export interface Oracle {
279
280
  */
280
281
  reason: string;
281
282
 
283
+ /**
284
+ * The existing item the action refers to, with its excerpt; `null` for `create` /
285
+ * `update_target`. For a `different` verdict the closest miss is `candidates[0]`.
286
+ */
282
287
  target: Oracle.Target;
283
288
 
284
289
  /**
@@ -297,70 +302,6 @@ export interface Oracle {
297
302
  }
298
303
 
299
304
  export namespace Oracle {
300
- export interface Candidate {
301
- /**
302
- * ID of the existing item
303
- */
304
- id: string;
305
-
306
- /**
307
- * The item's source identity, for training files and Q&A
308
- */
309
- externalId: string | null;
310
-
311
- /**
312
- * What kind of knowledge item matched: a Q&A entry, a training file / crawled
313
- * page, or a live help-center article.
314
- */
315
- kind: 'qna' | 'training_file' | 'help_center_article';
316
-
317
- /**
318
- * Question variants, for Q&A entries
319
- */
320
- questions: Array<string> | null;
321
-
322
- /**
323
- * Q&A revision compared by the judge; null for other kinds. Use with PATCH
324
- * expectedRevision.
325
- */
326
- revision: number | null;
327
-
328
- /**
329
- * Heading breadcrumb of the matching section, for training files
330
- */
331
- section: string | null;
332
-
333
- /**
334
- * Cosine similarity between the query and item. Calibrate any threshold using
335
- * representative examples; it is not a correctness or contradiction score. `null`
336
- * when the item was found by keywords only. Arrays are already ordered closest
337
- * first.
338
- */
339
- similarity: number | null;
340
-
341
- /**
342
- * The item's `source` label, for Q&A entries and training files
343
- */
344
- source: string | null;
345
-
346
- /**
347
- * Excerpt of the existing content the judge compared against (Q&A answer, matching
348
- * document section, or article body), up to 1200 characters plus an ellipsis when
349
- * cut.
350
- */
351
- text: string;
352
-
353
- /**
354
- * Title of the existing item
355
- */
356
- title: string;
357
-
358
- /**
359
- * Public URL of the item when it has one
360
- */
361
- url: string | null;
362
- }
363
-
364
305
  /**
365
306
  * The Q&A entry addressed by externalId or a normalized question, including its
366
307
  * checked revision, or null
@@ -406,69 +347,11 @@ export namespace Oracle {
406
347
  verdict: 'same_topic' | 'contradicts' | 'different' | 'unclear';
407
348
  }
408
349
 
409
- export interface Target {
410
- /**
411
- * ID of the existing item
412
- */
413
- id: string;
414
-
415
- /**
416
- * The item's source identity, for training files and Q&A
417
- */
418
- externalId: string | null;
419
-
420
- /**
421
- * What kind of knowledge item matched: a Q&A entry, a training file / crawled
422
- * page, or a live help-center article.
423
- */
424
- kind: 'qna' | 'training_file' | 'help_center_article';
425
-
426
- /**
427
- * Question variants, for Q&A entries
428
- */
429
- questions: Array<string> | null;
430
-
431
- /**
432
- * Q&A revision compared by the judge; null for other kinds. Use with PATCH
433
- * expectedRevision.
434
- */
435
- revision: number | null;
436
-
437
- /**
438
- * Heading breadcrumb of the matching section, for training files
439
- */
440
- section: string | null;
441
-
442
- /**
443
- * Cosine similarity between the query and item. Calibrate any threshold using
444
- * representative examples; it is not a correctness or contradiction score. `null`
445
- * when the item was found by keywords only. Arrays are already ordered closest
446
- * first.
447
- */
448
- similarity: number | null;
449
-
450
- /**
451
- * The item's `source` label, for Q&A entries and training files
452
- */
453
- source: string | null;
454
-
455
- /**
456
- * Excerpt of the existing content the judge compared against (Q&A answer, matching
457
- * document section, or article body), up to 1200 characters plus an ellipsis when
458
- * cut.
459
- */
460
- text: string;
461
-
462
- /**
463
- * Title of the existing item
464
- */
465
- title: string;
466
-
467
- /**
468
- * Public URL of the item when it has one
469
- */
470
- url: string | null;
471
- }
350
+ /**
351
+ * The existing item the action refers to, with its excerpt; `null` for `create` /
352
+ * `update_target`. For a `different` verdict the closest miss is `candidates[0]`.
353
+ */
354
+ export interface Target extends TrainingDataAPI.KnowledgeMatchCandidate {}
472
355
 
473
356
  /**
474
357
  * Where the time went
@@ -571,6 +454,7 @@ TrainingData.QnaResource = QnaResource;
571
454
 
572
455
  export declare namespace TrainingData {
573
456
  export {
457
+ type KnowledgeMatchCandidate as KnowledgeMatchCandidate,
574
458
  type KnowledgeSearch as KnowledgeSearch,
575
459
  type Oracle as Oracle,
576
460
  type TrainingDataOracleParams as TrainingDataOracleParams,
@@ -0,0 +1,179 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as AdminsAPI from './organization/admins';
5
+ import { APIPromise } from '../core/api-promise';
6
+ import { buildHeaders } from '../internal/headers';
7
+ import { RequestOptions } from '../internal/request-options';
8
+
9
+ /**
10
+ * Live conversation workload, teammate availability, capacity limits, and managed away reasons for large support teams.
11
+ */
12
+ export class Workload extends APIResource {
13
+ /**
14
+ * Returns live workspace, team, and admin workload. Admin rows use cursor
15
+ * pagination. teamId and adminId filter admin and team rows. The summary stays
16
+ * workspace-wide. The snapshot is cached for five seconds.
17
+ */
18
+ list(
19
+ params: WorkloadListParams | null | undefined = {},
20
+ options?: RequestOptions,
21
+ ): APIPromise<WorkloadListResponse> {
22
+ const { 'Featurebase-Version': featurebaseVersion } = params ?? {};
23
+ return this._client.get('/v2/workload', {
24
+ ...options,
25
+ headers: buildHeaders([
26
+ {
27
+ ...(featurebaseVersion?.toString() != null ?
28
+ { 'Featurebase-Version': featurebaseVersion?.toString() }
29
+ : undefined),
30
+ },
31
+ options?.headers,
32
+ ]),
33
+ });
34
+ }
35
+ }
36
+
37
+ export interface WorkloadListResponse {
38
+ admins: WorkloadListResponse.Admins;
39
+
40
+ generatedAt: string;
41
+
42
+ object: 'workload';
43
+
44
+ summary: WorkloadListResponse.Summary;
45
+
46
+ teams: Array<WorkloadListResponse.Team>;
47
+ }
48
+
49
+ export namespace WorkloadListResponse {
50
+ export interface Admins {
51
+ data: Array<Admins.Data>;
52
+
53
+ nextCursor: string | null;
54
+
55
+ object: 'list';
56
+ }
57
+
58
+ export namespace Admins {
59
+ export interface Data {
60
+ adminId: string;
61
+
62
+ assignmentLimit: AdminsAPI.AssignmentLimit;
63
+
64
+ atCapacity: boolean;
65
+
66
+ availability: AdminsAPI.AdminAvailability;
67
+
68
+ idleCount: number;
69
+
70
+ inboxes: Array<Data.Inbox>;
71
+
72
+ object: 'workload_admin';
73
+
74
+ openCount: number;
75
+
76
+ snoozedCount: number;
77
+
78
+ waitingCount: number;
79
+ }
80
+
81
+ export namespace Data {
82
+ export interface Inbox {
83
+ assignmentLimit: number | null;
84
+
85
+ atCapacity: boolean;
86
+
87
+ idleCount: number;
88
+
89
+ openCount: number;
90
+
91
+ snoozedCount: number;
92
+
93
+ teamId: string;
94
+
95
+ waitingCount: number;
96
+ }
97
+ }
98
+ }
99
+
100
+ export interface Summary {
101
+ avgWaitMs: number | null;
102
+
103
+ awayReasonBreakdown: Array<Summary.AwayReasonBreakdown>;
104
+
105
+ closedToday: number;
106
+
107
+ idleConversations: number;
108
+
109
+ idleThresholdMinutes: number;
110
+
111
+ longestWaitingMs: number | null;
112
+
113
+ openConversations: number;
114
+
115
+ snoozedConversations: number;
116
+
117
+ unassignedConversations: number;
118
+
119
+ waitingConversations: number;
120
+
121
+ waitingFirstReplyConversations: number;
122
+ }
123
+
124
+ export namespace Summary {
125
+ export interface AwayReasonBreakdown {
126
+ count: number;
127
+
128
+ reason: string;
129
+ }
130
+ }
131
+
132
+ export interface Team {
133
+ assignedCount: number;
134
+
135
+ assignmentLimit: number | null;
136
+
137
+ atCapacityCount: number;
138
+
139
+ avgWaitMs: number | null;
140
+
141
+ awayCount: number;
142
+
143
+ closedToday: number;
144
+
145
+ idleCount: number;
146
+
147
+ longestWaitingMs: number | null;
148
+
149
+ memberCount: number;
150
+
151
+ name: string;
152
+
153
+ object: 'workload_team';
154
+
155
+ openCount: number;
156
+
157
+ queuedCount: number;
158
+
159
+ snoozedCount: number;
160
+
161
+ teamId: string;
162
+
163
+ waitingCount: number;
164
+
165
+ waitingFirstReplyCount: number;
166
+ }
167
+ }
168
+
169
+ export interface WorkloadListParams {
170
+ /**
171
+ * API version for this request. Defaults to your organization's configured API
172
+ * version if not specified.
173
+ */
174
+ 'Featurebase-Version'?: '2026-08-19.orbit' | '2026-01-01.nova' | '2025-12-12.clover';
175
+ }
176
+
177
+ export declare namespace Workload {
178
+ export { type WorkloadListResponse as WorkloadListResponse, type WorkloadListParams as WorkloadListParams };
179
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.15.2'; // x-release-please-version
1
+ export const VERSION = '0.15.3'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.15.2";
1
+ export declare const VERSION = "0.15.3";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.15.2";
1
+ export declare const VERSION = "0.15.3";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.15.2'; // x-release-please-version
4
+ exports.VERSION = '0.15.3'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.15.2'; // x-release-please-version
1
+ export const VERSION = '0.15.3'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map