@stackfactor/client-api 1.19.0 → 1.20.1

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 (87) hide show
  1. package/dist/cjs/lib/constants.d.ts +2 -1
  2. package/dist/cjs/lib/constants.d.ts.map +1 -1
  3. package/dist/cjs/lib/constants.js +3 -1
  4. package/dist/cjs/lib/constants.js.map +1 -1
  5. package/dist/cjs/lib/knowledgeAssessmentAttempts.d.ts +22 -0
  6. package/dist/cjs/lib/knowledgeAssessmentAttempts.d.ts.map +1 -1
  7. package/dist/cjs/lib/knowledgeAssessmentAttempts.js +44 -1
  8. package/dist/cjs/lib/knowledgeAssessmentAttempts.js.map +1 -1
  9. package/dist/cjs/lib/knowledgeBase/documents.d.ts +127 -0
  10. package/dist/cjs/lib/knowledgeBase/documents.d.ts.map +1 -0
  11. package/dist/cjs/lib/knowledgeBase/documents.js +114 -0
  12. package/dist/cjs/lib/knowledgeBase/documents.js.map +1 -0
  13. package/dist/cjs/lib/knowledgeBase/knowledgeBases.d.ts +118 -0
  14. package/dist/cjs/lib/knowledgeBase/knowledgeBases.d.ts.map +1 -0
  15. package/dist/cjs/lib/knowledgeBase/knowledgeBases.js +256 -0
  16. package/dist/cjs/lib/knowledgeBase/knowledgeBases.js.map +1 -0
  17. package/dist/cjs/lib/knowledgeBase/review.d.ts +184 -0
  18. package/dist/cjs/lib/knowledgeBase/review.d.ts.map +1 -0
  19. package/dist/cjs/lib/knowledgeBase/review.js +413 -0
  20. package/dist/cjs/lib/knowledgeBase/review.js.map +1 -0
  21. package/dist/cjs/lib/knowledgeBase/skills.d.ts +247 -0
  22. package/dist/cjs/lib/knowledgeBase/skills.d.ts.map +1 -0
  23. package/dist/cjs/lib/knowledgeBase/skills.js +199 -0
  24. package/dist/cjs/lib/knowledgeBase/skills.js.map +1 -0
  25. package/dist/cjs/lib/knowledgeBase/sources.d.ts +136 -0
  26. package/dist/cjs/lib/knowledgeBase/sources.d.ts.map +1 -0
  27. package/dist/cjs/lib/knowledgeBase/sources.js +234 -0
  28. package/dist/cjs/lib/knowledgeBase/sources.js.map +1 -0
  29. package/dist/cjs/lib/knowledgeBase.d.ts +5 -642
  30. package/dist/cjs/lib/knowledgeBase.d.ts.map +1 -1
  31. package/dist/cjs/lib/knowledgeBase.js +32 -1111
  32. package/dist/cjs/lib/knowledgeBase.js.map +1 -1
  33. package/dist/cjs/lib/knowledgeBaseAgent.d.ts +33 -1
  34. package/dist/cjs/lib/knowledgeBaseAgent.d.ts.map +1 -1
  35. package/dist/cjs/lib/knowledgeBaseAgent.js +18 -3
  36. package/dist/cjs/lib/knowledgeBaseAgent.js.map +1 -1
  37. package/dist/cjs/lib/learningContent.d.ts.map +1 -1
  38. package/dist/cjs/lib/learningContent.js +12 -2
  39. package/dist/cjs/lib/learningContent.js.map +1 -1
  40. package/dist/cjs/lib/learningContentCohorts.d.ts +80 -0
  41. package/dist/cjs/lib/learningContentCohorts.d.ts.map +1 -1
  42. package/dist/cjs/lib/learningContentCohorts.js +80 -1
  43. package/dist/cjs/lib/learningContentCohorts.js.map +1 -1
  44. package/dist/esm/lib/constants.d.ts +2 -1
  45. package/dist/esm/lib/constants.d.ts.map +1 -1
  46. package/dist/esm/lib/constants.js +3 -1
  47. package/dist/esm/lib/constants.js.map +1 -1
  48. package/dist/esm/lib/knowledgeAssessmentAttempts.d.ts +22 -0
  49. package/dist/esm/lib/knowledgeAssessmentAttempts.d.ts.map +1 -1
  50. package/dist/esm/lib/knowledgeAssessmentAttempts.js +40 -0
  51. package/dist/esm/lib/knowledgeAssessmentAttempts.js.map +1 -1
  52. package/dist/esm/lib/knowledgeBase/documents.d.ts +127 -0
  53. package/dist/esm/lib/knowledgeBase/documents.d.ts.map +1 -0
  54. package/dist/esm/lib/knowledgeBase/documents.js +107 -0
  55. package/dist/esm/lib/knowledgeBase/documents.js.map +1 -0
  56. package/dist/esm/lib/knowledgeBase/knowledgeBases.d.ts +118 -0
  57. package/dist/esm/lib/knowledgeBase/knowledgeBases.d.ts.map +1 -0
  58. package/dist/esm/lib/knowledgeBase/knowledgeBases.js +242 -0
  59. package/dist/esm/lib/knowledgeBase/knowledgeBases.js.map +1 -0
  60. package/dist/esm/lib/knowledgeBase/review.d.ts +184 -0
  61. package/dist/esm/lib/knowledgeBase/review.d.ts.map +1 -0
  62. package/dist/esm/lib/knowledgeBase/review.js +392 -0
  63. package/dist/esm/lib/knowledgeBase/review.js.map +1 -0
  64. package/dist/esm/lib/knowledgeBase/skills.d.ts +247 -0
  65. package/dist/esm/lib/knowledgeBase/skills.d.ts.map +1 -0
  66. package/dist/esm/lib/knowledgeBase/skills.js +189 -0
  67. package/dist/esm/lib/knowledgeBase/skills.js.map +1 -0
  68. package/dist/esm/lib/knowledgeBase/sources.d.ts +136 -0
  69. package/dist/esm/lib/knowledgeBase/sources.d.ts.map +1 -0
  70. package/dist/esm/lib/knowledgeBase/sources.js +221 -0
  71. package/dist/esm/lib/knowledgeBase/sources.js.map +1 -0
  72. package/dist/esm/lib/knowledgeBase.d.ts +5 -642
  73. package/dist/esm/lib/knowledgeBase.d.ts.map +1 -1
  74. package/dist/esm/lib/knowledgeBase.js +18 -1062
  75. package/dist/esm/lib/knowledgeBase.js.map +1 -1
  76. package/dist/esm/lib/knowledgeBaseAgent.d.ts +33 -1
  77. package/dist/esm/lib/knowledgeBaseAgent.d.ts.map +1 -1
  78. package/dist/esm/lib/knowledgeBaseAgent.js +16 -2
  79. package/dist/esm/lib/knowledgeBaseAgent.js.map +1 -1
  80. package/dist/esm/lib/learningContent.d.ts.map +1 -1
  81. package/dist/esm/lib/learningContent.js +12 -2
  82. package/dist/esm/lib/learningContent.js.map +1 -1
  83. package/dist/esm/lib/learningContentCohorts.d.ts +80 -0
  84. package/dist/esm/lib/learningContentCohorts.d.ts.map +1 -1
  85. package/dist/esm/lib/learningContentCohorts.js +66 -0
  86. package/dist/esm/lib/learningContentCohorts.js.map +1 -1
  87. package/package.json +1 -3
@@ -1,1116 +1,37 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveSourceMappings = exports.updateSourceMapping = exports.listSourceMappings = exports.dismissAllArtifacts = exports.dismissArtifact = exports.retireArtifact = exports.regenerateArtifact = exports.decideContradiction = exports.listContradictions = exports.regenerateGenerated = exports.rejectGenerated = exports.editApproveGenerated = exports.approveGenerated = exports.listGeneratedReview = exports.deleteQuarantine = exports.reingestQuarantine = exports.decideQuarantine = exports.releaseQuarantine = exports.listReleased = exports.listQuarantine = exports.getReviewOverview = exports.rightToBeForgotten = exports.updateComplianceProfile = exports.getComplianceProfile = exports.updateRedactionPolicy = exports.getRedactionPolicy = exports.revokeAccess = exports.grantAccess = exports.listAccess = exports.deleteDocument = exports.listMicroSkills = exports.getSkillCoverage = exports.setSkillMappings = exports.listSkills = exports.getDocument = exports.listDocuments = exports.testSource = exports.reprocessSource = exports.syncSource = exports.deleteSource = exports.updateSource = exports.addSource = exports.listSourceConnectors = exports.deleteKnowledgeBase = exports.updateKnowledgeBase = exports.getKnowledgeBase = exports.createKnowledgeBase = exports.listKnowledgeBases = void 0;
4
- const axiosClient_js_1 = require("./axiosClient.js");
5
- // ── Knowledge Base CRUD ───────────────────────────────────────────────────────
6
- /**
7
- * List the knowledge bases the caller can see.
8
- * GET /api/v1/knowledge-base
9
- * @param {String} authToken Authentication token
10
- * @returns {Promise<object>}
11
- */
12
- const listKnowledgeBases = (authToken) => {
13
- return new Promise((resolve, reject) => {
14
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base`, {
15
- headers: { authorization: authToken },
16
- });
17
- request
18
- .then((response) => {
19
- resolve(response.data);
20
- })
21
- .catch((error) => {
22
- reject(error);
23
- });
24
- });
25
- };
26
- exports.listKnowledgeBases = listKnowledgeBases;
27
- /**
28
- * Create a knowledge base (the creator becomes owner automatically). Requires the
29
- * global CREATE_KNOWLEDGE_BASE capability.
30
- * POST /api/v1/knowledge-base
31
- * @param {KnowledgeBaseInput} data KB metadata (at minimum `name`)
32
- * @param {String} authToken Authentication token
33
- * @returns {Promise<object>}
34
- */
35
- const createKnowledgeBase = (data, authToken) => {
36
- return new Promise((resolve, reject) => {
37
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base`, data, {
38
- headers: { authorization: authToken },
39
- });
40
- request
41
- .then((response) => {
42
- resolve(response.data);
43
- })
44
- .catch((error) => {
45
- reject(error);
46
- });
47
- });
48
- };
49
- exports.createKnowledgeBase = createKnowledgeBase;
50
- /**
51
- * Get a single knowledge base (plus stats).
52
- * GET /api/v1/knowledge-base/:id
53
- * @param {String} id The knowledge base id
54
- * @param {String} authToken Authentication token
55
- * @returns {Promise<object>}
56
- */
57
- const getKnowledgeBase = (id, authToken) => {
58
- return new Promise((resolve, reject) => {
59
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base/${id}`, {
60
- headers: { authorization: authToken },
61
- });
62
- request
63
- .then((response) => {
64
- resolve(response.data);
65
- })
66
- .catch((error) => {
67
- reject(error);
68
- });
69
- });
70
- };
71
- exports.getKnowledgeBase = getKnowledgeBase;
72
- /**
73
- * Update a knowledge base's metadata. Owner or editor only. Does not touch
74
- * `access[]`, `sources`, or `createdBy` — those have their own gated flows.
75
- * PUT /api/v1/knowledge-base/:id
76
- * @param {String} id The knowledge base id
77
- * @param {KnowledgeBaseInput} data The fields to update
78
- * @param {String} authToken Authentication token
79
- * @returns {Promise<object>}
80
- */
81
- const updateKnowledgeBase = (id, data, authToken) => {
82
- return new Promise((resolve, reject) => {
83
- const request = axiosClient_js_1.client.put(`/api/v1/knowledge-base/${id}`, data, {
84
- headers: { authorization: authToken },
85
- });
86
- request
87
- .then((response) => {
88
- resolve(response.data);
89
- })
90
- .catch((error) => {
91
- reject(error);
92
- });
93
- });
94
- };
95
- exports.updateKnowledgeBase = updateKnowledgeBase;
96
- /**
97
- * Delete a knowledge base (cascades to its chunks). Owner only.
98
- * DELETE /api/v1/knowledge-base/:id
99
- * @param {String} id The knowledge base id
100
- * @param {String} authToken Authentication token
101
- * @returns {Promise<object>}
102
- */
103
- const deleteKnowledgeBase = (id, authToken) => {
104
- return new Promise((resolve, reject) => {
105
- const request = axiosClient_js_1.client.delete(`/api/v1/knowledge-base/${id}`, {
106
- headers: { authorization: authToken },
107
- });
108
- request
109
- .then((response) => {
110
- resolve(response.data);
111
- })
112
- .catch((error) => {
113
- reject(error);
114
- });
115
- });
116
- };
117
- exports.deleteKnowledgeBase = deleteKnowledgeBase;
118
- // ── Source Management ─────────────────────────────────────────────────────────
119
- /**
120
- * List the available KB_SOURCE_CONNECTOR integrations (enabled integrations +
121
- * capability manifests for the source-creation form).
122
- * GET /api/v1/knowledge-base/source-connectors
123
- * @param {String} authToken Authentication token
124
- * @returns {Promise<object>}
125
- */
126
- const listSourceConnectors = (authToken) => {
127
- return new Promise((resolve, reject) => {
128
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base/source-connectors`, {
129
- headers: { authorization: authToken },
130
- });
131
- request
132
- .then((response) => {
133
- resolve(response.data);
134
- })
135
- .catch((error) => {
136
- reject(error);
137
- });
138
- });
139
- };
140
- exports.listSourceConnectors = listSourceConnectors;
141
2
  //
142
- // Between `listSourceConnectors` and `addSource` sit three calls that act on the
143
- // CONNECTOR itself rather than on a knowledge base — asking it what it accepts,
144
- // how the user signs in, and how much data is behind the resulting credentials.
145
- // Those live in the `knowledgeBaseSourceConnectors` module (they take a
146
- // connection id, not a KB id, and are mounted under
147
- // /api/v1/exceed/knowledgebasesourceconnectors).
3
+ // Knowledge Base management operations.
148
4
  //
149
- /**
150
- * Add a source to a knowledge base (`integrationId` + credentials +
151
- * `syncFrequencyDays`, default 7). Publishes a kb-source-event (changeType="add").
152
- * POST /api/v1/knowledge-base/:id/sources
153
- * @param {String} id The knowledge base id
154
- * @param {object} source The source configuration
155
- * @param {String} authToken Authentication token
156
- * @returns {Promise<object>}
157
- */
158
- const addSource = (id, source, authToken) => {
159
- return new Promise((resolve, reject) => {
160
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base/${id}/sources`, source, { headers: { authorization: authToken } });
161
- request
162
- .then((response) => {
163
- resolve(response.data);
164
- })
165
- .catch((error) => {
166
- reject(error);
167
- });
168
- });
169
- };
170
- exports.addSource = addSource;
171
- /**
172
- * Update a knowledge base source. Publishes a kb-source-event per changed source.
173
- * PUT /api/v1/knowledge-base/:id/sources/:sourceId
174
- * @param {String} id The knowledge base id
175
- * @param {String} sourceId The source id
176
- * @param {object} source The updated source configuration
177
- * @param {String} authToken Authentication token
178
- * @returns {Promise<object>}
179
- */
180
- const updateSource = (id, sourceId, source, authToken) => {
181
- return new Promise((resolve, reject) => {
182
- const request = axiosClient_js_1.client.put(`/api/v1/knowledge-base/${id}/sources/${sourceId}`, source, { headers: { authorization: authToken } });
183
- request
184
- .then((response) => {
185
- resolve(response.data);
186
- })
187
- .catch((error) => {
188
- reject(error);
189
- });
190
- });
191
- };
192
- exports.updateSource = updateSource;
193
- /**
194
- * Remove a source from a knowledge base. Publishes a kb-source-event
195
- * (changeType="delete").
196
- * DELETE /api/v1/knowledge-base/:id/sources/:sourceId
197
- * @param {String} id The knowledge base id
198
- * @param {String} sourceId The source id
199
- * @param {String} authToken Authentication token
200
- * @returns {Promise<object>}
201
- */
202
- const deleteSource = (id, sourceId, authToken) => {
203
- return new Promise((resolve, reject) => {
204
- const request = axiosClient_js_1.client.delete(`/api/v1/knowledge-base/${id}/sources/${sourceId}`, { headers: { authorization: authToken } });
205
- request
206
- .then((response) => {
207
- resolve(response.data);
208
- })
209
- .catch((error) => {
210
- reject(error);
211
- });
212
- });
213
- };
214
- exports.deleteSource = deleteSource;
215
- /**
216
- * Trigger a manual re-sync of a source. Publishes a kb-source-event
217
- * (changeType="update", trigger="manual_sync").
218
- * POST /api/v1/knowledge-base/:id/sources/:sourceId/sync
219
- * @param {String} id The knowledge base id
220
- * @param {String} sourceId The source id
221
- * @param {String} authToken Authentication token
222
- * @returns {Promise<object>}
223
- */
224
- const syncSource = (id, sourceId, authToken) => {
225
- return new Promise((resolve, reject) => {
226
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base/${id}/sources/${sourceId}/sync`, {}, { headers: { authorization: authToken } });
227
- request
228
- .then((response) => {
229
- resolve(response.data);
230
- })
231
- .catch((error) => {
232
- reject(error);
233
- });
234
- });
235
- };
236
- exports.syncSource = syncSource;
237
- /**
238
- * Process every processed document of a source again — classification, labels,
239
- * chunks and embeddings redone — on a run of the source. Quarantined and blocked
240
- * documents are left as they are. A run starts now, or a follow-up run is owed
241
- * while one is outstanding (trigger="reprocess").
242
- * POST /api/v1/knowledge-base/:id/sources/:sourceId/reprocess
243
- * @param {String} id The knowledge base id
244
- * @param {String} sourceId The source id
245
- * @param {String} authToken Authentication token
246
- * @returns {Promise<object>} { ok, documents, correlationId, started }: how many
247
- * documents were marked, the run, and whether it started now
248
- */
249
- const reprocessSource = (id, sourceId, authToken) => {
250
- return new Promise((resolve, reject) => {
251
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base/${id}/sources/${sourceId}/reprocess`, {}, { headers: { authorization: authToken } });
252
- request
253
- .then((response) => {
254
- resolve(response.data);
255
- })
256
- .catch((error) => {
257
- reject(error);
258
- });
259
- });
260
- };
261
- exports.reprocessSource = reprocessSource;
262
- /**
263
- * Test a source's connector credentials (dispatches TEST_CONNECTION).
264
- * POST /api/v1/knowledge-base/:id/sources/:sourceId/test
265
- * @param {String} id The knowledge base id
266
- * @param {String} sourceId The source id
267
- * @param {String} authToken Authentication token
268
- * @returns {Promise<object>}
269
- */
270
- const testSource = (id, sourceId, authToken) => {
271
- return new Promise((resolve, reject) => {
272
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base/${id}/sources/${sourceId}/test`, {}, { headers: { authorization: authToken } });
273
- request
274
- .then((response) => {
275
- resolve(response.data);
276
- })
277
- .catch((error) => {
278
- reject(error);
279
- });
280
- });
281
- };
282
- exports.testSource = testSource;
283
- // ── Document Management ───────────────────────────────────────────────────────
284
- /**
285
- * List a knowledge base's documents (paginated, with status + lastSync). There is
286
- * no upload endpoint — documents are only ingested via configured sources.
287
- * GET /api/v1/knowledge-base/:id/documents
288
- * @param {String} id The knowledge base id
289
- * @param {DocumentListParams} params Optional pagination / status filters
290
- * @param {String} authToken Authentication token
291
- * @returns {Promise<object>}
292
- */
293
- const listDocuments = (id, params, authToken) => {
294
- return new Promise((resolve, reject) => {
295
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base/${id}/documents`, {
296
- headers: { authorization: authToken },
297
- params: params,
298
- });
299
- request
300
- .then((response) => {
301
- resolve(response.data);
302
- })
303
- .catch((error) => {
304
- reject(error);
305
- });
306
- });
307
- };
308
- exports.listDocuments = listDocuments;
309
- /**
310
- * Get one knowledge base document and what the RAG holds for it: its chunks,
311
- * after redaction, in order (the first 1000; `truncated` says when there are
312
- * more). No chunks while the document is not processed, or is held for review
313
- * or blocked. Needs the knowledge base access search needs, and the
314
- * document's own source permissions (403); 404 when either is missing.
315
- * GET /api/v1/knowledge-base/:id/documents/:docId
316
- * @param {String} id The knowledge base id
317
- * @param {String} docId The document id
318
- * @param {String} authToken Authentication token
319
- * @returns {Promise<KnowledgeBaseDocumentContent>}
320
- */
321
- const getDocument = (id, docId, authToken) => {
322
- return new Promise((resolve, reject) => {
323
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base/${id}/documents/${docId}`, { headers: { authorization: authToken } });
324
- request
325
- .then((response) => {
326
- resolve(response.data);
327
- })
328
- .catch((error) => {
329
- reject(error);
330
- });
331
- });
332
- };
333
- exports.getDocument = getDocument;
334
- /**
335
- * List the skills a knowledge base's content was labelled with, across its
336
- * processed documents, most named first: `{ items, total, limit }`, each item
337
- * `{ name, nameNormalized, scope, proficiencyLevels, documentCount }`, where
338
- * `scope` is "organization", "general" or null (labelled before skills had one).
339
- * GET /api/v1/knowledge-base/:id/skills
340
- * @param {String} id The knowledge base id
341
- * @param {SkillListParams} params Optional limit
342
- * @param {String} authToken Authentication token
343
- * @returns {Promise<object>}
344
- */
345
- const listSkills = (id, params, authToken) => {
346
- return new Promise((resolve, reject) => {
347
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base/${id}/skills`, {
348
- headers: { authorization: authToken },
349
- params: params,
350
- });
351
- request
352
- .then((response) => {
353
- resolve(response.data);
354
- })
355
- .catch((error) => {
356
- reject(error);
357
- });
358
- });
359
- };
360
- exports.listSkills = listSkills;
361
- /**
362
- * Set how a knowledge base's skills are named, and rename them on every
363
- * document and chunk already labelled; every document labelled later takes
364
- * them too. The mappings replace the ones before; an empty list gives back
365
- * every skill as labelling named it. Owner or editor only; refused while a sync
366
- * of one of its sources is under way (409) and for mappings that do not hold —
367
- * a skill mapped twice, or mappings that lead a skill back to itself (400).
368
- * PUT /api/v1/knowledge-base/:id/skill-mappings
369
- * @param {String} id The knowledge base id
370
- * @param {SkillMapping[]} skillMappings The mappings, `[{ from, to }]`
371
- * @param {String} authToken Authentication token
372
- * @returns {Promise<object>} { knowledgeBase, documents, chunks }: the knowledge
373
- * base with the mappings as stored, and how many documents and chunks were
374
- * rewritten
375
- */
376
- const setSkillMappings = (id, skillMappings, authToken) => {
377
- return new Promise((resolve, reject) => {
378
- const request = axiosClient_js_1.client.put(`/api/v1/knowledge-base/${id}/skill-mappings`, { skillMappings }, { headers: { authorization: authToken } });
379
- request
380
- .then((response) => {
381
- resolve(response.data);
382
- })
383
- .catch((error) => {
384
- reject(error);
385
- });
386
- });
387
- };
388
- exports.setSkillMappings = setSkillMappings;
389
- /**
390
- * What the knowledge bases the caller can open hold about one skill: how many
391
- * of their documents name it (any spelling, under the names set with Edit
392
- * skill names), in which knowledge bases, and the microskills their passages
393
- * cover. The skill and skill template Additional Information dialogs ask it
394
- * before they offer StackFactor as a data source. Only what the caller may
395
- * open counts: their role on each knowledge base and each document's source
396
- * permissions decide. Requires VIEW_KNOWLEDGE_BASE; the name must be 1 to 200
397
- * characters (400 otherwise).
398
- * GET /api/v1/knowledge-base/skill-coverage
399
- * @param {String} skill The skill's or skill template's name
400
- * @param {String} authToken Authentication token
401
- * @returns {Promise<SkillCoverage>}
402
- */
403
- const getSkillCoverage = (skill, authToken) => {
404
- return new Promise((resolve, reject) => {
405
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base/skill-coverage`, {
406
- headers: { authorization: authToken },
407
- params: { skill },
408
- });
409
- request
410
- .then((response) => {
411
- resolve(response.data);
412
- })
413
- .catch((error) => {
414
- reject(error);
415
- });
416
- });
417
- };
418
- exports.getSkillCoverage = getSkillCoverage;
419
- /**
420
- * One of a knowledge base's skills, opened on its page: its microskills, as
421
- * grouped after the last sync, each with how many passages teach it, most
422
- * first. Any spelling of the skill matches. Requires VIEW_KNOWLEDGE_BASE and a
423
- * role on the knowledge base; the name must be 1 to 200 characters (400
424
- * otherwise).
425
- * GET /api/v1/knowledge-base/:id/skills/micro-skills
426
- * @param {String} id The knowledge base id
427
- * @param {String} skill The skill's name
428
- * @param {String} authToken Authentication token
429
- * @returns {Promise<KnowledgeBaseMicroSkills>}
430
- */
431
- const listMicroSkills = (id, skill, authToken) => {
432
- return new Promise((resolve, reject) => {
433
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base/${id}/skills/micro-skills`, {
434
- headers: { authorization: authToken },
435
- params: { skill },
436
- });
437
- request
438
- .then((response) => {
439
- resolve(response.data);
440
- })
441
- .catch((error) => {
442
- reject(error);
443
- });
444
- });
445
- };
446
- exports.listMicroSkills = listMicroSkills;
447
- /**
448
- * Delete a single document (cascades to chunks + S3 images + dependent entity
449
- * flags).
450
- * DELETE /api/v1/knowledge-base/:id/documents/:docId
451
- * @param {String} id The knowledge base id
452
- * @param {String} docId The document id
453
- * @param {String} authToken Authentication token
454
- * @returns {Promise<object>}
455
- */
456
- const deleteDocument = (id, docId, authToken) => {
457
- return new Promise((resolve, reject) => {
458
- const request = axiosClient_js_1.client.delete(`/api/v1/knowledge-base/${id}/documents/${docId}`, { headers: { authorization: authToken } });
459
- request
460
- .then((response) => {
461
- resolve(response.data);
462
- })
463
- .catch((error) => {
464
- reject(error);
465
- });
466
- });
467
- };
468
- exports.deleteDocument = deleteDocument;
469
- // ── KB Access Management (owner only) ─────────────────────────────────────────
470
- /**
471
- * List a knowledge base's access entries.
472
- * GET /api/v1/knowledge-base/:id/access
473
- * @param {String} id The knowledge base id
474
- * @param {String} authToken Authentication token
475
- * @returns {Promise<object>}
476
- */
477
- const listAccess = (id, authToken) => {
478
- return new Promise((resolve, reject) => {
479
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base/${id}/access`, {
480
- headers: { authorization: authToken },
481
- });
482
- request
483
- .then((response) => {
484
- resolve(response.data);
485
- })
486
- .catch((error) => {
487
- reject(error);
488
- });
489
- });
490
- };
491
- exports.listAccess = listAccess;
492
- /**
493
- * Grant (upsert) an access entry. Owner only. Access is keyed by
494
- * `(subjectType, subjectId)`, so re-granting a subject that already has an entry
495
- * updates its role — there is no separate "update role" endpoint.
496
- * POST /api/v1/knowledge-base/:id/access
497
- * @param {String} id The knowledge base id
498
- * @param {AccessEntryInput} entry The `{ subjectType, subjectId, role }` grant
499
- * @param {String} authToken Authentication token
500
- * @returns {Promise<object>}
501
- */
502
- const grantAccess = (id, entry, authToken) => {
503
- return new Promise((resolve, reject) => {
504
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base/${id}/access`, entry, {
505
- headers: { authorization: authToken },
506
- });
507
- request
508
- .then((response) => {
509
- resolve(response.data);
510
- })
511
- .catch((error) => {
512
- reject(error);
513
- });
514
- });
515
- };
516
- exports.grantAccess = grantAccess;
517
- /**
518
- * Revoke a subject's access. Owner only. Keyed by `(subjectType, subjectId)` — the
519
- * same composite key `grantAccess` upserts on. The backend refuses to remove the
520
- * last owner.
521
- * DELETE /api/v1/knowledge-base/:id/access
522
- * @param {String} id The knowledge base id
523
- * @param {String} subjectType One of `KNOWLEDGE_BASE.SUBJECT_TYPE`
524
- * @param {String} subjectId The subject whose access is revoked
525
- * @param {String} authToken Authentication token
526
- * @returns {Promise<object>}
527
- */
528
- const revokeAccess = (id, subjectType, subjectId, authToken) => {
529
- return new Promise((resolve, reject) => {
530
- const request = axiosClient_js_1.client.delete(`/api/v1/knowledge-base/${id}/access`, {
531
- headers: { authorization: authToken },
532
- data: { subjectType: subjectType, subjectId: subjectId },
533
- });
534
- request
535
- .then((response) => {
536
- resolve(response.data);
537
- })
538
- .catch((error) => {
539
- reject(error);
540
- });
541
- });
542
- };
543
- exports.revokeAccess = revokeAccess;
544
- // ── Compliance + Redaction Configuration ──────────────────────────────────────
545
- /**
546
- * Read a knowledge base's redaction policy.
547
- * GET /api/v1/knowledge-base/:id/redaction-policy
548
- * @param {String} id The knowledge base id
549
- * @param {String} authToken Authentication token
550
- * @returns {Promise<object>}
551
- */
552
- const getRedactionPolicy = (id, authToken) => {
553
- return new Promise((resolve, reject) => {
554
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base/${id}/redaction-policy`, { headers: { authorization: authToken } });
555
- request
556
- .then((response) => {
557
- resolve(response.data);
558
- })
559
- .catch((error) => {
560
- reject(error);
561
- });
562
- });
563
- };
564
- exports.getRedactionPolicy = getRedactionPolicy;
565
- /**
566
- * Set a knowledge base's per-KB redaction behavior + DLP provider.
567
- * PUT /api/v1/knowledge-base/:id/redaction-policy
568
- * @param {String} id The knowledge base id
569
- * @param {object} policy The redaction policy
570
- * @param {String} authToken Authentication token
571
- * @returns {Promise<object>}
572
- */
573
- const updateRedactionPolicy = (id, policy, authToken) => {
574
- return new Promise((resolve, reject) => {
575
- const request = axiosClient_js_1.client.put(`/api/v1/knowledge-base/${id}/redaction-policy`, policy, { headers: { authorization: authToken } });
576
- request
577
- .then((response) => {
578
- resolve(response.data);
579
- })
580
- .catch((error) => {
581
- reject(error);
582
- });
583
- });
584
- };
585
- exports.updateRedactionPolicy = updateRedactionPolicy;
586
- /**
587
- * Read the tenant's compliance profile (admin only). Governs which RAG processors
588
- * a KB may route to (e.g. HIPAA tenants → BAA-eligible processors only).
589
- * GET /api/v1/tenants/compliance-profile
590
- * @param {String} authToken Authentication token
591
- * @returns {Promise<object>}
592
- */
593
- const getComplianceProfile = (authToken) => {
594
- return new Promise((resolve, reject) => {
595
- const request = axiosClient_js_1.client.get(`/api/v1/tenants/compliance-profile`, {
596
- headers: { authorization: authToken },
597
- });
598
- request
599
- .then((response) => {
600
- resolve(response.data);
601
- })
602
- .catch((error) => {
603
- reject(error);
604
- });
605
- });
606
- };
607
- exports.getComplianceProfile = getComplianceProfile;
608
- /**
609
- * Update the tenant's compliance profile (admin only; not exposed via the KB UI).
610
- * PUT /api/v1/tenants/compliance-profile
611
- * @param {object} profile The compliance profile
612
- * @param {String} authToken Authentication token
613
- * @returns {Promise<object>}
614
- */
615
- const updateComplianceProfile = (profile, authToken) => {
616
- return new Promise((resolve, reject) => {
617
- const request = axiosClient_js_1.client.put(`/api/v1/tenants/compliance-profile`, profile, { headers: { authorization: authToken } });
618
- request
619
- .then((response) => {
620
- resolve(response.data);
621
- })
622
- .catch((error) => {
623
- reject(error);
624
- });
625
- });
626
- };
627
- exports.updateComplianceProfile = updateComplianceProfile;
628
- /**
629
- * Trigger a GDPR subject-purge ("right to be forgotten"; admin only).
630
- * POST /api/v1/compliance/right-to-be-forgotten
631
- * @param {object} data The subject-purge request
632
- * @param {String} authToken Authentication token
633
- * @returns {Promise<object>}
634
- */
635
- const rightToBeForgotten = (data, authToken) => {
636
- return new Promise((resolve, reject) => {
637
- const request = axiosClient_js_1.client.post(`/api/v1/compliance/right-to-be-forgotten`, data, { headers: { authorization: authToken } });
638
- request
639
- .then((response) => {
640
- resolve(response.data);
641
- })
642
- .catch((error) => {
643
- reject(error);
644
- });
645
- });
646
- };
647
- exports.rightToBeForgotten = rightToBeForgotten;
648
- // ── Review Center — overview ──────────────────────────────────────────────────
649
- /**
650
- * Overview of all Review Center streams + counts for a knowledge base.
651
- * GET /api/v1/knowledge-base/:id/review
652
- * @param {String} id The knowledge base id
653
- * @param {String} authToken Authentication token
654
- * @returns {Promise<object>}
655
- */
656
- const getReviewOverview = (id, authToken) => {
657
- return new Promise((resolve, reject) => {
658
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base/${id}/review`, {
659
- headers: { authorization: authToken },
660
- });
661
- request
662
- .then((response) => {
663
- resolve(response.data);
664
- })
665
- .catch((error) => {
666
- reject(error);
667
- });
668
- });
669
- };
670
- exports.getReviewOverview = getReviewOverview;
671
- // ── Review Center — Stream 1: Quarantine release ──────────────────────────────
672
- /**
673
- * List QUARANTINED documents (Review Center stream 1).
674
- * GET /api/v1/knowledge-base/:id/review/quarantine
675
- * @param {String} id The knowledge base id
676
- * @param {String} authToken Authentication token
677
- * @returns {Promise<object>}
678
- */
679
- const listQuarantine = (id, authToken) => {
680
- return new Promise((resolve, reject) => {
681
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base/${id}/review/quarantine`, { headers: { authorization: authToken } });
682
- request
683
- .then((response) => {
684
- resolve(response.data);
685
- })
686
- .catch((error) => {
687
- reject(error);
688
- });
689
- });
690
- };
691
- exports.listQuarantine = listQuarantine;
692
- /**
693
- * List the documents released from review (Review Center stream 1): every one
694
- * released and not held again since, the newest release first, each with
695
- * `quarantineReleasedAt` and `quarantineReleasedByName` (who released it, or
696
- * null). Requires RELEASE_QUARANTINE + owner|editor, as the held list does.
697
- * GET /api/v1/knowledge-base/:id/review/quarantine?state=released
698
- * @param {String} id The knowledge base id
699
- * @param {String} authToken Authentication token
700
- * @returns {Promise<object>}
701
- */
702
- const listReleased = (id, authToken) => {
703
- return new Promise((resolve, reject) => {
704
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base/${id}/review/quarantine`, { headers: { authorization: authToken }, params: { state: "released" } });
705
- request
706
- .then((response) => {
707
- resolve(response.data);
708
- })
709
- .catch((error) => {
710
- reject(error);
711
- });
712
- });
713
- };
714
- exports.listReleased = listReleased;
715
- /**
716
- * Release a quarantined document. Requires RELEASE_QUARANTINE + owner|editor.
717
- * POST /api/v1/knowledge-base/:id/review/quarantine/:docId/release
718
- * @param {String} id The knowledge base id
719
- * @param {String} docId The document id
720
- * @param {String} authToken Authentication token
721
- * @returns {Promise<object>}
722
- */
723
- const releaseQuarantine = (id, docId, authToken) => {
724
- return new Promise((resolve, reject) => {
725
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base/${id}/review/quarantine/${docId}/release`, {}, { headers: { authorization: authToken } });
726
- request
727
- .then((response) => {
728
- resolve(response.data);
729
- })
730
- .catch((error) => {
731
- reject(error);
732
- });
733
- });
734
- };
735
- exports.releaseQuarantine = releaseQuarantine;
736
- /**
737
- * Apply a reviewer's decisions to many held documents at once: release each
738
- * named document back through ingestion, keep it in quarantine as reviewed, or
739
- * block it from the knowledge base. One run per source released into is asked
740
- * for, never one per document. Requires RELEASE_QUARANTINE + owner|editor.
741
- * POST /api/v1/knowledge-base/:id/review/quarantine/decisions
742
- * @param {String} id The knowledge base id
743
- * @param {Array<{documentId: string, decision: "release"|"quarantine"|"block", reason?: string}>} decisions One decision per document, at most 500
744
- * @param {String} authToken Authentication token
745
- * @returns {Promise<object>} `{ results: [{ documentId, decision, outcome }], runs: [{ sourceId, correlationId, started }] }`
746
- */
747
- const decideQuarantine = (id, decisions, authToken) => {
748
- return new Promise((resolve, reject) => {
749
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base/${id}/review/quarantine/decisions`, { decisions }, { headers: { authorization: authToken } });
750
- request
751
- .then((response) => {
752
- resolve(response.data);
753
- })
754
- .catch((error) => {
755
- reject(error);
756
- });
757
- });
758
- };
759
- exports.decideQuarantine = decideQuarantine;
760
- /**
761
- * Re-ingest a quarantined document (optionally with an updated redaction policy).
762
- * Publishes a kb-source-event (trigger="quarantine_re_ingest"). Requires
763
- * RELEASE_QUARANTINE + owner.
764
- * POST /api/v1/knowledge-base/:id/review/quarantine/:docId/re-ingest
765
- * @param {String} id The knowledge base id
766
- * @param {String} docId The document id
767
- * @param {object} data Optional body, e.g. `{ updatedRedactionPolicy }`
768
- * @param {String} authToken Authentication token
769
- * @returns {Promise<object>}
770
- */
771
- const reingestQuarantine = (id, docId, data, authToken) => {
772
- return new Promise((resolve, reject) => {
773
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base/${id}/review/quarantine/${docId}/re-ingest`, data, { headers: { authorization: authToken } });
774
- request
775
- .then((response) => {
776
- resolve(response.data);
777
- })
778
- .catch((error) => {
779
- reject(error);
780
- });
781
- });
782
- };
783
- exports.reingestQuarantine = reingestQuarantine;
784
- /**
785
- * Delete a quarantined document. Requires RELEASE_QUARANTINE + owner.
786
- * POST /api/v1/knowledge-base/:id/review/quarantine/:docId/delete
787
- * @param {String} id The knowledge base id
788
- * @param {String} docId The document id
789
- * @param {String} authToken Authentication token
790
- * @returns {Promise<object>}
791
- */
792
- const deleteQuarantine = (id, docId, authToken) => {
793
- return new Promise((resolve, reject) => {
794
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base/${id}/review/quarantine/${docId}/delete`, {}, { headers: { authorization: authToken } });
795
- request
796
- .then((response) => {
797
- resolve(response.data);
798
- })
799
- .catch((error) => {
800
- reject(error);
801
- });
802
- });
803
- };
804
- exports.deleteQuarantine = deleteQuarantine;
805
- // ── Review Center — Stream 2: Generated content review ────────────────────────
806
- /**
807
- * List generated artifacts awaiting review (needsReview=true).
808
- * Requires GENERATE_FROM_KB + owner|editor.
809
- * GET /api/v1/knowledge-base/:id/review/generated
810
- * @param {String} id The knowledge base id
811
- * @param {String} authToken Authentication token
812
- * @returns {Promise<object>}
813
- */
814
- const listGeneratedReview = (id, authToken) => {
815
- return new Promise((resolve, reject) => {
816
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base/${id}/review/generated`, { headers: { authorization: authToken } });
817
- request
818
- .then((response) => {
819
- resolve(response.data);
820
- })
821
- .catch((error) => {
822
- reject(error);
823
- });
824
- });
825
- };
826
- exports.listGeneratedReview = listGeneratedReview;
827
- /**
828
- * Approve a generated artifact. Requires GENERATE_FROM_KB + owner|editor.
829
- * POST /api/v1/knowledge-base/:id/review/generated/:entityId/approve
830
- * @param {String} id The knowledge base id
831
- * @param {String} entityId The artifact/entity id
832
- * @param {object} data Body `{ entityType, notes? }`
833
- * @param {String} authToken Authentication token
834
- * @returns {Promise<object>}
835
- */
836
- const approveGenerated = (id, entityId, data, authToken) => {
837
- return new Promise((resolve, reject) => {
838
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base/${id}/review/generated/${entityId}/approve`, data, { headers: { authorization: authToken } });
839
- request
840
- .then((response) => {
841
- resolve(response.data);
842
- })
843
- .catch((error) => {
844
- reject(error);
845
- });
846
- });
847
- };
848
- exports.approveGenerated = approveGenerated;
849
- /**
850
- * Approve a generated artifact with edits.
851
- * Requires GENERATE_FROM_KB + owner|editor.
852
- * POST /api/v1/knowledge-base/:id/review/generated/:entityId/edit-approve
853
- * @param {String} id The knowledge base id
854
- * @param {String} entityId The artifact/entity id
855
- * @param {object} data Body `{ entityType, edits, notes? }`
856
- * @param {String} authToken Authentication token
857
- * @returns {Promise<object>}
858
- */
859
- const editApproveGenerated = (id, entityId, data, authToken) => {
860
- return new Promise((resolve, reject) => {
861
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base/${id}/review/generated/${entityId}/edit-approve`, data, { headers: { authorization: authToken } });
862
- request
863
- .then((response) => {
864
- resolve(response.data);
865
- })
866
- .catch((error) => {
867
- reject(error);
868
- });
869
- });
870
- };
871
- exports.editApproveGenerated = editApproveGenerated;
872
- /**
873
- * Reject a generated artifact. Requires GENERATE_FROM_KB + owner|editor.
874
- * POST /api/v1/knowledge-base/:id/review/generated/:entityId/reject
875
- * @param {String} id The knowledge base id
876
- * @param {String} entityId The artifact/entity id
877
- * @param {object} data Body `{ entityType, reason }`
878
- * @param {String} authToken Authentication token
879
- * @returns {Promise<object>}
880
- */
881
- const rejectGenerated = (id, entityId, data, authToken) => {
882
- return new Promise((resolve, reject) => {
883
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base/${id}/review/generated/${entityId}/reject`, data, { headers: { authorization: authToken } });
884
- request
885
- .then((response) => {
886
- resolve(response.data);
887
- })
888
- .catch((error) => {
889
- reject(error);
890
- });
891
- });
892
- };
893
- exports.rejectGenerated = rejectGenerated;
894
- /**
895
- * Regenerate a generated artifact using current chunks.
896
- * Requires GENERATE_FROM_KB + owner|editor.
897
- * POST /api/v1/knowledge-base/:id/review/generated/:entityId/regenerate
898
- * @param {String} id The knowledge base id
899
- * @param {String} entityId The artifact/entity id
900
- * @param {object} data Body `{ entityType, regenerationHints? }`
901
- * @param {String} authToken Authentication token
902
- * @returns {Promise<object>}
903
- */
904
- const regenerateGenerated = (id, entityId, data, authToken) => {
905
- return new Promise((resolve, reject) => {
906
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base/${id}/review/generated/${entityId}/regenerate`, data, { headers: { authorization: authToken } });
907
- request
908
- .then((response) => {
909
- resolve(response.data);
910
- })
911
- .catch((error) => {
912
- reject(error);
913
- });
914
- });
915
- };
916
- exports.regenerateGenerated = regenerateGenerated;
917
- // ── Review Center — Stream 3: Contradiction flags ─────────────────────────────
918
- /**
919
- * List chunks with non-empty contradictionFlags[].
920
- * Requires GENERATE_FROM_KB + owner|editor.
921
- * GET /api/v1/knowledge-base/:id/review/contradictions
922
- * @param {String} id The knowledge base id
923
- * @param {String} authToken Authentication token
924
- * @returns {Promise<object>}
925
- */
926
- const listContradictions = (id, authToken) => {
927
- return new Promise((resolve, reject) => {
928
- const request = axiosClient_js_1.client.get(`/api/v1/knowledge-base/${id}/review/contradictions`, { headers: { authorization: authToken } });
929
- request
930
- .then((response) => {
931
- resolve(response.data);
932
- })
933
- .catch((error) => {
934
- reject(error);
935
- });
936
- });
937
- };
938
- exports.listContradictions = listContradictions;
939
- /**
940
- * Decide a contradiction between two chunks.
941
- * Requires GENERATE_FROM_KB + owner|editor.
942
- * POST /api/v1/knowledge-base/:id/review/contradictions/:chunkId/decide
943
- * @param {String} id The knowledge base id
944
- * @param {String} chunkId The chunk id carrying the contradiction flag
945
- * @param {object} data Body `{ decision, otherChunkId, notes }` — `decision` is one
946
- * of `KNOWLEDGE_BASE.CONTRADICTION_DECISION`
947
- * @param {String} authToken Authentication token
948
- * @returns {Promise<object>}
949
- */
950
- const decideContradiction = (id, chunkId, data, authToken) => {
951
- return new Promise((resolve, reject) => {
952
- const request = axiosClient_js_1.client.post(`/api/v1/knowledge-base/${id}/review/contradictions/${chunkId}/decide`, data, { headers: { authorization: authToken } });
953
- request
954
- .then((response) => {
955
- resolve(response.data);
956
- })
957
- .catch((error) => {
958
- reject(error);
959
- });
960
- });
961
- };
962
- exports.decideContradiction = decideContradiction;
963
- // ── Out-of-Sync Notification Actions ──────────────────────────────────────────
964
- // (design §14 / §14A — surfaced as notifications, acted on per-artifact.
965
- // Requires GENERATE_FROM_KB + owner|editor on the KB.)
966
- /**
967
- * Regenerate a stale artifact from a notification using current chunks.
968
- * POST /api/v1/notifications/:notificationId/artifacts/:artifactId/regenerate
969
- * @param {String} notificationId The notification id
970
- * @param {String} artifactId The artifact id
971
- * @param {object} data Body `{ entityType }`
972
- * @param {String} authToken Authentication token
973
- * @returns {Promise<object>}
974
- */
975
- const regenerateArtifact = (notificationId, artifactId, data, authToken) => {
976
- return new Promise((resolve, reject) => {
977
- const request = axiosClient_js_1.client.post(`/api/v1/notifications/${notificationId}/artifacts/${artifactId}/regenerate`, data, { headers: { authorization: authToken } });
978
- request
979
- .then((response) => {
980
- resolve(response.data);
981
- })
982
- .catch((error) => {
983
- reject(error);
984
- });
985
- });
986
- };
987
- exports.regenerateArtifact = regenerateArtifact;
988
- /**
989
- * Retire (soft-delete) a stale artifact from a notification.
990
- * POST /api/v1/notifications/:notificationId/artifacts/:artifactId/retire
991
- * @param {String} notificationId The notification id
992
- * @param {String} artifactId The artifact id
993
- * @param {object} data Body `{ entityType }`
994
- * @param {String} authToken Authentication token
995
- * @returns {Promise<object>}
996
- */
997
- const retireArtifact = (notificationId, artifactId, data, authToken) => {
998
- return new Promise((resolve, reject) => {
999
- const request = axiosClient_js_1.client.post(`/api/v1/notifications/${notificationId}/artifacts/${artifactId}/retire`, data, { headers: { authorization: authToken } });
1000
- request
1001
- .then((response) => {
1002
- resolve(response.data);
1003
- })
1004
- .catch((error) => {
1005
- reject(error);
1006
- });
1007
- });
1008
- };
1009
- exports.retireArtifact = retireArtifact;
1010
- /**
1011
- * Dismiss a stale-artifact flag (mark the staleness acceptable).
1012
- * POST /api/v1/notifications/:notificationId/artifacts/:artifactId/dismiss
1013
- * @param {String} notificationId The notification id
1014
- * @param {String} artifactId The artifact id
1015
- * @param {object} data Body `{ entityType, reason? }`
1016
- * @param {String} authToken Authentication token
1017
- * @returns {Promise<object>}
1018
- */
1019
- const dismissArtifact = (notificationId, artifactId, data, authToken) => {
1020
- return new Promise((resolve, reject) => {
1021
- const request = axiosClient_js_1.client.post(`/api/v1/notifications/${notificationId}/artifacts/${artifactId}/dismiss`, data, { headers: { authorization: authToken } });
1022
- request
1023
- .then((response) => {
1024
- resolve(response.data);
1025
- })
1026
- .catch((error) => {
1027
- reject(error);
1028
- });
1029
- });
1030
- };
1031
- exports.dismissArtifact = dismissArtifact;
1032
- /**
1033
- * Dismiss an entire out-of-sync notification (all artifacts).
1034
- * POST /api/v1/notifications/:notificationId/dismiss-all
1035
- * @param {String} notificationId The notification id
1036
- * @param {String} authToken Authentication token
1037
- * @returns {Promise<object>}
1038
- */
1039
- const dismissAllArtifacts = (notificationId, authToken) => {
1040
- return new Promise((resolve, reject) => {
1041
- const request = axiosClient_js_1.client.post(`/api/v1/notifications/${notificationId}/dismiss-all`, {}, { headers: { authorization: authToken } });
1042
- request
1043
- .then((response) => {
1044
- resolve(response.data);
1045
- })
1046
- .catch((error) => {
1047
- reject(error);
1048
- });
1049
- });
1050
- };
1051
- exports.dismissAllArtifacts = dismissAllArtifacts;
1052
- // ── Identity Mapping ──────────────────────────────────────────────────────────
1053
- // (design §14 — maps source-side principals to tenant users for KB source ACLs.)
1054
- /**
1055
- * List the current user's source-side identities.
1056
- * GET /api/v1/identity/source-mappings
1057
- * @param {String} authToken Authentication token
1058
- * @returns {Promise<object>}
1059
- */
1060
- const listSourceMappings = (authToken) => {
1061
- return new Promise((resolve, reject) => {
1062
- const request = axiosClient_js_1.client.get(`/api/v1/identity/source-mappings`, {
1063
- headers: { authorization: authToken },
1064
- });
1065
- request
1066
- .then((response) => {
1067
- resolve(response.data);
1068
- })
1069
- .catch((error) => {
1070
- reject(error);
1071
- });
1072
- });
1073
- };
1074
- exports.listSourceMappings = listSourceMappings;
1075
- /**
1076
- * Tenant-admin override for a user's source identity mapping.
1077
- * PUT /api/v1/identity/source-mappings/:sourceType
1078
- * @param {String} sourceType The source type key
1079
- * @param {object} data The mapping override
1080
- * @param {String} authToken Authentication token
1081
- * @returns {Promise<object>}
1082
- */
1083
- const updateSourceMapping = (sourceType, data, authToken) => {
1084
- return new Promise((resolve, reject) => {
1085
- const request = axiosClient_js_1.client.put(`/api/v1/identity/source-mappings/${sourceType}`, data, { headers: { authorization: authToken } });
1086
- request
1087
- .then((response) => {
1088
- resolve(response.data);
1089
- })
1090
- .catch((error) => {
1091
- reject(error);
1092
- });
1093
- });
1094
- };
1095
- exports.updateSourceMapping = updateSourceMapping;
1096
- /**
1097
- * Bulk-resolve source principal IDs → tenant users (internal / service-to-service).
1098
- * POST /api/v1/identity/source-mappings/resolve
1099
- * @param {object} data Body carrying the principal IDs to resolve
1100
- * @param {String} authToken Authentication token
1101
- * @returns {Promise<object>}
1102
- */
1103
- const resolveSourceMappings = (data, authToken) => {
1104
- return new Promise((resolve, reject) => {
1105
- const request = axiosClient_js_1.client.post(`/api/v1/identity/source-mappings/resolve`, data, { headers: { authorization: authToken } });
1106
- request
1107
- .then((response) => {
1108
- resolve(response.data);
1109
- })
1110
- .catch((error) => {
1111
- reject(error);
1112
- });
1113
- });
5
+ // Thin client wrappers over the user-facing KB *management* endpoints
6
+ // (design §14 — "KB management endpoints ... remain user-facing; they configure
7
+ // the KB, they don't perform RAG"). RAG retrieval / Q&A / generation are
8
+ // internal-only and intentionally NOT exposed here.
9
+ //
10
+ // Sections mirror design §14: CRUD · Sources · Documents · Access · Compliance &
11
+ // Redaction · Review Center (3 streams) · Out-of-Sync Notification Actions ·
12
+ // Identity Mapping.
13
+ //
14
+ // The operations live in `./knowledgeBase/`, one module per area; this file
15
+ // re-exports all of them so every import path and name stays as it was.
16
+ //
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1114
30
  };
1115
- exports.resolveSourceMappings = resolveSourceMappings;
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ __exportStar(require("./knowledgeBase/knowledgeBases.js"), exports);
33
+ __exportStar(require("./knowledgeBase/sources.js"), exports);
34
+ __exportStar(require("./knowledgeBase/documents.js"), exports);
35
+ __exportStar(require("./knowledgeBase/skills.js"), exports);
36
+ __exportStar(require("./knowledgeBase/review.js"), exports);
1116
37
  //# sourceMappingURL=knowledgeBase.js.map