@stackfactor/client-api 1.1.264 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,10 +20,24 @@ export interface SourceConnectorAuthentication {
20
20
  isDefault: boolean;
21
21
  fields: SourceConnectorAuthenticationField[];
22
22
  }
23
- /** A field a source may be narrowed by. `type` is "string" | "number" | "date". */
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
+ */
24
37
  export interface SourceConnectorFilter {
25
38
  field: string;
26
39
  type: string;
40
+ operators: SourceConnectorFilterOperator[];
27
41
  }
28
42
  /** What a connector accepts — the response of `getConfiguration`. */
29
43
  export interface SourceConnectorConfiguration {
@@ -56,29 +70,71 @@ export interface SourceConnectorStats {
56
70
  export declare const getConfiguration: (connectionId: string, authToken: string) => Promise<object>;
57
71
  /**
58
72
  * Ask a connector how the user should be walked through linking their account at
59
- * the source. Returns the guidance to follow (e.g. an authorization URL plus the
60
- * state to echo back). This STARTS the flow; it does not complete it.
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 two things the connector cannot know:
78
+ *
79
+ * redirectUri the connector answers the same way wherever the platform is
80
+ * running, and providers match this value by exact string.
81
+ * url where the source points. This shapes the authorize request
82
+ * itself — Confluence picks its cloudId from it and SharePoint
83
+ * decides which tenant issues the token — so collect the URL from
84
+ * the user BEFORE offering to connect. Signing in first and asking
85
+ * where second risks a token for the wrong place.
61
86
  *
62
- * Takes no payload by design: the caller does not know which authentication
63
- * scheme a given connector speaks, so the connector answers unprompted.
87
+ * The url is also what the resulting credentials get tied to: saving them onto a
88
+ * source that points somewhere else is refused.
64
89
  * POST /api/v1/exceed/knowledgebasesourceconnectors/:id/authentication-flow
65
90
  * @param {String} connectionId The connection id (an `integrationId` from `knowledgeBase.listSourceConnectors`)
91
+ * @param {String} redirectUri Where the browser will return, e.g. `${origin}/callback`
92
+ * @param {String} url Where the source points — required
66
93
  * @param {String} authToken Authentication token
67
94
  * @returns {Promise<object>}
68
95
  */
69
- export declare const initiateAuthenticationFlow: (connectionId: string, authToken: string) => Promise<object>;
96
+ export declare const initiateAuthenticationFlow: (connectionId: string, redirectUri: string, url: string, authToken: string) => Promise<object>;
70
97
  /**
71
- * Ask a connector how much content the supplied credentials can reach — the
72
- * volume preview shown before a source is created.
98
+ * Finish linking an account: exchange the authorization code the provider
99
+ * returned for the connection itself.
100
+ *
101
+ * Call this the moment the callback reports back. The code is single-use and
102
+ * expires within minutes, so holding it until the source is saved would fail at
103
+ * exactly the point the user commits.
104
+ *
105
+ * What comes back is a HANDLE, never the credentials — those stay server-side
106
+ * until a source exists to own them, and are then written to the vault. Pass the
107
+ * handle as `authenticationHandle` when creating the source.
108
+ * POST /api/v1/exceed/knowledgebasesourceconnectors/:id/authentication-flow/complete
109
+ * @param {String} connectionId The connection id
110
+ * @param {String} code The authorization code from the provider
111
+ * @param {String} state The state echoed back, as minted by `initiateAuthenticationFlow`
112
+ * @param {String} authToken Authentication token
113
+ * @returns {Promise<object>} `{ handle, displayName }`
114
+ */
115
+ export declare const completeAuthenticationFlow: (connectionId: string, code: string, state: string, authToken: string) => Promise<object>;
116
+ /**
117
+ * Ask a connector how much content the supplied credentials can reach AT A GIVEN
118
+ * LOCATION — the volume preview shown before a source is created.
119
+ *
120
+ * This doubles as the reachability check. Signing in proves the person has an
121
+ * account; it proves nothing about whether they can read the specific site or
122
+ * space they typed. Credentials that cannot see `url` answer with an error or
123
+ * with nothing, so the user finds out here rather than at the first ingestion.
124
+ *
125
+ * `url` is required, and counts come back scoped to it. Calling without one is
126
+ * not "unscoped" so much as wrong: the answer would describe everything the
127
+ * account can reach, which is rarely what is about to be ingested.
73
128
  *
74
129
  * POST rather than GET because the credentials travel in the body and must not
75
130
  * reach a URL, an access log, or browser history.
76
131
  * POST /api/v1/exceed/knowledgebasesourceconnectors/:id/stats
77
132
  * @param {String} connectionId The connection id (an `integrationId` from `knowledgeBase.listSourceConnectors`)
78
133
  * @param {object} authentication Credentials, shaped by the chosen `SourceConnectorAuthentication`
134
+ * @param {String} url Where the source points — required, and what the count is scoped to
79
135
  * @param {String} authToken Authentication token
80
136
  * @param {object} filters Optional filters over the fields `getConfiguration` advertises
81
137
  * @returns {Promise<object>} A `SourceConnectorStats`
82
138
  */
83
- export declare const getStats: (connectionId: string, authentication: object, authToken: string, filters?: object | null) => Promise<object>;
139
+ export declare const getStats: (connectionId: string, authentication: object, url: string, authToken: string, filters?: object | null) => Promise<object>;
84
140
  //# sourceMappingURL=knowledgeBaseSourceConnectors.d.ts.map
@@ -1 +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,mFAAmF;AACnF,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qEAAqE;AACrE,MAAM,WAAW,4BAA4B;IAC3C,eAAe,EAAE,6BAA6B,EAAE,CAAC;IACjD,OAAO,EAAE,qBAAqB,EAAE,CAAC;CAClC;AAED,gEAAgE;AAChE,MAAM,WAAW,0BAA0B;IACzC,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,+EAA+E;AAC/E,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,0BAA0B,EAAE,CAAC;CACvC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAC3B,cAAc,MAAM,EACpB,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAchB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,GACrC,cAAc,MAAM,EACpB,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,GACnB,cAAc,MAAM,EACpB,gBAAgB,MAAM,EACtB,WAAW,MAAM,EACjB,UAAS,MAAM,GAAG,IAAW,KAC5B,OAAO,CAAC,MAAM,CAehB,CAAC"}
1
+ {"version":3,"file":"knowledgeBaseSourceConnectors.d.ts","sourceRoot":"","sources":["../../../../src/lib/integrations/knowledgeBaseSourceConnectors.ts"],"names":[],"mappings":"AAsBA,2FAA2F;AAC3F,MAAM,WAAW,k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eAAO,MAAM,gBAAgB,GAC3B,cAAc,MAAM,EACpB,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAchB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,0BAA0B,GACrC,cAAc,MAAM,EACpB,aAAa,MAAM,EACnB,KAAK,MAAM,EACX,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,0BAA0B,GACrC,cAAc,MAAM,EACpB,MAAM,MAAM,EACZ,OAAO,MAAM,EACb,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,QAAQ,GACnB,cAAc,MAAM,EACpB,gBAAgB,MAAM,EACtB,KAAK,MAAM,EACX,WAAW,MAAM,EACjB,UAAS,MAAM,GAAG,IAAW,KAC5B,OAAO,CAAC,MAAM,CAehB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getStats = exports.initiateAuthenticationFlow = exports.getConfiguration = void 0;
3
+ exports.getStats = exports.completeAuthenticationFlow = exports.initiateAuthenticationFlow = exports.getConfiguration = void 0;
4
4
  const axiosClient_js_1 = require("../axiosClient.js");
5
5
  /**
6
6
  * Ask a connector to describe its own contract: the authentication methods it
@@ -26,19 +26,32 @@ const getConfiguration = (connectionId, authToken) => {
26
26
  exports.getConfiguration = getConfiguration;
27
27
  /**
28
28
  * Ask a connector how the user should be walked through linking their account at
29
- * the source. Returns the guidance to follow (e.g. an authorization URL plus the
30
- * state to echo back). This STARTS the flow; it does not complete it.
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
31
  *
32
- * Takes no payload by design: the caller does not know which authentication
33
- * scheme a given connector speaks, so the connector answers unprompted.
32
+ * The connector decides WHICH scheme applies, which is why the caller asks rather
33
+ * than tells. But the caller must supply two things the connector cannot know:
34
+ *
35
+ * redirectUri the connector answers the same way wherever the platform is
36
+ * running, and providers match this value by exact string.
37
+ * url where the source points. This shapes the authorize request
38
+ * itself — Confluence picks its cloudId from it and SharePoint
39
+ * decides which tenant issues the token — so collect the URL from
40
+ * the user BEFORE offering to connect. Signing in first and asking
41
+ * where second risks a token for the wrong place.
42
+ *
43
+ * The url is also what the resulting credentials get tied to: saving them onto a
44
+ * source that points somewhere else is refused.
34
45
  * POST /api/v1/exceed/knowledgebasesourceconnectors/:id/authentication-flow
35
46
  * @param {String} connectionId The connection id (an `integrationId` from `knowledgeBase.listSourceConnectors`)
47
+ * @param {String} redirectUri Where the browser will return, e.g. `${origin}/callback`
48
+ * @param {String} url Where the source points — required
36
49
  * @param {String} authToken Authentication token
37
50
  * @returns {Promise<object>}
38
51
  */
39
- const initiateAuthenticationFlow = (connectionId, authToken) => {
52
+ const initiateAuthenticationFlow = (connectionId, redirectUri, url, authToken) => {
40
53
  return new Promise((resolve, reject) => {
41
- const request = axiosClient_js_1.client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/authentication-flow`, {}, { headers: { authorization: authToken } });
54
+ const request = axiosClient_js_1.client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/authentication-flow`, { redirectUri, url }, { headers: { authorization: authToken } });
42
55
  request
43
56
  .then((response) => {
44
57
  resolve(response.data);
@@ -50,21 +63,62 @@ const initiateAuthenticationFlow = (connectionId, authToken) => {
50
63
  };
51
64
  exports.initiateAuthenticationFlow = initiateAuthenticationFlow;
52
65
  /**
53
- * Ask a connector how much content the supplied credentials can reach — the
54
- * volume preview shown before a source is created.
66
+ * Finish linking an account: exchange the authorization code the provider
67
+ * returned for the connection itself.
68
+ *
69
+ * Call this the moment the callback reports back. The code is single-use and
70
+ * expires within minutes, so holding it until the source is saved would fail at
71
+ * exactly the point the user commits.
72
+ *
73
+ * What comes back is a HANDLE, never the credentials — those stay server-side
74
+ * until a source exists to own them, and are then written to the vault. Pass the
75
+ * handle as `authenticationHandle` when creating the source.
76
+ * POST /api/v1/exceed/knowledgebasesourceconnectors/:id/authentication-flow/complete
77
+ * @param {String} connectionId The connection id
78
+ * @param {String} code The authorization code from the provider
79
+ * @param {String} state The state echoed back, as minted by `initiateAuthenticationFlow`
80
+ * @param {String} authToken Authentication token
81
+ * @returns {Promise<object>} `{ handle, displayName }`
82
+ */
83
+ const completeAuthenticationFlow = (connectionId, code, state, authToken) => {
84
+ return new Promise((resolve, reject) => {
85
+ const request = axiosClient_js_1.client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/authentication-flow/complete`, { code, state }, { headers: { authorization: authToken } });
86
+ request
87
+ .then((response) => {
88
+ resolve(response.data);
89
+ })
90
+ .catch((error) => {
91
+ reject(error);
92
+ });
93
+ });
94
+ };
95
+ exports.completeAuthenticationFlow = completeAuthenticationFlow;
96
+ /**
97
+ * Ask a connector how much content the supplied credentials can reach AT A GIVEN
98
+ * LOCATION — the volume preview shown before a source is created.
99
+ *
100
+ * This doubles as the reachability check. Signing in proves the person has an
101
+ * account; it proves nothing about whether they can read the specific site or
102
+ * space they typed. Credentials that cannot see `url` answer with an error or
103
+ * with nothing, so the user finds out here rather than at the first ingestion.
104
+ *
105
+ * `url` is required, and counts come back scoped to it. Calling without one is
106
+ * not "unscoped" so much as wrong: the answer would describe everything the
107
+ * account can reach, which is rarely what is about to be ingested.
55
108
  *
56
109
  * POST rather than GET because the credentials travel in the body and must not
57
110
  * reach a URL, an access log, or browser history.
58
111
  * POST /api/v1/exceed/knowledgebasesourceconnectors/:id/stats
59
112
  * @param {String} connectionId The connection id (an `integrationId` from `knowledgeBase.listSourceConnectors`)
60
113
  * @param {object} authentication Credentials, shaped by the chosen `SourceConnectorAuthentication`
114
+ * @param {String} url Where the source points — required, and what the count is scoped to
61
115
  * @param {String} authToken Authentication token
62
116
  * @param {object} filters Optional filters over the fields `getConfiguration` advertises
63
117
  * @returns {Promise<object>} A `SourceConnectorStats`
64
118
  */
65
- const getStats = (connectionId, authentication, authToken, filters = null) => {
119
+ const getStats = (connectionId, authentication, url, authToken, filters = null) => {
66
120
  return new Promise((resolve, reject) => {
67
- const request = axiosClient_js_1.client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/stats`, { authentication, ...(filters ? { filters } : {}) }, { headers: { authorization: authToken } });
121
+ const request = axiosClient_js_1.client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/stats`, { authentication, url, ...(filters ? { filters } : {}) }, { headers: { authorization: authToken } });
68
122
  request
69
123
  .then((response) => {
70
124
  resolve(response.data);
@@ -1 +1 @@
1
- {"version":3,"file":"knowledgeBaseSourceConnectors.js","sourceRoot":"","sources":["../../../../src/lib/integrations/knowledgeBaseSourceConnectors.ts"],"names":[],"mappings":";;;AACA,sDAA2C;AAyE3C;;;;;;;;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;;;;;;;;;;;GAWG;AACI,MAAM,0BAA0B,GAAG,CACxC,YAAoB,EACpB,SAAiB,EAC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AAC;AApBW,QAAA,QAAQ,YAoBnB"}
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;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,MAAM,0BAA0B,GAAG,CACxC,YAAoB,EACpB,WAAmB,EACnB,GAAW,EACX,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,GAAG,EAAE,EACpB,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;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AC,CAAC,EAAE,CAAC,EAAE,EACxD,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;AArBW,QAAA,QAAQ,YAqBnB"}
@@ -20,10 +20,24 @@ export interface SourceConnectorAuthentication {
20
20
  isDefault: boolean;
21
21
  fields: SourceConnectorAuthenticationField[];
22
22
  }
23
- /** A field a source may be narrowed by. `type` is "string" | "number" | "date". */
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
+ */
24
37
  export interface SourceConnectorFilter {
25
38
  field: string;
26
39
  type: string;
40
+ operators: SourceConnectorFilterOperator[];
27
41
  }
28
42
  /** What a connector accepts — the response of `getConfiguration`. */
29
43
  export interface SourceConnectorConfiguration {
@@ -56,29 +70,71 @@ export interface SourceConnectorStats {
56
70
  export declare const getConfiguration: (connectionId: string, authToken: string) => Promise<object>;
57
71
  /**
58
72
  * Ask a connector how the user should be walked through linking their account at
59
- * the source. Returns the guidance to follow (e.g. an authorization URL plus the
60
- * state to echo back). This STARTS the flow; it does not complete it.
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 two things the connector cannot know:
78
+ *
79
+ * redirectUri the connector answers the same way wherever the platform is
80
+ * running, and providers match this value by exact string.
81
+ * url where the source points. This shapes the authorize request
82
+ * itself — Confluence picks its cloudId from it and SharePoint
83
+ * decides which tenant issues the token — so collect the URL from
84
+ * the user BEFORE offering to connect. Signing in first and asking
85
+ * where second risks a token for the wrong place.
61
86
  *
62
- * Takes no payload by design: the caller does not know which authentication
63
- * scheme a given connector speaks, so the connector answers unprompted.
87
+ * The url is also what the resulting credentials get tied to: saving them onto a
88
+ * source that points somewhere else is refused.
64
89
  * POST /api/v1/exceed/knowledgebasesourceconnectors/:id/authentication-flow
65
90
  * @param {String} connectionId The connection id (an `integrationId` from `knowledgeBase.listSourceConnectors`)
91
+ * @param {String} redirectUri Where the browser will return, e.g. `${origin}/callback`
92
+ * @param {String} url Where the source points — required
66
93
  * @param {String} authToken Authentication token
67
94
  * @returns {Promise<object>}
68
95
  */
69
- export declare const initiateAuthenticationFlow: (connectionId: string, authToken: string) => Promise<object>;
96
+ export declare const initiateAuthenticationFlow: (connectionId: string, redirectUri: string, url: string, authToken: string) => Promise<object>;
70
97
  /**
71
- * Ask a connector how much content the supplied credentials can reach — the
72
- * volume preview shown before a source is created.
98
+ * Finish linking an account: exchange the authorization code the provider
99
+ * returned for the connection itself.
100
+ *
101
+ * Call this the moment the callback reports back. The code is single-use and
102
+ * expires within minutes, so holding it until the source is saved would fail at
103
+ * exactly the point the user commits.
104
+ *
105
+ * What comes back is a HANDLE, never the credentials — those stay server-side
106
+ * until a source exists to own them, and are then written to the vault. Pass the
107
+ * handle as `authenticationHandle` when creating the source.
108
+ * POST /api/v1/exceed/knowledgebasesourceconnectors/:id/authentication-flow/complete
109
+ * @param {String} connectionId The connection id
110
+ * @param {String} code The authorization code from the provider
111
+ * @param {String} state The state echoed back, as minted by `initiateAuthenticationFlow`
112
+ * @param {String} authToken Authentication token
113
+ * @returns {Promise<object>} `{ handle, displayName }`
114
+ */
115
+ export declare const completeAuthenticationFlow: (connectionId: string, code: string, state: string, authToken: string) => Promise<object>;
116
+ /**
117
+ * Ask a connector how much content the supplied credentials can reach AT A GIVEN
118
+ * LOCATION — the volume preview shown before a source is created.
119
+ *
120
+ * This doubles as the reachability check. Signing in proves the person has an
121
+ * account; it proves nothing about whether they can read the specific site or
122
+ * space they typed. Credentials that cannot see `url` answer with an error or
123
+ * with nothing, so the user finds out here rather than at the first ingestion.
124
+ *
125
+ * `url` is required, and counts come back scoped to it. Calling without one is
126
+ * not "unscoped" so much as wrong: the answer would describe everything the
127
+ * account can reach, which is rarely what is about to be ingested.
73
128
  *
74
129
  * POST rather than GET because the credentials travel in the body and must not
75
130
  * reach a URL, an access log, or browser history.
76
131
  * POST /api/v1/exceed/knowledgebasesourceconnectors/:id/stats
77
132
  * @param {String} connectionId The connection id (an `integrationId` from `knowledgeBase.listSourceConnectors`)
78
133
  * @param {object} authentication Credentials, shaped by the chosen `SourceConnectorAuthentication`
134
+ * @param {String} url Where the source points — required, and what the count is scoped to
79
135
  * @param {String} authToken Authentication token
80
136
  * @param {object} filters Optional filters over the fields `getConfiguration` advertises
81
137
  * @returns {Promise<object>} A `SourceConnectorStats`
82
138
  */
83
- export declare const getStats: (connectionId: string, authentication: object, authToken: string, filters?: object | null) => Promise<object>;
139
+ export declare const getStats: (connectionId: string, authentication: object, url: string, authToken: string, filters?: object | null) => Promise<object>;
84
140
  //# sourceMappingURL=knowledgeBaseSourceConnectors.d.ts.map
@@ -1 +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+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M,QAAQ,GACnB,cAAc,MAAM,EACpB,gBAAgB,MAAM,EACtB,WAAW,MAAM,EACjB,UAAS,MAAM,GAAG,IAAW,KAC5B,OAAO,CAAC,MAAM,CAehB,CAAC"}
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;IAC/D,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,6BAA6B,EAAE,CAAC;CAC5C;AAED,qEAAqE;AACrE,MAAM,WAAW,4BAA4B;IAC3C,eAAe,EAAE,6BAA6B,EAAE,CAAC;IACjD,OAAO,EAAE,qBAAqB,EAAE,CAAC;CAClC;AAED,gEAAgE;AAChE,MAAM,WAAW,0BAA0B;IACzC,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,+EAA+E;AAC/E,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,0BAA0B,EAAE,CAAC;CACvC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAC3B,cAAc,MAAM,EACpB,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAchB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,0BAA0B,GACrC,cAAc,MAAM,EACpB,aAAa,MAAM,EACnB,KAAK,MAAM,EACX,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,0BAA0B,GACrC,cAAc,MAAM,EACpB,MAAM,MAAM,EACZ,OAAO,MAAM,EACb,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,QAAQ,GACnB,cAAc,MAAM,EACpB,gBAAgB,MAAM,EACtB,KAAK,MAAM,EACX,WAAW,MAAM,EACjB,UAAS,MAAM,GAAG,IAAW,KAC5B,OAAO,CAAC,MAAM,CAehB,CAAC"}
@@ -22,19 +22,32 @@ export const getConfiguration = (connectionId, authToken) => {
22
22
  };
23
23
  /**
24
24
  * Ask a connector how the user should be walked through linking their account at
25
- * the source. Returns the guidance to follow (e.g. an authorization URL plus the
26
- * state to echo back). This STARTS the flow; it does not complete it.
25
+ * the source. Returns the guidance to follow an authorization URL, and the
26
+ * single-use `state` the backend minted for this attempt. This STARTS the flow.
27
27
  *
28
- * Takes no payload by design: the caller does not know which authentication
29
- * scheme a given connector speaks, so the connector answers unprompted.
28
+ * The connector decides WHICH scheme applies, which is why the caller asks rather
29
+ * than tells. But the caller must supply two things the connector cannot know:
30
+ *
31
+ * redirectUri the connector answers the same way wherever the platform is
32
+ * running, and providers match this value by exact string.
33
+ * url where the source points. This shapes the authorize request
34
+ * itself — Confluence picks its cloudId from it and SharePoint
35
+ * decides which tenant issues the token — so collect the URL from
36
+ * the user BEFORE offering to connect. Signing in first and asking
37
+ * where second risks a token for the wrong place.
38
+ *
39
+ * The url is also what the resulting credentials get tied to: saving them onto a
40
+ * source that points somewhere else is refused.
30
41
  * POST /api/v1/exceed/knowledgebasesourceconnectors/:id/authentication-flow
31
42
  * @param {String} connectionId The connection id (an `integrationId` from `knowledgeBase.listSourceConnectors`)
43
+ * @param {String} redirectUri Where the browser will return, e.g. `${origin}/callback`
44
+ * @param {String} url Where the source points — required
32
45
  * @param {String} authToken Authentication token
33
46
  * @returns {Promise<object>}
34
47
  */
35
- export const initiateAuthenticationFlow = (connectionId, authToken) => {
48
+ export const initiateAuthenticationFlow = (connectionId, redirectUri, url, authToken) => {
36
49
  return new Promise((resolve, reject) => {
37
- const request = client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/authentication-flow`, {}, { headers: { authorization: authToken } });
50
+ const request = client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/authentication-flow`, { redirectUri, url }, { headers: { authorization: authToken } });
38
51
  request
39
52
  .then((response) => {
40
53
  resolve(response.data);
@@ -45,21 +58,61 @@ export const initiateAuthenticationFlow = (connectionId, authToken) => {
45
58
  });
46
59
  };
47
60
  /**
48
- * Ask a connector how much content the supplied credentials can reach — the
49
- * volume preview shown before a source is created.
61
+ * Finish linking an account: exchange the authorization code the provider
62
+ * returned for the connection itself.
63
+ *
64
+ * Call this the moment the callback reports back. The code is single-use and
65
+ * expires within minutes, so holding it until the source is saved would fail at
66
+ * exactly the point the user commits.
67
+ *
68
+ * What comes back is a HANDLE, never the credentials — those stay server-side
69
+ * until a source exists to own them, and are then written to the vault. Pass the
70
+ * handle as `authenticationHandle` when creating the source.
71
+ * POST /api/v1/exceed/knowledgebasesourceconnectors/:id/authentication-flow/complete
72
+ * @param {String} connectionId The connection id
73
+ * @param {String} code The authorization code from the provider
74
+ * @param {String} state The state echoed back, as minted by `initiateAuthenticationFlow`
75
+ * @param {String} authToken Authentication token
76
+ * @returns {Promise<object>} `{ handle, displayName }`
77
+ */
78
+ export const completeAuthenticationFlow = (connectionId, code, state, authToken) => {
79
+ return new Promise((resolve, reject) => {
80
+ const request = client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/authentication-flow/complete`, { code, state }, { headers: { authorization: authToken } });
81
+ request
82
+ .then((response) => {
83
+ resolve(response.data);
84
+ })
85
+ .catch((error) => {
86
+ reject(error);
87
+ });
88
+ });
89
+ };
90
+ /**
91
+ * Ask a connector how much content the supplied credentials can reach AT A GIVEN
92
+ * LOCATION — the volume preview shown before a source is created.
93
+ *
94
+ * This doubles as the reachability check. Signing in proves the person has an
95
+ * account; it proves nothing about whether they can read the specific site or
96
+ * space they typed. Credentials that cannot see `url` answer with an error or
97
+ * with nothing, so the user finds out here rather than at the first ingestion.
98
+ *
99
+ * `url` is required, and counts come back scoped to it. Calling without one is
100
+ * not "unscoped" so much as wrong: the answer would describe everything the
101
+ * account can reach, which is rarely what is about to be ingested.
50
102
  *
51
103
  * POST rather than GET because the credentials travel in the body and must not
52
104
  * reach a URL, an access log, or browser history.
53
105
  * POST /api/v1/exceed/knowledgebasesourceconnectors/:id/stats
54
106
  * @param {String} connectionId The connection id (an `integrationId` from `knowledgeBase.listSourceConnectors`)
55
107
  * @param {object} authentication Credentials, shaped by the chosen `SourceConnectorAuthentication`
108
+ * @param {String} url Where the source points — required, and what the count is scoped to
56
109
  * @param {String} authToken Authentication token
57
110
  * @param {object} filters Optional filters over the fields `getConfiguration` advertises
58
111
  * @returns {Promise<object>} A `SourceConnectorStats`
59
112
  */
60
- export const getStats = (connectionId, authentication, authToken, filters = null) => {
113
+ export const getStats = (connectionId, authentication, url, authToken, filters = null) => {
61
114
  return new Promise((resolve, reject) => {
62
- const request = client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/stats`, { authentication, ...(filters ? { filters } : {}) }, { headers: { authorization: authToken } });
115
+ const request = client.post(`/api/v1/exceed/knowledgebasesourceconnectors/${connectionId}/stats`, { authentication, url, ...(filters ? { filters } : {}) }, { headers: { authorization: authToken } });
63
116
  request
64
117
  .then((response) => {
65
118
  resolve(response.data);
@@ -1 +1 @@
1
- {"version":3,"file":"knowledgeBaseSourceConnectors.js","sourceRoot":"","sources":["../../../../src/lib/integrations/knowledgeBaseSourceConnectors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAyE3C;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,YAAoB,EACpB,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,MAAM,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;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,YAAoB,EACpB,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CACzB,gDAAgD,YAAY,sBAAsB,EAClF,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,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,YAAoB,EACpB,cAAsB,EACtB,SAAiB,EACjB,UAAyB,IAAI,EACZ,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CACzB,gDAAgD,YAAY,QAAQ,EACpE,EAAE,cAAc,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EACnD,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"}
1
+ {"version":3,"file":"knowledgeBaseSourceConnectors.js","sourceRoot":"","sources":["../../../../src/lib/integrations/knowledgeBaseSourceConnectors.ts"],"names":[],"mappings":"AACA,O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AAO,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.1.264",
3
+ "version": "1.2.0",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "publishConfig": {
6
6
  "access": "public"