@stackfactor/client-api 1.1.263 → 1.1.265
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/lib/index.d.ts +1 -0
- package/dist/cjs/lib/index.d.ts.map +1 -1
- package/dist/cjs/lib/index.js +3 -2
- package/dist/cjs/lib/index.js.map +1 -1
- package/dist/cjs/lib/integrations/knowledgeBaseSourceConnectors.d.ts +120 -0
- package/dist/cjs/lib/integrations/knowledgeBaseSourceConnectors.d.ts.map +1 -0
- package/dist/cjs/lib/integrations/knowledgeBaseSourceConnectors.js +112 -0
- package/dist/cjs/lib/integrations/knowledgeBaseSourceConnectors.js.map +1 -0
- package/dist/cjs/lib/knowledgeBase.d.ts +0 -83
- package/dist/cjs/lib/knowledgeBase.d.ts.map +1 -1
- package/dist/cjs/lib/knowledgeBase.js +7 -85
- package/dist/cjs/lib/knowledgeBase.js.map +1 -1
- package/dist/esm/lib/index.d.ts +1 -0
- package/dist/esm/lib/index.d.ts.map +1 -1
- package/dist/esm/lib/index.js +1 -0
- package/dist/esm/lib/index.js.map +1 -1
- package/dist/esm/lib/integrations/knowledgeBaseSourceConnectors.d.ts +120 -0
- package/dist/esm/lib/integrations/knowledgeBaseSourceConnectors.d.ts.map +1 -0
- package/dist/esm/lib/integrations/knowledgeBaseSourceConnectors.js +105 -0
- package/dist/esm/lib/integrations/knowledgeBaseSourceConnectors.js.map +1 -0
- package/dist/esm/lib/knowledgeBase.d.ts +0 -83
- package/dist/esm/lib/knowledgeBase.d.ts.map +1 -1
- package/dist/esm/lib/knowledgeBase.js +6 -81
- package/dist/esm/lib/knowledgeBase.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/lib/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * as integration from "./integration.js";
|
|
|
19
19
|
export * as integrationConfiguration from "./integrationConfiguration.js";
|
|
20
20
|
export * as groups from "./groups.js";
|
|
21
21
|
export * as knowledgeBase from "./knowledgeBase.js";
|
|
22
|
+
export * as knowledgeBaseSourceConnectors from "./integrations/knowledgeBaseSourceConnectors.js";
|
|
22
23
|
export * as labSessions from "./labSessions.js";
|
|
23
24
|
export * as learningContent from "./learningContent.js";
|
|
24
25
|
export * as learningPath from "./learningPath.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,mBAAmB,MAAM,0BAA0B,CAAC;AAChE,OAAO,EACL,MAAM,EACN,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,gBAAgB,MAAM,oCAAoC,CAAC;AACvE,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,wBAAwB,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,aAAa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AAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,4BAA4B,MAAM,qCAAqC,CAAC;AACpF,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC"}
|
package/dist/cjs/lib/index.js
CHANGED
|
@@ -36,8 +36,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
exports.users = exports.userInformation = exports.trainingPlanProficiencyLevel = exports.trainingPlan = exports.tenant = void 0;
|
|
39
|
+
exports.onboarding = exports.standardTemplate = exports.standard = exports.skillTemplate = exports.skillAssessmentTestingSession = exports.skillAssessment = exports.skill = exports.session = exports.security = exports.sdlcProfiles = exports.sdlcEvaluationRuns = exports.sdlcConfigurations = exports.roleTemplate = exports.role = exports.requirementTemplate = exports.requirement = exports.repositoryPipelines = exports.reports = exports.quotas = exports.policyTemplate = exports.policy = exports.microSkillsQuizes = exports.logger = exports.learningPath = exports.learningContent = exports.labSessions = exports.knowledgeBaseSourceConnectors = exports.knowledgeBase = exports.groups = exports.integrationConfiguration = exports.integration = exports.dashboard = exports.customFields = exports.controlTemplate = exports.controlResults = exports.control = exports.contentGenerator = exports.isSocketError = exports.config = exports.address = exports.avatar = exports.billingProfiles = exports.artifactCatalog = exports.aiAssistant = exports.shouldReturnError = exports.getErrorType = exports.getErrorInformation = exports.errorToString = exports.client = exports.actionNotifications = void 0;
|
|
40
|
+
exports.users = exports.userInformation = exports.trainingPlanProficiencyLevel = exports.trainingPlan = exports.tenant = exports.team = void 0;
|
|
41
41
|
exports.actionNotifications = __importStar(require("./actionNotifications.js"));
|
|
42
42
|
var axiosClient_js_1 = require("./axiosClient.js");
|
|
43
43
|
Object.defineProperty(exports, "client", { enumerable: true, get: function () { return axiosClient_js_1.client; } });
|
|
@@ -64,6 +64,7 @@ exports.integration = __importStar(require("./integration.js"));
|
|
|
64
64
|
exports.integrationConfiguration = __importStar(require("./integrationConfiguration.js"));
|
|
65
65
|
exports.groups = __importStar(require("./groups.js"));
|
|
66
66
|
exports.knowledgeBase = __importStar(require("./knowledgeBase.js"));
|
|
67
|
+
exports.knowledgeBaseSourceConnectors = __importStar(require("./integrations/knowledgeBaseSourceConnectors.js"));
|
|
67
68
|
exports.labSessions = __importStar(require("./labSessions.js"));
|
|
68
69
|
exports.learningContent = __importStar(require("./learningContent.js"));
|
|
69
70
|
exports.learningPath = __importStar(require("./learningPath.js"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gFAAgE;AAChE,mDAM0B;AALxB,wGAAA,MAAM,OAAA;AACN,+GAAA,aAAa,OAAA;AACb,qHAAA,mBAAmB,OAAA;AACnB,8GAAA,YAAY,OAAA;AACZ,mHAAA,iBAAiB,OAAA;AAEnB,gEAAgD;AAChD,wEAAwD;AACxD,wEAAwD;AACxD,sDAAsC;AACtC,wDAAwC;AACxC,sDAAsC;AACtC,iDAA+B;AAC/B,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AAEtB,uFAAuE;AACvE,wDAAwC;AACxC,sEAAsD;AACtD,wEAAwD;AACxD,kEAAkD;AAClD,4DAA4C;AAC5C,gEAAgD;AAChD,0FAA0E;AAC1E,sDAAsC;AACtC,oEAAoD;AACpD,gEAAgD;AAChD,wEAAwD;AACxD,kEAAkD;AAClD,sDAAsC;AACtC,4EAA4D;AAC5D,sDAAsC;AACtC,sEAAsD;AACtD,sDAAsC;AACtC,wDAAwC;AACxC,gFAAgE;AAChE,gEAAgD;AAChD,gFAAgE;AAChE,kDAAkC;AAClC,kEAAkD;AAClD,8EAA8D;AAC9D,8EAA8D;AAC9D,kEAAkD;AAClD,0DAA0C;AAC1C,wDAAwC;AACxC,oDAAoC;AACpC,yEAAyD;AACzD,oGAAoF;AACpF,oEAAoD;AACpD,0DAA0C;AAC1C,0EAA0D;AAC1D,8DAA8C;AAC9C,mDAAmC;AACnC,uDAAuC;AACvC,mEAAmD;AACnD,oGAAoF;AACpF,wEAAwD;AACxD,oDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gFAAgE;AAChE,mDAM0B;AALxB,wGAAA,MAAM,OAAA;AACN,+GAAA,aAAa,OAAA;AACb,qHAAA,mBAAmB,OAAA;AACnB,8GAAA,YAAY,OAAA;AACZ,mHAAA,iBAAiB,OAAA;AAEnB,gEAAgD;AAChD,wEAAwD;AACxD,wEAAwD;AACxD,sDAAsC;AACtC,wDAAwC;AACxC,sDAAsC;AACtC,iDAA+B;AAC/B,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AAEtB,uFAAuE;AACvE,wDAAwC;AACxC,sEAAsD;AACtD,wEAAwD;AACxD,kEAAkD;AAClD,4DAA4C;AAC5C,gEAAgD;AAChD,0FAA0E;AAC1E,sDAAsC;AACtC,oEAAoD;AACpD,iHAAiG;AACjG,gEAAgD;AAChD,wEAAwD;AACxD,kEAAkD;AAClD,sDAAsC;AACtC,4EAA4D;AAC5D,sDAAsC;AACtC,sEAAsD;AACtD,sDAAsC;AACtC,wDAAwC;AACxC,gFAAgE;AAChE,gEAAgD;AAChD,gFAAgE;AAChE,kDAAkC;AAClC,kEAAkD;AAClD,8EAA8D;AAC9D,8EAA8D;AAC9D,kEAAkD;AAClD,0DAA0C;AAC1C,wDAAwC;AACxC,oDAAoC;AACpC,yEAAyD;AACzD,oGAAoF;AACpF,oEAAoD;AACpD,0DAA0C;AAC1C,0EAA0D;AAC1D,8DAA8C;AAC9C,mDAAmC;AACnC,uDAAuC;AACvC,mEAAmD;AACnD,oGAAoF;AACpF,wEAAwD;AACxD,oDAAoC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/** One field a connector needs prompting for, within a `SourceConnectorAuthentication`. */
|
|
2
|
+
export interface SourceConnectorAuthenticationField {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
/** Render hint — currently always "string". */
|
|
6
|
+
type: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
required: boolean;
|
|
9
|
+
/** True for credential values, which must be masked on input. */
|
|
10
|
+
secret: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** One way of connecting, as advertised by a connector. */
|
|
13
|
+
export interface SourceConnectorAuthentication {
|
|
14
|
+
/** Stable key, echoed as `authenticationId` by the authentication flow. */
|
|
15
|
+
id: string;
|
|
16
|
+
/** e.g. "oauth2" | "apiToken" | "clientCredentials". */
|
|
17
|
+
type: string;
|
|
18
|
+
name: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
isDefault: boolean;
|
|
21
|
+
fields: SourceConnectorAuthenticationField[];
|
|
22
|
+
}
|
|
23
|
+
/** One comparison a field supports, as the connector declares it. */
|
|
24
|
+
export interface SourceConnectorFilterOperator {
|
|
25
|
+
/** Shown in the operator dropdown, e.g. "On or before". */
|
|
26
|
+
label: string;
|
|
27
|
+
/** Sent back when the filter is applied, e.g. "onOrBefore". */
|
|
28
|
+
value: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A field a source may be narrowed by. `type` is "string" | "number" | "date".
|
|
32
|
+
*
|
|
33
|
+
* `operators` is per FIELD, not per type: they follow what the source's own query
|
|
34
|
+
* language allows, so a Confluence text field offers `contains` while a Graph one
|
|
35
|
+
* does not. Never assume a fixed set from `type`.
|
|
36
|
+
*/
|
|
37
|
+
export interface SourceConnectorFilter {
|
|
38
|
+
field: string;
|
|
39
|
+
type: string;
|
|
40
|
+
operators: SourceConnectorFilterOperator[];
|
|
41
|
+
}
|
|
42
|
+
/** What a connector accepts — the response of `getConfiguration`. */
|
|
43
|
+
export interface SourceConnectorConfiguration {
|
|
44
|
+
authentications: SourceConnectorAuthentication[];
|
|
45
|
+
filters: SourceConnectorFilter[];
|
|
46
|
+
}
|
|
47
|
+
/** Per-content-type breakdown within `SourceConnectorStats`. */
|
|
48
|
+
export interface SourceConnectorStatsDetail {
|
|
49
|
+
/** e.g. "text" | "image" | "video". */
|
|
50
|
+
type: string;
|
|
51
|
+
count: number;
|
|
52
|
+
size: number;
|
|
53
|
+
}
|
|
54
|
+
/** Volume reachable with a set of credentials — the response of `getStats`. */
|
|
55
|
+
export interface SourceConnectorStats {
|
|
56
|
+
count: number;
|
|
57
|
+
/** Total bytes. */
|
|
58
|
+
size: number;
|
|
59
|
+
details: SourceConnectorStatsDetail[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Ask a connector to describe its own contract: the authentication methods it
|
|
63
|
+
* accepts and the fields a source may be filtered by. Sent with no payload — the
|
|
64
|
+
* answer depends only on which connector it is.
|
|
65
|
+
* GET /api/v1/exceed/knowledgebasesourceconnectors/:id/configuration
|
|
66
|
+
* @param {String} connectionId The connection id (an `integrationId` from `knowledgeBase.listSourceConnectors`)
|
|
67
|
+
* @param {String} authToken Authentication token
|
|
68
|
+
* @returns {Promise<object>} A `SourceConnectorConfiguration`
|
|
69
|
+
*/
|
|
70
|
+
export declare const getConfiguration: (connectionId: string, authToken: string) => Promise<object>;
|
|
71
|
+
/**
|
|
72
|
+
* Ask a connector how the user should be walked through linking their account at
|
|
73
|
+
* the source. Returns the guidance to follow — an authorization URL, and the
|
|
74
|
+
* single-use `state` the backend minted for this attempt. This STARTS the flow.
|
|
75
|
+
*
|
|
76
|
+
* The connector decides WHICH scheme applies, which is why the caller asks rather
|
|
77
|
+
* than tells. But the caller must supply `redirectUri`: the connector answers the
|
|
78
|
+
* same way wherever the platform is running, and providers match that value by
|
|
79
|
+
* exact string.
|
|
80
|
+
* POST /api/v1/exceed/knowledgebasesourceconnectors/:id/authentication-flow
|
|
81
|
+
* @param {String} connectionId The connection id (an `integrationId` from `knowledgeBase.listSourceConnectors`)
|
|
82
|
+
* @param {String} redirectUri Where the browser will return, e.g. `${origin}/callback`
|
|
83
|
+
* @param {String} authToken Authentication token
|
|
84
|
+
* @returns {Promise<object>}
|
|
85
|
+
*/
|
|
86
|
+
export declare const initiateAuthenticationFlow: (connectionId: string, redirectUri: string, authToken: string) => Promise<object>;
|
|
87
|
+
/**
|
|
88
|
+
* Finish linking an account: exchange the authorization code the provider
|
|
89
|
+
* returned for the connection itself.
|
|
90
|
+
*
|
|
91
|
+
* Call this the moment the callback reports back. The code is single-use and
|
|
92
|
+
* expires within minutes, so holding it until the source is saved would fail at
|
|
93
|
+
* exactly the point the user commits.
|
|
94
|
+
*
|
|
95
|
+
* What comes back is a HANDLE, never the credentials — those stay server-side
|
|
96
|
+
* until a source exists to own them, and are then written to the vault. Pass the
|
|
97
|
+
* handle as `authenticationHandle` when creating the source.
|
|
98
|
+
* POST /api/v1/exceed/knowledgebasesourceconnectors/:id/authentication-flow/complete
|
|
99
|
+
* @param {String} connectionId The connection id
|
|
100
|
+
* @param {String} code The authorization code from the provider
|
|
101
|
+
* @param {String} state The state echoed back, as minted by `initiateAuthenticationFlow`
|
|
102
|
+
* @param {String} authToken Authentication token
|
|
103
|
+
* @returns {Promise<object>} `{ handle, displayName }`
|
|
104
|
+
*/
|
|
105
|
+
export declare const completeAuthenticationFlow: (connectionId: string, code: string, state: string, authToken: string) => Promise<object>;
|
|
106
|
+
/**
|
|
107
|
+
* Ask a connector how much content the supplied credentials can reach — the
|
|
108
|
+
* volume preview shown before a source is created.
|
|
109
|
+
*
|
|
110
|
+
* POST rather than GET because the credentials travel in the body and must not
|
|
111
|
+
* reach a URL, an access log, or browser history.
|
|
112
|
+
* POST /api/v1/exceed/knowledgebasesourceconnectors/:id/stats
|
|
113
|
+
* @param {String} connectionId The connection id (an `integrationId` from `knowledgeBase.listSourceConnectors`)
|
|
114
|
+
* @param {object} authentication Credentials, shaped by the chosen `SourceConnectorAuthentication`
|
|
115
|
+
* @param {String} authToken Authentication token
|
|
116
|
+
* @param {object} filters Optional filters over the fields `getConfiguration` advertises
|
|
117
|
+
* @returns {Promise<object>} A `SourceConnectorStats`
|
|
118
|
+
*/
|
|
119
|
+
export declare const getStats: (connectionId: string, authentication: object, authToken: string, filters?: object | null) => Promise<object>;
|
|
120
|
+
//# sourceMappingURL=knowledgeBaseSourceConnectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledgeBaseSourceConnectors.d.ts","sourceRoot":"","sources":["../../../../src/lib/integrations/knowledgeBaseSourceConnectors.ts"],"names":[],"mappings":"AAsBA,2FAA2F;AAC3F,MAAM,WAAW,kCAAkC;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,2DAA2D;AAC3D,MAAM,WAAW,6BAA6B;IAC5C,2EAA2E;IAC3E,EAAE,EAAE,MAAM,CAAC;IACX,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,kCAAkC,EAAE,CAAC;CAC9C;AAED,qEAAqE;AACrE,MAAM,WAAW,6BAA6B;IAC5C,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;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@@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStats = exports.completeAuthenticationFlow = exports.initiateAuthenticationFlow = exports.getConfiguration = void 0;
|
|
4
|
+
const axiosClient_js_1 = require("../axiosClient.js");
|
|
5
|
+
/**
|
|
6
|
+
* Ask a connector to describe its own contract: the authentication methods it
|
|
7
|
+
* accepts and the fields a source may be filtered by. Sent with no payload — the
|
|
8
|
+
* answer depends only on which connector it is.
|
|
9
|
+
* GET /api/v1/exceed/knowledgebasesourceconnectors/:id/configuration
|
|
10
|
+
* @param {String} connectionId The connection id (an `integrationId` from `knowledgeBase.listSourceConnectors`)
|
|
11
|
+
* @param {String} authToken Authentication token
|
|
12
|
+
* @returns {Promise<object>} A `SourceConnectorConfiguration`
|
|
13
|
+
*/
|
|
14
|
+
const getConfiguration = (connectionId, authToken) => {
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
const request = axiosClient_js_1.client.get(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/configuration`, { headers: { authorization: authToken } });
|
|
17
|
+
request
|
|
18
|
+
.then((response) => {
|
|
19
|
+
resolve(response.data);
|
|
20
|
+
})
|
|
21
|
+
.catch((error) => {
|
|
22
|
+
reject(error);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
exports.getConfiguration = getConfiguration;
|
|
27
|
+
/**
|
|
28
|
+
* Ask a connector how the user should be walked through linking their account at
|
|
29
|
+
* the source. Returns the guidance to follow — an authorization URL, and the
|
|
30
|
+
* single-use `state` the backend minted for this attempt. This STARTS the flow.
|
|
31
|
+
*
|
|
32
|
+
* The connector decides WHICH scheme applies, which is why the caller asks rather
|
|
33
|
+
* than tells. But the caller must supply `redirectUri`: the connector answers the
|
|
34
|
+
* same way wherever the platform is running, and providers match that value by
|
|
35
|
+
* exact string.
|
|
36
|
+
* POST /api/v1/exceed/knowledgebasesourceconnectors/:id/authentication-flow
|
|
37
|
+
* @param {String} connectionId The connection id (an `integrationId` from `knowledgeBase.listSourceConnectors`)
|
|
38
|
+
* @param {String} redirectUri Where the browser will return, e.g. `${origin}/callback`
|
|
39
|
+
* @param {String} authToken Authentication token
|
|
40
|
+
* @returns {Promise<object>}
|
|
41
|
+
*/
|
|
42
|
+
const initiateAuthenticationFlow = (connectionId, redirectUri, authToken) => {
|
|
43
|
+
return new Promise((resolve, reject) => {
|
|
44
|
+
const request = axiosClient_js_1.client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/authentication-flow`, { redirectUri }, { headers: { authorization: authToken } });
|
|
45
|
+
request
|
|
46
|
+
.then((response) => {
|
|
47
|
+
resolve(response.data);
|
|
48
|
+
})
|
|
49
|
+
.catch((error) => {
|
|
50
|
+
reject(error);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
exports.initiateAuthenticationFlow = initiateAuthenticationFlow;
|
|
55
|
+
/**
|
|
56
|
+
* Finish linking an account: exchange the authorization code the provider
|
|
57
|
+
* returned for the connection itself.
|
|
58
|
+
*
|
|
59
|
+
* Call this the moment the callback reports back. The code is single-use and
|
|
60
|
+
* expires within minutes, so holding it until the source is saved would fail at
|
|
61
|
+
* exactly the point the user commits.
|
|
62
|
+
*
|
|
63
|
+
* What comes back is a HANDLE, never the credentials — those stay server-side
|
|
64
|
+
* until a source exists to own them, and are then written to the vault. Pass the
|
|
65
|
+
* handle as `authenticationHandle` when creating the source.
|
|
66
|
+
* POST /api/v1/exceed/knowledgebasesourceconnectors/:id/authentication-flow/complete
|
|
67
|
+
* @param {String} connectionId The connection id
|
|
68
|
+
* @param {String} code The authorization code from the provider
|
|
69
|
+
* @param {String} state The state echoed back, as minted by `initiateAuthenticationFlow`
|
|
70
|
+
* @param {String} authToken Authentication token
|
|
71
|
+
* @returns {Promise<object>} `{ handle, displayName }`
|
|
72
|
+
*/
|
|
73
|
+
const completeAuthenticationFlow = (connectionId, code, state, authToken) => {
|
|
74
|
+
return new Promise((resolve, reject) => {
|
|
75
|
+
const request = axiosClient_js_1.client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/authentication-flow/complete`, { code, state }, { headers: { authorization: authToken } });
|
|
76
|
+
request
|
|
77
|
+
.then((response) => {
|
|
78
|
+
resolve(response.data);
|
|
79
|
+
})
|
|
80
|
+
.catch((error) => {
|
|
81
|
+
reject(error);
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
exports.completeAuthenticationFlow = completeAuthenticationFlow;
|
|
86
|
+
/**
|
|
87
|
+
* Ask a connector how much content the supplied credentials can reach — the
|
|
88
|
+
* volume preview shown before a source is created.
|
|
89
|
+
*
|
|
90
|
+
* POST rather than GET because the credentials travel in the body and must not
|
|
91
|
+
* reach a URL, an access log, or browser history.
|
|
92
|
+
* POST /api/v1/exceed/knowledgebasesourceconnectors/:id/stats
|
|
93
|
+
* @param {String} connectionId The connection id (an `integrationId` from `knowledgeBase.listSourceConnectors`)
|
|
94
|
+
* @param {object} authentication Credentials, shaped by the chosen `SourceConnectorAuthentication`
|
|
95
|
+
* @param {String} authToken Authentication token
|
|
96
|
+
* @param {object} filters Optional filters over the fields `getConfiguration` advertises
|
|
97
|
+
* @returns {Promise<object>} A `SourceConnectorStats`
|
|
98
|
+
*/
|
|
99
|
+
const getStats = (connectionId, authentication, authToken, filters = null) => {
|
|
100
|
+
return new Promise((resolve, reject) => {
|
|
101
|
+
const request = axiosClient_js_1.client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/stats`, { authentication, ...(filters ? { filters } : {}) }, { headers: { authorization: authToken } });
|
|
102
|
+
request
|
|
103
|
+
.then((response) => {
|
|
104
|
+
resolve(response.data);
|
|
105
|
+
})
|
|
106
|
+
.catch((error) => {
|
|
107
|
+
reject(error);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
exports.getStats = getStats;
|
|
112
|
+
//# sourceMappingURL=knowledgeBaseSourceConnectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledgeBaseSourceConnectors.js","sourceRoot":"","sources":["../../../../src/lib/integrations/knowledgeBaseSourceConnectors.ts"],"names":[],"mappings":";;;AACA,sDAA2C;AAwF3C;;;;;;;;GAQG;AACI,MAAM,gBAAgB,GAAG,CAC9B,YAAoB,EACpB,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,uBAAM,CAAC,GAAG,CACxB,gDAAgD,YAAY,gBAAgB,EAC5E,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,CAC1C,CAAC;QACF,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;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAjBW,QAAA,gBAAgB,oBAiB3B;AAEF;;;;;;;;;;;;;;GAcG;AACI,MAAM,0BAA0B,GAAG,CACxC,YAAoB,EACpB,WAAmB,EACnB,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,uBAAM,CAAC,IAAI,CACzB,gDAAgD,YAAY,sBAAsB,EAClF,EAAE,WAAW,EAAE,EACf,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,CAC1C,CAAC;QACF,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,K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AAa,EAAE,SAAS,EAAE,EAAE,CAC1C,CAAC;QACF,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;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AApBW,QAAA,QAAQ,YAoBnB"}
|
|
@@ -26,52 +26,6 @@ export interface DocumentListParams {
|
|
|
26
26
|
/** One of `KNOWLEDGE_BASE.DOCUMENT_STATUS`. */
|
|
27
27
|
status?: number;
|
|
28
28
|
}
|
|
29
|
-
/** One field a connector needs prompting for, within an `SourceConnectorAuthentication`. */
|
|
30
|
-
export interface SourceConnectorAuthenticationField {
|
|
31
|
-
name: string;
|
|
32
|
-
label: string;
|
|
33
|
-
/** Render hint — currently always "string". */
|
|
34
|
-
type: string;
|
|
35
|
-
placeholder?: string;
|
|
36
|
-
required: boolean;
|
|
37
|
-
/** True for credential values, which must be masked on input. */
|
|
38
|
-
secret: boolean;
|
|
39
|
-
}
|
|
40
|
-
/** One way of connecting, as advertised by a connector. */
|
|
41
|
-
export interface SourceConnectorAuthentication {
|
|
42
|
-
/** Stable key, echoed as `authenticationId` by the authentication flow. */
|
|
43
|
-
id: string;
|
|
44
|
-
/** e.g. "oauth2" | "apiToken" | "clientCredentials". */
|
|
45
|
-
type: string;
|
|
46
|
-
name: string;
|
|
47
|
-
description?: string;
|
|
48
|
-
isDefault: boolean;
|
|
49
|
-
fields: SourceConnectorAuthenticationField[];
|
|
50
|
-
}
|
|
51
|
-
/** A field a source may be narrowed by. `type` is "string" | "number" | "date". */
|
|
52
|
-
export interface SourceConnectorFilter {
|
|
53
|
-
field: string;
|
|
54
|
-
type: string;
|
|
55
|
-
}
|
|
56
|
-
/** What a connector accepts — the response of `getSourceConnectorConfiguration`. */
|
|
57
|
-
export interface SourceConnectorConfiguration {
|
|
58
|
-
authentications: SourceConnectorAuthentication[];
|
|
59
|
-
filters: SourceConnectorFilter[];
|
|
60
|
-
}
|
|
61
|
-
/** Per-content-type breakdown within `SourceConnectorStats`. */
|
|
62
|
-
export interface SourceConnectorStatsDetail {
|
|
63
|
-
/** e.g. "text" | "image" | "video". */
|
|
64
|
-
type: string;
|
|
65
|
-
count: number;
|
|
66
|
-
size: number;
|
|
67
|
-
}
|
|
68
|
-
/** Volume reachable with a set of credentials — the response of `getSourceConnectorStats`. */
|
|
69
|
-
export interface SourceConnectorStats {
|
|
70
|
-
count: number;
|
|
71
|
-
/** Total bytes. */
|
|
72
|
-
size: number;
|
|
73
|
-
details: SourceConnectorStatsDetail[];
|
|
74
|
-
}
|
|
75
29
|
/**
|
|
76
30
|
* List the knowledge bases the caller can see.
|
|
77
31
|
* GET /api/v1/knowledge-base
|
|
@@ -122,43 +76,6 @@ export declare const deleteKnowledgeBase: (id: string, authToken: string) => Pro
|
|
|
122
76
|
* @returns {Promise<object>}
|
|
123
77
|
*/
|
|
124
78
|
export declare const listSourceConnectors: (authToken: string) => Promise<object>;
|
|
125
|
-
/**
|
|
126
|
-
* Ask a connector to describe its own contract: the authentication methods it
|
|
127
|
-
* accepts and the fields a source may be filtered by. Sent with no payload — the
|
|
128
|
-
* answer depends only on which connector it is.
|
|
129
|
-
* GET /api/v1/exceed/knowledgebasesourceconnectors/:id/configuration
|
|
130
|
-
* @param {String} connectionId The connection id (an `integrationId` from `listSourceConnectors`)
|
|
131
|
-
* @param {String} authToken Authentication token
|
|
132
|
-
* @returns {Promise<object>} A `SourceConnectorConfiguration`
|
|
133
|
-
*/
|
|
134
|
-
export declare const getSourceConnectorConfiguration: (connectionId: string, authToken: string) => Promise<object>;
|
|
135
|
-
/**
|
|
136
|
-
* Ask a connector how the user should be walked through linking their account at
|
|
137
|
-
* the source. Returns the guidance to follow (e.g. an authorization URL plus the
|
|
138
|
-
* state to echo back). This STARTS the flow; it does not complete it.
|
|
139
|
-
*
|
|
140
|
-
* Takes no payload by design: the caller does not know which authentication
|
|
141
|
-
* scheme a given connector speaks, so the connector answers unprompted.
|
|
142
|
-
* POST /api/v1/exceed/knowledgebasesourceconnectors/:id/authentication-flow
|
|
143
|
-
* @param {String} connectionId The connection id (an `integrationId` from `listSourceConnectors`)
|
|
144
|
-
* @param {String} authToken Authentication token
|
|
145
|
-
* @returns {Promise<object>}
|
|
146
|
-
*/
|
|
147
|
-
export declare const initiateSourceConnectorAuthentication: (connectionId: string, authToken: string) => Promise<object>;
|
|
148
|
-
/**
|
|
149
|
-
* Ask a connector how much content the supplied credentials can reach — the
|
|
150
|
-
* volume preview shown before a source is created.
|
|
151
|
-
*
|
|
152
|
-
* POST rather than GET because the credentials travel in the body and must not
|
|
153
|
-
* reach a URL, an access log, or browser history.
|
|
154
|
-
* POST /api/v1/exceed/knowledgebasesourceconnectors/:id/stats
|
|
155
|
-
* @param {String} connectionId The connection id (an `integrationId` from `listSourceConnectors`)
|
|
156
|
-
* @param {object} authentication Credentials, shaped by the chosen `SourceConnectorAuthentication`
|
|
157
|
-
* @param {String} authToken Authentication token
|
|
158
|
-
* @param {object} filters Optional filters over the fields `getSourceConnectorConfiguration` advertises
|
|
159
|
-
* @returns {Promise<object>} A `SourceConnectorStats`
|
|
160
|
-
*/
|
|
161
|
-
export declare const getSourceConnectorStats: (connectionId: string, authentication: object, authToken: string, filters?: object | null) => Promise<object>;
|
|
162
79
|
/**
|
|
163
80
|
* Add a source to a knowledge base (`integrationId` + credentials +
|
|
164
81
|
* `syncFrequencyDays`, default 7). Publishes a kb-source-event (changeType="add").
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledgeBase.d.ts","sourceRoot":"","sources":["../../../src/lib/knowledgeBase.ts"],"names":[],"mappings":"AAgBA,8DAA8D;AAC9D,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,C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Y,MAAM,EAClB,MAAM,MAAM,EACZ,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAC9B,gBAAgB,MAAM,EACtB,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC;AAKF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,WAAW,MAAM,KAAG,OAAO,CAAC,MAAM,CAapE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAC9B,YAAY,MAAM,EAClB,MAAM,MAAM,EACZ,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAChC,MAAM,MAAM,EACZ,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
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.releaseQuarantine = exports.listQuarantine = exports.getReviewOverview = exports.rightToBeForgotten = exports.updateComplianceProfile = exports.getComplianceProfile = exports.updateRedactionPolicy = exports.getRedactionPolicy = exports.revokeAccess = exports.grantAccess = exports.listAccess = exports.deleteDocument = exports.listDocuments = exports.testSource = exports.syncSource = exports.deleteSource = exports.updateSource = exports.addSource = exports.
|
|
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.releaseQuarantine = exports.listQuarantine = exports.getReviewOverview = exports.rightToBeForgotten = exports.updateComplianceProfile = exports.getComplianceProfile = exports.updateRedactionPolicy = exports.getRedactionPolicy = exports.revokeAccess = exports.grantAccess = exports.listAccess = exports.deleteDocument = exports.listDocuments = exports.testSource = exports.syncSource = exports.deleteSource = exports.updateSource = exports.addSource = exports.listSourceConnectors = exports.deleteKnowledgeBase = exports.updateKnowledgeBase = exports.getKnowledgeBase = exports.createKnowledgeBase = exports.listKnowledgeBases = void 0;
|
|
4
4
|
const axiosClient_js_1 = require("./axiosClient.js");
|
|
5
5
|
// ── Knowledge Base CRUD ───────────────────────────────────────────────────────
|
|
6
6
|
/**
|
|
@@ -139,91 +139,13 @@ const listSourceConnectors = (authToken) => {
|
|
|
139
139
|
};
|
|
140
140
|
exports.listSourceConnectors = listSourceConnectors;
|
|
141
141
|
//
|
|
142
|
-
//
|
|
143
|
-
//
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
//
|
|
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).
|
|
147
148
|
//
|
|
148
|
-
// listSourceConnectors
|
|
149
|
-
// -> getSourceConnectorConfiguration what does it accept?
|
|
150
|
-
// -> initiateSourceConnectorAuthentication how does the user sign in?
|
|
151
|
-
// -> getSourceConnectorStats how much is behind those credentials?
|
|
152
|
-
// -> addSource create it
|
|
153
|
-
//
|
|
154
|
-
/**
|
|
155
|
-
* Ask a connector to describe its own contract: the authentication methods it
|
|
156
|
-
* accepts and the fields a source may be filtered by. Sent with no payload — the
|
|
157
|
-
* answer depends only on which connector it is.
|
|
158
|
-
* GET /api/v1/exceed/knowledgebasesourceconnectors/:id/configuration
|
|
159
|
-
* @param {String} connectionId The connection id (an `integrationId` from `listSourceConnectors`)
|
|
160
|
-
* @param {String} authToken Authentication token
|
|
161
|
-
* @returns {Promise<object>} A `SourceConnectorConfiguration`
|
|
162
|
-
*/
|
|
163
|
-
const getSourceConnectorConfiguration = (connectionId, authToken) => {
|
|
164
|
-
return new Promise((resolve, reject) => {
|
|
165
|
-
const request = axiosClient_js_1.client.get(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/configuration`, { headers: { authorization: authToken } });
|
|
166
|
-
request
|
|
167
|
-
.then((response) => {
|
|
168
|
-
resolve(response.data);
|
|
169
|
-
})
|
|
170
|
-
.catch((error) => {
|
|
171
|
-
reject(error);
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
};
|
|
175
|
-
exports.getSourceConnectorConfiguration = getSourceConnectorConfiguration;
|
|
176
|
-
/**
|
|
177
|
-
* Ask a connector how the user should be walked through linking their account at
|
|
178
|
-
* the source. Returns the guidance to follow (e.g. an authorization URL plus the
|
|
179
|
-
* state to echo back). This STARTS the flow; it does not complete it.
|
|
180
|
-
*
|
|
181
|
-
* Takes no payload by design: the caller does not know which authentication
|
|
182
|
-
* scheme a given connector speaks, so the connector answers unprompted.
|
|
183
|
-
* POST /api/v1/exceed/knowledgebasesourceconnectors/:id/authentication-flow
|
|
184
|
-
* @param {String} connectionId The connection id (an `integrationId` from `listSourceConnectors`)
|
|
185
|
-
* @param {String} authToken Authentication token
|
|
186
|
-
* @returns {Promise<object>}
|
|
187
|
-
*/
|
|
188
|
-
const initiateSourceConnectorAuthentication = (connectionId, authToken) => {
|
|
189
|
-
return new Promise((resolve, reject) => {
|
|
190
|
-
const request = axiosClient_js_1.client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/authentication-flow`, {}, { headers: { authorization: authToken } });
|
|
191
|
-
request
|
|
192
|
-
.then((response) => {
|
|
193
|
-
resolve(response.data);
|
|
194
|
-
})
|
|
195
|
-
.catch((error) => {
|
|
196
|
-
reject(error);
|
|
197
|
-
});
|
|
198
|
-
});
|
|
199
|
-
};
|
|
200
|
-
exports.initiateSourceConnectorAuthentication = initiateSourceConnectorAuthentication;
|
|
201
|
-
/**
|
|
202
|
-
* Ask a connector how much content the supplied credentials can reach — the
|
|
203
|
-
* volume preview shown before a source is created.
|
|
204
|
-
*
|
|
205
|
-
* POST rather than GET because the credentials travel in the body and must not
|
|
206
|
-
* reach a URL, an access log, or browser history.
|
|
207
|
-
* POST /api/v1/exceed/knowledgebasesourceconnectors/:id/stats
|
|
208
|
-
* @param {String} connectionId The connection id (an `integrationId` from `listSourceConnectors`)
|
|
209
|
-
* @param {object} authentication Credentials, shaped by the chosen `SourceConnectorAuthentication`
|
|
210
|
-
* @param {String} authToken Authentication token
|
|
211
|
-
* @param {object} filters Optional filters over the fields `getSourceConnectorConfiguration` advertises
|
|
212
|
-
* @returns {Promise<object>} A `SourceConnectorStats`
|
|
213
|
-
*/
|
|
214
|
-
const getSourceConnectorStats = (connectionId, authentication, authToken, filters = null) => {
|
|
215
|
-
return new Promise((resolve, reject) => {
|
|
216
|
-
const request = axiosClient_js_1.client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/stats`, { authentication, ...(filters ? { filters } : {}) }, { headers: { authorization: authToken } });
|
|
217
|
-
request
|
|
218
|
-
.then((response) => {
|
|
219
|
-
resolve(response.data);
|
|
220
|
-
})
|
|
221
|
-
.catch((error) => {
|
|
222
|
-
reject(error);
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
};
|
|
226
|
-
exports.getSourceConnectorStats = getSourceConnectorStats;
|
|
227
149
|
/**
|
|
228
150
|
* Add a source to a knowledge base (`integrationId` + credentials +
|
|
229
151
|
* `syncFrequencyDays`, default 7). Publishes a kb-source-event (changeType="add").
|