@stackfactor/client-api 1.19.3 → 1.20.2

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 -785
  30. package/dist/cjs/lib/knowledgeBase.d.ts.map +1 -1
  31. package/dist/cjs/lib/knowledgeBase.js +32 -1229
  32. package/dist/cjs/lib/knowledgeBase.js.map +1 -1
  33. package/dist/cjs/lib/knowledgeBaseAgent.d.ts +109 -2
  34. package/dist/cjs/lib/knowledgeBaseAgent.d.ts.map +1 -1
  35. package/dist/cjs/lib/knowledgeBaseAgent.js +71 -8
  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 -785
  73. package/dist/esm/lib/knowledgeBase.d.ts.map +1 -1
  74. package/dist/esm/lib/knowledgeBase.js +18 -1175
  75. package/dist/esm/lib/knowledgeBase.js.map +1 -1
  76. package/dist/esm/lib/knowledgeBaseAgent.d.ts +109 -2
  77. package/dist/esm/lib/knowledgeBaseAgent.d.ts.map +1 -1
  78. package/dist/esm/lib/knowledgeBaseAgent.js +66 -7
  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
@@ -0,0 +1,247 @@
1
+ /**
2
+ * A skill a knowledge base's people listed for labelling to look for. Picked
3
+ * from the catalog, it names the catalog skill: the tenant's skills
4
+ * (`"skill"`) or the platform's skill templates (`"skillTemplate"`). The
5
+ * platform reads that skill's own microskills; any sent are ignored.
6
+ */
7
+ export interface ListedSkill {
8
+ name: string;
9
+ catalogId?: string | null;
10
+ catalogType?: "skill" | "skillTemplate" | null;
11
+ /** Read-only: the catalog skill's own microskills, as stored. */
12
+ microSkills?: string[];
13
+ }
14
+ /**
15
+ * What labelling looks for in content: every skill it teaches (`"discover"`,
16
+ * the default), the listed skills first, under their names, and any others
17
+ * (`"guided"`), or only the listed ones (`"focused"`). Guided and focused need
18
+ * at least one skill, at most 50; discover lists none. Each connection holds
19
+ * its own (`SourceInput.skillSettings`).
20
+ */
21
+ export interface SkillSettings {
22
+ mode: "discover" | "guided" | "focused";
23
+ skills: ListedSkill[];
24
+ }
25
+ /** Optional options for the list of a knowledge base's skills. */
26
+ export interface SkillListParams {
27
+ /** How many skills, most named first: 1 to 200 (default 50). */
28
+ limit?: number;
29
+ }
30
+ /**
31
+ * One way a knowledge base's people name a skill its content was labelled
32
+ * with: `from`, a skill's name (any spelling of it), becomes `to` — a new name,
33
+ * or the name of a skill it merges into — or null, which removes the skill.
34
+ */
35
+ export interface SkillMapping {
36
+ from: string;
37
+ to: string | null;
38
+ }
39
+ /** A knowledge base that holds documents about a skill (`getSkillCoverage`). */
40
+ export interface SkillCoverageKnowledgeBase {
41
+ _id: string;
42
+ name: string;
43
+ /** How many of its documents the caller may read name the skill. */
44
+ documentCount: number;
45
+ /** The kinds of resource those documents came from. */
46
+ sourceTypes: string[];
47
+ }
48
+ /** What the knowledge bases the caller can open hold about one skill. */
49
+ export interface SkillCoverage {
50
+ /** The skill's name as it was matched: spaces collapsed, trimmed. */
51
+ skill: string;
52
+ documentCount: number;
53
+ /** Most documents first. */
54
+ knowledgeBases: SkillCoverageKnowledgeBase[];
55
+ /** The microskills their passages cover most, at most 12. */
56
+ microSkills: string[];
57
+ /** Every microskill they cover. */
58
+ microSkillCount: number;
59
+ }
60
+ /** Options for the skill names the caller's knowledge bases suggest (`getSkillSuggestions`). */
61
+ export interface SkillSuggestionParams {
62
+ /** How many suggestions: 1 to 25 (default 10). */
63
+ limit?: number;
64
+ /**
65
+ * Where a name that already exists is looked for: the tenant's skills
66
+ * (`"skill"`, the default) or, for the skill template form, the platform's
67
+ * skill templates (`"skillTemplate"`, a StackFactor admin tenant only).
68
+ */
69
+ catalog?: "skill" | "skillTemplate";
70
+ /** The skill or skill template being edited: its own name is no clash. */
71
+ excludeId?: string | null;
72
+ }
73
+ /** A skill name the caller's knowledge bases suggest (`getSkillSuggestions`). */
74
+ export interface SkillSuggestion {
75
+ /** The spelling most of its documents use. */
76
+ name: string;
77
+ /** How many documents the caller may read name it. */
78
+ documentCount: number;
79
+ /** How many knowledge bases those documents are in. */
80
+ knowledgeBaseCount: number;
81
+ /**
82
+ * A skill (with `catalog` "skillTemplate", a skill template) already has
83
+ * this name, in some spelling: a new one may not take it.
84
+ */
85
+ existingSkill: boolean;
86
+ /**
87
+ * How the skill (skill template) that already has the name spells it, which
88
+ * may differ from `name` ("react" for "React"); null when none has it.
89
+ */
90
+ existingSkillName: string | null;
91
+ }
92
+ /** One of a knowledge base skill's microskills, and how many passages teach it. */
93
+ export interface KnowledgeBaseMicroSkill {
94
+ name: string;
95
+ passages: number;
96
+ }
97
+ /**
98
+ * Where a knowledge base's microskill grouping stands, read from what the
99
+ * platform stores: asked for and not started (`queued`, since `requestedAt`),
100
+ * under way (`running`, since `startedAt`) or neither (`idle`); and when the
101
+ * last grouping ended, null before the first.
102
+ */
103
+ export interface KnowledgeBaseMicroSkillGrouping {
104
+ state: "idle" | "queued" | "running";
105
+ requestedAt: string | null;
106
+ startedAt: string | null;
107
+ finishedAt: string | null;
108
+ }
109
+ /** A knowledge base skill's microskills (`listMicroSkills`). */
110
+ export interface KnowledgeBaseMicroSkills {
111
+ /** The skill as it was asked for: spaces collapsed, trimmed. */
112
+ skill: string;
113
+ /**
114
+ * True when the passages' tags were grouped into microskills; false before,
115
+ * when `microSkills` are the tags as labelling gave them.
116
+ */
117
+ consolidated: boolean;
118
+ consolidatedAt: string | null;
119
+ /** Most passages first. Every one, however many. */
120
+ microSkills: KnowledgeBaseMicroSkill[];
121
+ microSkillCount: number;
122
+ /** How many distinct passage tags they were grouped from. */
123
+ passageTags: number;
124
+ /**
125
+ * How many passages carry the skill's tags, each once. Absent, like the two
126
+ * fields below, from a platform older than Group now.
127
+ */
128
+ passages?: number;
129
+ /**
130
+ * True when those passages are fewer than a microskill needs: grouping never
131
+ * groups the skill, so its tags stay as they are and Group now would change
132
+ * nothing for it.
133
+ */
134
+ belowGroupingThreshold?: boolean;
135
+ /** Where the knowledge base's grouping stands. */
136
+ grouping?: KnowledgeBaseMicroSkillGrouping;
137
+ /**
138
+ * When the last grouping of a skill not grouped failed; null when it did not,
139
+ * or the skill is grouped.
140
+ */
141
+ groupingFailedAt?: string | null;
142
+ /**
143
+ * Why, when the platform's RAG processor was refused for good (none enabled
144
+ * or allowed by the compliance profile, or the one named switched off);
145
+ * null otherwise.
146
+ */
147
+ groupingFailure?: string | null;
148
+ }
149
+ /**
150
+ * List the skills a knowledge base's content was labelled with, across its
151
+ * processed documents, most named first: `{ items, total, limit }`, each item
152
+ * `{ name, nameNormalized, scope, proficiencyLevels, documentCount }`, where
153
+ * `scope` is "organization", "general" or null (labelled before skills had one).
154
+ * GET /api/v1/knowledge-base/:id/skills
155
+ * @param {String} id The knowledge base id
156
+ * @param {SkillListParams} params Optional limit
157
+ * @param {String} authToken Authentication token
158
+ * @returns {Promise<object>}
159
+ */
160
+ export declare const listSkills: (id: string, params: SkillListParams, authToken: string) => Promise<object>;
161
+ /**
162
+ * Set how a knowledge base's skills are named, and rename them on every
163
+ * document and chunk already labelled; every document labelled later takes
164
+ * them too. The mappings replace the ones before; an empty list gives back
165
+ * every skill as labelling named it. Owner or editor only; refused while a sync
166
+ * of one of its sources is under way (409) and for mappings that do not hold —
167
+ * a skill mapped twice, or mappings that lead a skill back to itself (400).
168
+ * PUT /api/v1/knowledge-base/:id/skill-mappings
169
+ * @param {String} id The knowledge base id
170
+ * @param {SkillMapping[]} skillMappings The mappings, `[{ from, to }]`
171
+ * @param {String} authToken Authentication token
172
+ * @returns {Promise<object>} { knowledgeBase, documents, chunks }: the knowledge
173
+ * base with the mappings as stored, and how many documents and chunks were
174
+ * rewritten
175
+ */
176
+ export declare const setSkillMappings: (id: string, skillMappings: SkillMapping[], authToken: string) => Promise<object>;
177
+ /**
178
+ * What the knowledge bases the caller can open hold about one skill: how many
179
+ * of their documents name it (any spelling, under the names set with Edit
180
+ * skill names), in which knowledge bases, and the microskills their passages
181
+ * cover. The skill and skill template Additional Information dialogs ask it
182
+ * before they offer StackFactor as a data source. Only what the caller may
183
+ * open counts: their role on each knowledge base and each document's source
184
+ * permissions decide. Requires VIEW_KNOWLEDGE_BASE; the name must be 1 to 200
185
+ * characters (400 otherwise).
186
+ * GET /api/v1/knowledge-base/skill-coverage
187
+ * @param {String} skill The skill's or skill template's name
188
+ * @param {String} authToken Authentication token
189
+ * @returns {Promise<SkillCoverage>}
190
+ */
191
+ export declare const getSkillCoverage: (skill: string, authToken: string) => Promise<SkillCoverage>;
192
+ /**
193
+ * The skill names the knowledge bases the caller can open suggest while a
194
+ * skill's or skill template's name is typed: the skills their documents were
195
+ * classified with whose name has a word starting with what was typed, in any
196
+ * spelling ("gov" suggests "AI Governance"), one per skill, most documents
197
+ * first. Only what the caller may open counts, as for `getSkillCoverage`.
198
+ * Fewer than 2 characters to match answer no suggestions. Requires
199
+ * VIEW_KNOWLEDGE_BASE; `q` is at most 200 characters (400 otherwise).
200
+ * GET /api/v1/knowledge-base/skill-suggestions
201
+ * @param {String} q What was typed
202
+ * @param {SkillSuggestionParams} params Optional limit, catalog and the id of
203
+ * the skill or skill template being edited
204
+ * @param {String} authToken Authentication token
205
+ * @returns {Promise<SkillSuggestion[]>}
206
+ */
207
+ export declare const getSkillSuggestions: (q: string, params: SkillSuggestionParams | undefined, authToken: string) => Promise<SkillSuggestion[]>;
208
+ /**
209
+ * One of a knowledge base's skills, opened on its page: its microskills, as
210
+ * grouped, each with how many passages teach it, most first, and where the
211
+ * knowledge base's grouping stands (`grouping`). Any spelling of the skill
212
+ * matches. Requires VIEW_KNOWLEDGE_BASE and a role on the knowledge base; the
213
+ * name must be 1 to 200 characters (400 otherwise).
214
+ * GET /api/v1/knowledge-base/:id/skills/micro-skills
215
+ * @param {String} id The knowledge base id
216
+ * @param {String} skill The skill's name
217
+ * @param {String} authToken Authentication token
218
+ * @returns {Promise<KnowledgeBaseMicroSkills>}
219
+ */
220
+ export declare const listMicroSkills: (id: string, skill: string, authToken: string) => Promise<KnowledgeBaseMicroSkills>;
221
+ /**
222
+ * Where a knowledge base's microskill grouping stands: queued, running or
223
+ * idle, and when the last one ended. What a page polls while a grouping is
224
+ * under way, rather than `listMicroSkills`: the platform reads the knowledge
225
+ * base and nothing else. Requires VIEW_KNOWLEDGE_BASE and a role on the
226
+ * knowledge base.
227
+ * GET /api/v1/knowledge-base/:id/skills/micro-skills/grouping
228
+ * @param {String} id The knowledge base id
229
+ * @param {String} authToken Authentication token
230
+ * @returns {Promise<KnowledgeBaseMicroSkillGrouping>}
231
+ */
232
+ export declare const getMicroSkillGrouping: (id: string, authToken: string) => Promise<KnowledgeBaseMicroSkillGrouping>;
233
+ /**
234
+ * Group now: groups the knowledge base's skills' passage tags into their
235
+ * microskills, in the background. Owner or editor only, as setting how its
236
+ * skills are named (403 otherwise; 404 for no such knowledge base). Asked
237
+ * while a grouping runs, nothing more is asked: the answer is that it is
238
+ * running. `getMicroSkillGrouping` says when it is done (no longer queued or
239
+ * running). The skills whose grouping failed are sent again now.
240
+ * POST /api/v1/knowledge-base/:id/skills/micro-skills/group
241
+ * @param {String} id The knowledge base id
242
+ * @param {String} authToken Authentication token
243
+ * @returns {Promise<KnowledgeBaseMicroSkillGrouping>} Where the grouping
244
+ * stands: queued or running, and when the last one ended
245
+ */
246
+ export declare const groupMicroSkills: (id: string, authToken: string) => Promise<KnowledgeBaseMicroSkillGrouping>;
247
+ //# sourceMappingURL=skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../../../src/lib/knowledgeBase/skills.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAAC;IAC/C,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;IACxC,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,kEAAkE;AAClE,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAED,gFAAgF;AAChF,MAAM,WAAW,0BAA0B;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,yEAAyE;AACzE,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,4BAA4B;IAC5B,cAAc,EAAE,0BAA0B,EAAE,CAAC;IAC7C,6DAA6D;IAC7D,WAAW,EAAE,MAAM,EA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0,0 +1,189 @@
1
+ import { client } from "../axiosClient.js";
2
+ /**
3
+ * List the skills a knowledge base's content was labelled with, across its
4
+ * processed documents, most named first: `{ items, total, limit }`, each item
5
+ * `{ name, nameNormalized, scope, proficiencyLevels, documentCount }`, where
6
+ * `scope` is "organization", "general" or null (labelled before skills had one).
7
+ * GET /api/v1/knowledge-base/:id/skills
8
+ * @param {String} id The knowledge base id
9
+ * @param {SkillListParams} params Optional limit
10
+ * @param {String} authToken Authentication token
11
+ * @returns {Promise<object>}
12
+ */
13
+ export const listSkills = (id, params, authToken) => {
14
+ return new Promise((resolve, reject) => {
15
+ const request = client.get(`/api/v1/knowledge-base/${id}/skills`, {
16
+ headers: { authorization: authToken },
17
+ params: params,
18
+ });
19
+ request
20
+ .then((response) => {
21
+ resolve(response.data);
22
+ })
23
+ .catch((error) => {
24
+ reject(error);
25
+ });
26
+ });
27
+ };
28
+ /**
29
+ * Set how a knowledge base's skills are named, and rename them on every
30
+ * document and chunk already labelled; every document labelled later takes
31
+ * them too. The mappings replace the ones before; an empty list gives back
32
+ * every skill as labelling named it. Owner or editor only; refused while a sync
33
+ * of one of its sources is under way (409) and for mappings that do not hold —
34
+ * a skill mapped twice, or mappings that lead a skill back to itself (400).
35
+ * PUT /api/v1/knowledge-base/:id/skill-mappings
36
+ * @param {String} id The knowledge base id
37
+ * @param {SkillMapping[]} skillMappings The mappings, `[{ from, to }]`
38
+ * @param {String} authToken Authentication token
39
+ * @returns {Promise<object>} { knowledgeBase, documents, chunks }: the knowledge
40
+ * base with the mappings as stored, and how many documents and chunks were
41
+ * rewritten
42
+ */
43
+ export const setSkillMappings = (id, skillMappings, authToken) => {
44
+ return new Promise((resolve, reject) => {
45
+ const request = client.put(`/api/v1/knowledge-base/${id}/skill-mappings`, { skillMappings }, { headers: { authorization: authToken } });
46
+ request
47
+ .then((response) => {
48
+ resolve(response.data);
49
+ })
50
+ .catch((error) => {
51
+ reject(error);
52
+ });
53
+ });
54
+ };
55
+ /**
56
+ * What the knowledge bases the caller can open hold about one skill: how many
57
+ * of their documents name it (any spelling, under the names set with Edit
58
+ * skill names), in which knowledge bases, and the microskills their passages
59
+ * cover. The skill and skill template Additional Information dialogs ask it
60
+ * before they offer StackFactor as a data source. Only what the caller may
61
+ * open counts: their role on each knowledge base and each document's source
62
+ * permissions decide. Requires VIEW_KNOWLEDGE_BASE; the name must be 1 to 200
63
+ * characters (400 otherwise).
64
+ * GET /api/v1/knowledge-base/skill-coverage
65
+ * @param {String} skill The skill's or skill template's name
66
+ * @param {String} authToken Authentication token
67
+ * @returns {Promise<SkillCoverage>}
68
+ */
69
+ export const getSkillCoverage = (skill, authToken) => {
70
+ return new Promise((resolve, reject) => {
71
+ const request = client.get(`/api/v1/knowledge-base/skill-coverage`, {
72
+ headers: { authorization: authToken },
73
+ params: { skill },
74
+ });
75
+ request
76
+ .then((response) => {
77
+ resolve(response.data);
78
+ })
79
+ .catch((error) => {
80
+ reject(error);
81
+ });
82
+ });
83
+ };
84
+ /**
85
+ * The skill names the knowledge bases the caller can open suggest while a
86
+ * skill's or skill template's name is typed: the skills their documents were
87
+ * classified with whose name has a word starting with what was typed, in any
88
+ * spelling ("gov" suggests "AI Governance"), one per skill, most documents
89
+ * first. Only what the caller may open counts, as for `getSkillCoverage`.
90
+ * Fewer than 2 characters to match answer no suggestions. Requires
91
+ * VIEW_KNOWLEDGE_BASE; `q` is at most 200 characters (400 otherwise).
92
+ * GET /api/v1/knowledge-base/skill-suggestions
93
+ * @param {String} q What was typed
94
+ * @param {SkillSuggestionParams} params Optional limit, catalog and the id of
95
+ * the skill or skill template being edited
96
+ * @param {String} authToken Authentication token
97
+ * @returns {Promise<SkillSuggestion[]>}
98
+ */
99
+ export const getSkillSuggestions = (q, params, authToken) => {
100
+ return new Promise((resolve, reject) => {
101
+ const request = client.get(`/api/v1/knowledge-base/skill-suggestions`, {
102
+ headers: { authorization: authToken },
103
+ params: { ...params, q },
104
+ });
105
+ request
106
+ .then((response) => {
107
+ resolve(response.data);
108
+ })
109
+ .catch((error) => {
110
+ reject(error);
111
+ });
112
+ });
113
+ };
114
+ /**
115
+ * One of a knowledge base's skills, opened on its page: its microskills, as
116
+ * grouped, each with how many passages teach it, most first, and where the
117
+ * knowledge base's grouping stands (`grouping`). Any spelling of the skill
118
+ * matches. Requires VIEW_KNOWLEDGE_BASE and a role on the knowledge base; the
119
+ * name must be 1 to 200 characters (400 otherwise).
120
+ * GET /api/v1/knowledge-base/:id/skills/micro-skills
121
+ * @param {String} id The knowledge base id
122
+ * @param {String} skill The skill's name
123
+ * @param {String} authToken Authentication token
124
+ * @returns {Promise<KnowledgeBaseMicroSkills>}
125
+ */
126
+ export const listMicroSkills = (id, skill, authToken) => {
127
+ return new Promise((resolve, reject) => {
128
+ const request = client.get(`/api/v1/knowledge-base/${id}/skills/micro-skills`, {
129
+ headers: { authorization: authToken },
130
+ params: { skill },
131
+ });
132
+ request
133
+ .then((response) => {
134
+ resolve(response.data);
135
+ })
136
+ .catch((error) => {
137
+ reject(error);
138
+ });
139
+ });
140
+ };
141
+ /**
142
+ * Where a knowledge base's microskill grouping stands: queued, running or
143
+ * idle, and when the last one ended. What a page polls while a grouping is
144
+ * under way, rather than `listMicroSkills`: the platform reads the knowledge
145
+ * base and nothing else. Requires VIEW_KNOWLEDGE_BASE and a role on the
146
+ * knowledge base.
147
+ * GET /api/v1/knowledge-base/:id/skills/micro-skills/grouping
148
+ * @param {String} id The knowledge base id
149
+ * @param {String} authToken Authentication token
150
+ * @returns {Promise<KnowledgeBaseMicroSkillGrouping>}
151
+ */
152
+ export const getMicroSkillGrouping = (id, authToken) => {
153
+ return new Promise((resolve, reject) => {
154
+ const request = client.get(`/api/v1/knowledge-base/${id}/skills/micro-skills/grouping`, { headers: { authorization: authToken } });
155
+ request
156
+ .then((response) => {
157
+ resolve(response.data);
158
+ })
159
+ .catch((error) => {
160
+ reject(error);
161
+ });
162
+ });
163
+ };
164
+ /**
165
+ * Group now: groups the knowledge base's skills' passage tags into their
166
+ * microskills, in the background. Owner or editor only, as setting how its
167
+ * skills are named (403 otherwise; 404 for no such knowledge base). Asked
168
+ * while a grouping runs, nothing more is asked: the answer is that it is
169
+ * running. `getMicroSkillGrouping` says when it is done (no longer queued or
170
+ * running). The skills whose grouping failed are sent again now.
171
+ * POST /api/v1/knowledge-base/:id/skills/micro-skills/group
172
+ * @param {String} id The knowledge base id
173
+ * @param {String} authToken Authentication token
174
+ * @returns {Promise<KnowledgeBaseMicroSkillGrouping>} Where the grouping
175
+ * stands: queued or running, and when the last one ended
176
+ */
177
+ export const groupMicroSkills = (id, authToken) => {
178
+ return new Promise((resolve, reject) => {
179
+ const request = client.post(`/api/v1/knowledge-base/${id}/skills/micro-skills/group`, {}, { headers: { authorization: authToken } });
180
+ request
181
+ .then((response) => {
182
+ resolve(response.data);
183
+ })
184
+ .catch((error) => {
185
+ reject(error);
186
+ });
187
+ });
188
+ };
189
+ //# sourceMappingURL=skills.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.js","sourceRoot":"","sources":["../../../../src/lib/knowledgeBase/skills.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAsK3C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,EAAU,EACV,MAAuB,EACvB,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,0BAA0B,EAAE,SAAS,EAAE;YAChE,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE;YACrC,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;QACH,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;Y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AC;AACL,CAAC,CAAC"}
@@ -0,0 +1,136 @@
1
+ import type { SkillSettings } from "./skills.js";
2
+ /**
3
+ * What happens to sensitive data found in content: it is masked and the
4
+ * document indexed (`"redact_in_place"`), the document is held for review
5
+ * (`"quarantine"`), or it is refused (`"fail"`). `providerIntegrationId` names
6
+ * a DLP_PROVIDER integration; null falls back to the tenant's default.
7
+ */
8
+ export interface RedactionPolicy {
9
+ behavior: "redact_in_place" | "quarantine" | "fail";
10
+ providerIntegrationId?: string | null;
11
+ }
12
+ /**
13
+ * A connection's configuration, as `addSource` and `updateSource` send it.
14
+ *
15
+ * `skillSettings` and `redactionPolicy` are the connection's — the knowledge
16
+ * base holds neither. Omitted on add, a connection discovers and redacts in
17
+ * place; omitted on update, they are left as they are; null is refused.
18
+ * Setting `redactionPolicy` asks for MANAGE_COMPLIANCE; without it the call is
19
+ * refused (403) and nothing else in the same payload is saved either. Changing
20
+ * `skillSettings` labels that connection's documents again on the sync the
21
+ * save raises. A knowledge base read gives every connection both.
22
+ */
23
+ export interface SourceInput {
24
+ name?: string;
25
+ /** The KB_SOURCE_CONNECTOR integration to sync through. */
26
+ integrationId?: string;
27
+ type?: string | null;
28
+ url?: string;
29
+ /** The connector's own selection rules, or null for none. */
30
+ syncFilters?: object | null;
31
+ /** 1 to 365 days, or null for manual-only. Default 7. */
32
+ syncFrequencyDays?: number | null;
33
+ /** One-time handle for credentials parked at OAuth exchange. */
34
+ authenticationHandle?: string;
35
+ /** `null` clears the stored credentials; omitted leaves them alone. */
36
+ authentication?: object | null;
37
+ /** What labelling looks for in this connection's content. */
38
+ skillSettings?: SkillSettings;
39
+ /** What happens to sensitive data found in it. Needs MANAGE_COMPLIANCE. */
40
+ redactionPolicy?: RedactionPolicy;
41
+ }
42
+ /**
43
+ * List the available KB_SOURCE_CONNECTOR integrations (enabled integrations +
44
+ * capability manifests for the source-creation form).
45
+ * GET /api/v1/knowledge-base/source-connectors
46
+ * @param {String} authToken Authentication token
47
+ * @returns {Promise<object>}
48
+ */
49
+ export declare const listSourceConnectors: (authToken: string) => Promise<object>;
50
+ /**
51
+ * Add a source to a knowledge base (`integrationId` + credentials +
52
+ * `syncFrequencyDays`, default 7). Publishes a kb-source-event (changeType="add").
53
+ * POST /api/v1/knowledge-base/:id/sources
54
+ * @param {String} id The knowledge base id
55
+ * @param {SourceInput} source The source configuration
56
+ * @param {String} authToken Authentication token
57
+ * @returns {Promise<object>}
58
+ */
59
+ export declare const addSource: (id: string, source: SourceInput, authToken: string) => Promise<object>;
60
+ /**
61
+ * Update a knowledge base source. Publishes a kb-source-event per changed source.
62
+ * PUT /api/v1/knowledge-base/:id/sources/:sourceId
63
+ * @param {String} id The knowledge base id
64
+ * @param {String} sourceId The source id
65
+ * @param {SourceInput} source The updated source configuration
66
+ * @param {String} authToken Authentication token
67
+ * @returns {Promise<object>}
68
+ */
69
+ export declare const updateSource: (id: string, sourceId: string, source: SourceInput, authToken: string) => Promise<object>;
70
+ /**
71
+ * Remove a source from a knowledge base. Publishes a kb-source-event
72
+ * (changeType="delete").
73
+ * DELETE /api/v1/knowledge-base/:id/sources/:sourceId
74
+ * @param {String} id The knowledge base id
75
+ * @param {String} sourceId The source id
76
+ * @param {String} authToken Authentication token
77
+ * @returns {Promise<object>}
78
+ */
79
+ export declare const deleteSource: (id: string, sourceId: string, authToken: string) => Promise<object>;
80
+ /**
81
+ * Trigger a manual re-sync of a source. Publishes a kb-source-event
82
+ * (changeType="update", trigger="manual_sync").
83
+ * POST /api/v1/knowledge-base/:id/sources/:sourceId/sync
84
+ * @param {String} id The knowledge base id
85
+ * @param {String} sourceId The source id
86
+ * @param {String} authToken Authentication token
87
+ * @returns {Promise<object>}
88
+ */
89
+ export declare const syncSource: (id: string, sourceId: string, authToken: string) => Promise<object>;
90
+ /**
91
+ * Process every processed document of a source again — classification, labels,
92
+ * chunks and embeddings redone — on a run of the source. Quarantined and blocked
93
+ * documents are left as they are. A run starts now, or a follow-up run is owed
94
+ * while one is outstanding (trigger="reprocess").
95
+ * POST /api/v1/knowledge-base/:id/sources/:sourceId/reprocess
96
+ * @param {String} id The knowledge base id
97
+ * @param {String} sourceId The source id
98
+ * @param {String} authToken Authentication token
99
+ * @returns {Promise<object>} { ok, documents, correlationId, started }: how many
100
+ * documents were marked, the run, and whether it started now
101
+ */
102
+ export declare const reprocessSource: (id: string, sourceId: string, authToken: string) => Promise<object>;
103
+ /**
104
+ * Test a source's connector credentials (dispatches TEST_CONNECTION).
105
+ * POST /api/v1/knowledge-base/:id/sources/:sourceId/test
106
+ * @param {String} id The knowledge base id
107
+ * @param {String} sourceId The source id
108
+ * @param {String} authToken Authentication token
109
+ * @returns {Promise<object>}
110
+ */
111
+ export declare const testSource: (id: string, sourceId: string, authToken: string) => Promise<object>;
112
+ /**
113
+ * List the current user's source-side identities.
114
+ * GET /api/v1/identity/source-mappings
115
+ * @param {String} authToken Authentication token
116
+ * @returns {Promise<object>}
117
+ */
118
+ export declare const listSourceMappings: (authToken: string) => Promise<object>;
119
+ /**
120
+ * Tenant-admin override for a user's source identity mapping.
121
+ * PUT /api/v1/identity/source-mappings/:sourceType
122
+ * @param {String} sourceType The source type key
123
+ * @param {object} data The mapping override
124
+ * @param {String} authToken Authentication token
125
+ * @returns {Promise<object>}
126
+ */
127
+ export declare const updateSourceMapping: (sourceType: string, data: object, authToken: string) => Promise<object>;
128
+ /**
129
+ * Bulk-resolve source principal IDs → tenant users (internal / service-to-service).
130
+ * POST /api/v1/identity/source-mappings/resolve
131
+ * @param {object} data Body carrying the principal IDs to resolve
132
+ * @param {String} authToken Authentication token
133
+ * @returns {Promise<object>}
134
+ */
135
+ export declare const resolveSourceMappings: (data: object, authToken: string) => Promise<object>;
136
+ //# sourceMappingURL=sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../../src/lib/knowledgeBase/sources.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAO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