conductor-node 11.0.4 → 11.0.5
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/README.md +4 -4
- package/dist/package.json +1 -1
- package/dist/src/Client.d.ts +3 -3
- package/dist/src/Client.js +7 -4
- package/dist/src/integrations/BaseIntegration.js +1 -1
- package/dist/src/resources/AuthSessionsResource.d.ts +52 -0
- package/dist/src/resources/{IntegrationConnectionAuthSessionsResource.js → AuthSessionsResource.js} +7 -7
- package/dist/src/resources/EndUsersResource.d.ts +7 -7
- package/dist/src/resources/EndUsersResource.js +7 -7
- package/dist/src/resources/IntegrationConnectionsResource.d.ts +4 -8
- package/dist/src/resources/IntegrationConnectionsResource.js +3 -9
- package/dist/src/utils/checkForUpdates.js +3 -0
- package/dist/src/utils/error.d.ts +1 -1
- package/dist/src/utils/error.js +1 -1
- package/dist/src/utils/http.d.ts +1 -1
- package/dist/src/utils/http.js +8 -6
- package/package.json +1 -1
- package/dist/src/resources/IntegrationConnectionAuthSessionsResource.d.ts +0 -50
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Execute _any_ read or write QuickBooks Desktop API through async TypeScript and receive a fully-typed response.
|
|
4
4
|
|
|
5
5
|
<!-- markdownlint-disable MD033 -->
|
|
6
|
-
<img src="https://user-images.githubusercontent.com/170023/213273732-83dd6881-0b36-4787-820b-bd55cdc8444f.jpg" alt="
|
|
6
|
+
<img src="https://user-images.githubusercontent.com/170023/213273732-83dd6881-0b36-4787-820b-bd55cdc8444f.jpg" alt="QuickBooks Desktop autocomplete" width="600"/>
|
|
7
7
|
|
|
8
8
|
## Usage
|
|
9
9
|
|
|
@@ -11,12 +11,12 @@ Execute _any_ read or write QuickBooks Desktop API through async TypeScript and
|
|
|
11
11
|
import Conductor from "conductor-node";
|
|
12
12
|
|
|
13
13
|
// Instantiate `Conductor` with your account's secret key.
|
|
14
|
-
const conductor = new Conductor("
|
|
14
|
+
const conductor = new Conductor("{{YOUR_SECRET_KEY}}");
|
|
15
15
|
|
|
16
|
-
// Fetch all authorized
|
|
16
|
+
// Fetch all authorized EndUsers.
|
|
17
17
|
const endUsers = await conductor.endUsers.list();
|
|
18
18
|
|
|
19
|
-
// Execute any QBD API against your
|
|
19
|
+
// Execute any QBD API against your EndUser.
|
|
20
20
|
const newAccount = await conductor.qbd.account.add(endUsers[0].id, {
|
|
21
21
|
Name: "Test Account",
|
|
22
22
|
AccountType: "Bank",
|
package/dist/package.json
CHANGED
package/dist/src/Client.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import QbdIntegration from "./integrations/qbd/QbdIntegration";
|
|
2
|
+
import AuthSessionsResource from "./resources/AuthSessionsResource";
|
|
2
3
|
import EndUsersResource from "./resources/EndUsersResource";
|
|
3
4
|
import IntegrationConnectionsResource from "./resources/IntegrationConnectionsResource";
|
|
4
|
-
import { getServerUrlForEnvironment } from "./utils/http";
|
|
5
5
|
export interface ClientOptions {
|
|
6
6
|
/**
|
|
7
7
|
* Enables logging each request, response, and error.
|
|
8
8
|
*/
|
|
9
9
|
readonly verbose?: boolean;
|
|
10
|
-
readonly serverEnvironment?: Parameters<typeof getServerUrlForEnvironment>[0];
|
|
11
10
|
}
|
|
12
11
|
export default class Client {
|
|
13
12
|
readonly endUsers: EndUsersResource;
|
|
14
13
|
readonly integrationConnections: IntegrationConnectionsResource;
|
|
14
|
+
readonly authSessions: AuthSessionsResource;
|
|
15
15
|
/**
|
|
16
16
|
* Executes any QuickBooks Desktop (QBD) API against the specified end-user.
|
|
17
17
|
* See the official [QuickBooks Desktop API
|
|
@@ -20,7 +20,7 @@ export default class Client {
|
|
|
20
20
|
*/
|
|
21
21
|
readonly qbd: QbdIntegration;
|
|
22
22
|
private readonly httpClient;
|
|
23
|
-
constructor(apiKey: string, { verbose
|
|
23
|
+
constructor(apiKey: string, { verbose }?: ClientOptions);
|
|
24
24
|
private createHttpClient;
|
|
25
25
|
private createHeaders;
|
|
26
26
|
}
|
package/dist/src/Client.js
CHANGED
|
@@ -7,6 +7,7 @@ const package_json_1 = __importDefault(require("./../package.json"));
|
|
|
7
7
|
const QbdIntegration_1 = __importDefault(require("./integrations/qbd/QbdIntegration"));
|
|
8
8
|
const errorHandling_1 = require("./interceptors/errorHandling");
|
|
9
9
|
const logging_1 = require("./interceptors/logging");
|
|
10
|
+
const AuthSessionsResource_1 = __importDefault(require("./resources/AuthSessionsResource"));
|
|
10
11
|
const EndUsersResource_1 = __importDefault(require("./resources/EndUsersResource"));
|
|
11
12
|
const IntegrationConnectionsResource_1 = __importDefault(require("./resources/IntegrationConnectionsResource"));
|
|
12
13
|
const checkForUpdates_1 = require("./utils/checkForUpdates");
|
|
@@ -15,6 +16,7 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
15
16
|
class Client {
|
|
16
17
|
endUsers;
|
|
17
18
|
integrationConnections;
|
|
19
|
+
authSessions;
|
|
18
20
|
/**
|
|
19
21
|
* Executes any QuickBooks Desktop (QBD) API against the specified end-user.
|
|
20
22
|
* See the official [QuickBooks Desktop API
|
|
@@ -23,16 +25,17 @@ class Client {
|
|
|
23
25
|
*/
|
|
24
26
|
qbd;
|
|
25
27
|
httpClient;
|
|
26
|
-
constructor(apiKey, { verbose = false
|
|
28
|
+
constructor(apiKey, { verbose = false } = {}) {
|
|
27
29
|
(0, checkForUpdates_1.checkForUpdates)();
|
|
28
|
-
this.httpClient = this.createHttpClient(apiKey, verbose
|
|
30
|
+
this.httpClient = this.createHttpClient(apiKey, verbose);
|
|
29
31
|
this.endUsers = new EndUsersResource_1.default(this.httpClient);
|
|
30
32
|
this.integrationConnections = new IntegrationConnectionsResource_1.default(this.httpClient);
|
|
33
|
+
this.authSessions = new AuthSessionsResource_1.default(this.httpClient);
|
|
31
34
|
this.qbd = new QbdIntegration_1.default(this.httpClient);
|
|
32
35
|
}
|
|
33
|
-
createHttpClient(apiKey, verbose
|
|
36
|
+
createHttpClient(apiKey, verbose) {
|
|
34
37
|
const httpClient = axios_1.default.create({
|
|
35
|
-
baseURL: `${(0, http_1.
|
|
38
|
+
baseURL: `${(0, http_1.getApiServerUrlForEnvironment)()}/v1`,
|
|
36
39
|
headers: this.createHeaders(apiKey),
|
|
37
40
|
timeout: 0, // No timeout (default).
|
|
38
41
|
});
|
|
@@ -7,7 +7,7 @@ class BaseIntegration {
|
|
|
7
7
|
}
|
|
8
8
|
/** Not intended for public use. */
|
|
9
9
|
async sendRequest(endUserId, integrationSlug, payload) {
|
|
10
|
-
const { data } = await this.httpClient.post(`/
|
|
10
|
+
const { data } = await this.httpClient.post(`/end_users/${endUserId}/request/${integrationSlug}`, payload);
|
|
11
11
|
return data;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import BaseResource from "../resources/BaseResource";
|
|
2
|
+
export interface AuthSession {
|
|
3
|
+
/**
|
|
4
|
+
* The unique identifier for the object.
|
|
5
|
+
*/
|
|
6
|
+
readonly id: string;
|
|
7
|
+
/**
|
|
8
|
+
* The ID of the EndUser for whom to create an IntegrationConnection in this
|
|
9
|
+
* AuthSession.
|
|
10
|
+
*/
|
|
11
|
+
readonly endUserId: string;
|
|
12
|
+
/**
|
|
13
|
+
* The value that you will pass to the client to launch the authentication
|
|
14
|
+
* flow.
|
|
15
|
+
*/
|
|
16
|
+
readonly clientSecret: string;
|
|
17
|
+
/**
|
|
18
|
+
* The time at which this AuthSession expires.
|
|
19
|
+
*/
|
|
20
|
+
readonly expiresAt: string;
|
|
21
|
+
}
|
|
22
|
+
export interface AuthSessionCreateInput {
|
|
23
|
+
/**
|
|
24
|
+
* Your Conductor publishable key, which we use to create the session's
|
|
25
|
+
* `authUrl`.
|
|
26
|
+
*/
|
|
27
|
+
readonly publishableKey: string;
|
|
28
|
+
/**
|
|
29
|
+
* The ID of the EndUser for whom to create the IntegrationConnection.
|
|
30
|
+
*/
|
|
31
|
+
readonly endUserId: string;
|
|
32
|
+
}
|
|
33
|
+
export interface AuthSessionCreateOutput extends AuthSession {
|
|
34
|
+
/**
|
|
35
|
+
* The URL of the authentication flow for the specified EndUser to set up the
|
|
36
|
+
* IntegrationConnection.
|
|
37
|
+
*/
|
|
38
|
+
readonly authUrl: string;
|
|
39
|
+
}
|
|
40
|
+
export default class AuthSessionsResource extends BaseResource {
|
|
41
|
+
protected readonly ROUTE = "/auth_sessions";
|
|
42
|
+
/**
|
|
43
|
+
* Creates an AuthSession for launching the client-side IntegrationConnection
|
|
44
|
+
* authentication flow. Use the returned session’s `clientSecret` to launch
|
|
45
|
+
* the auth flow using Conductor.js.
|
|
46
|
+
*/
|
|
47
|
+
create(input: AuthSessionCreateInput): Promise<AuthSessionCreateOutput>;
|
|
48
|
+
/**
|
|
49
|
+
* Retrieves the specified AuthSession.
|
|
50
|
+
*/
|
|
51
|
+
retrieve(id: AuthSession["id"]): Promise<AuthSession>;
|
|
52
|
+
}
|
package/dist/src/resources/{IntegrationConnectionAuthSessionsResource.js → AuthSessionsResource.js}
RENAMED
|
@@ -4,23 +4,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const BaseResource_1 = __importDefault(require("../resources/BaseResource"));
|
|
7
|
-
class
|
|
8
|
-
ROUTE = "/
|
|
7
|
+
class AuthSessionsResource extends BaseResource_1.default {
|
|
8
|
+
ROUTE = "/auth_sessions";
|
|
9
9
|
/**
|
|
10
|
-
* Creates an
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Creates an AuthSession for launching the client-side IntegrationConnection
|
|
11
|
+
* authentication flow. Use the returned session’s `clientSecret` to launch
|
|
12
|
+
* the auth flow using Conductor.js.
|
|
13
13
|
*/
|
|
14
14
|
async create(input) {
|
|
15
15
|
const { data } = await this.httpClient.post(this.ROUTE, input);
|
|
16
16
|
return data;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* Retrieves the specified
|
|
19
|
+
* Retrieves the specified AuthSession.
|
|
20
20
|
*/
|
|
21
21
|
async retrieve(id) {
|
|
22
22
|
const { data } = await this.httpClient.get(`${this.ROUTE}/${id}`);
|
|
23
23
|
return data;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
exports.default =
|
|
26
|
+
exports.default = AuthSessionsResource;
|
|
@@ -31,21 +31,21 @@ export interface EndUserPingOutput {
|
|
|
31
31
|
readonly duration: number;
|
|
32
32
|
}
|
|
33
33
|
export default class EndUsersResource extends BaseResource {
|
|
34
|
-
protected readonly ROUTE = "/
|
|
34
|
+
protected readonly ROUTE = "/end_users";
|
|
35
35
|
/**
|
|
36
|
-
* Returns a list of your
|
|
36
|
+
* Returns a list of your EndUsers.
|
|
37
37
|
*/
|
|
38
38
|
list(): Promise<EndUser[]>;
|
|
39
39
|
/**
|
|
40
|
-
* Creates a new
|
|
40
|
+
* Creates a new EndUser.
|
|
41
41
|
*/
|
|
42
42
|
create(input: EndUserCreateInput): Promise<EndUser>;
|
|
43
43
|
/**
|
|
44
|
-
* Retrieves the specified
|
|
44
|
+
* Retrieves the specified EndUser.
|
|
45
45
|
*/
|
|
46
46
|
retrieve(id: EndUser["id"]): Promise<EndUser>;
|
|
47
47
|
/**
|
|
48
|
-
* Checks whether the specified
|
|
48
|
+
* Checks whether the specified IntegrationConnection can connect and process
|
|
49
49
|
* requests end-to-end.
|
|
50
50
|
*
|
|
51
51
|
* If the connection fails, the error we encountered will be thrown as a
|
|
@@ -55,8 +55,8 @@ export default class EndUsersResource extends BaseResource {
|
|
|
55
55
|
* your end-user in your app's UI.
|
|
56
56
|
*
|
|
57
57
|
* @param id The ID of the end-user to ping.
|
|
58
|
-
* @param integrationSlug The integration identifier for the
|
|
59
|
-
*
|
|
58
|
+
* @param integrationSlug The integration identifier for the end-user's
|
|
59
|
+
* connection you want to ping (e.g. "quickbooks-desktop").
|
|
60
60
|
* @returns The ping result with the duration in milliseconds.
|
|
61
61
|
*/
|
|
62
62
|
ping(id: EndUser["id"], integrationSlug: IntegrationSlug): Promise<EndUserPingOutput>;
|
|
@@ -5,30 +5,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const BaseResource_1 = __importDefault(require("../resources/BaseResource"));
|
|
7
7
|
class EndUsersResource extends BaseResource_1.default {
|
|
8
|
-
ROUTE = "/
|
|
8
|
+
ROUTE = "/end_users";
|
|
9
9
|
/**
|
|
10
|
-
* Returns a list of your
|
|
10
|
+
* Returns a list of your EndUsers.
|
|
11
11
|
*/
|
|
12
12
|
async list() {
|
|
13
13
|
const { data } = await this.httpClient.get(this.ROUTE);
|
|
14
14
|
return data;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* Creates a new
|
|
17
|
+
* Creates a new EndUser.
|
|
18
18
|
*/
|
|
19
19
|
async create(input) {
|
|
20
20
|
const { data } = await this.httpClient.post(this.ROUTE, input);
|
|
21
21
|
return data;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* Retrieves the specified
|
|
24
|
+
* Retrieves the specified EndUser.
|
|
25
25
|
*/
|
|
26
26
|
async retrieve(id) {
|
|
27
27
|
const { data } = await this.httpClient.get(`${this.ROUTE}/${id}`);
|
|
28
28
|
return data;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* Checks whether the specified
|
|
31
|
+
* Checks whether the specified IntegrationConnection can connect and process
|
|
32
32
|
* requests end-to-end.
|
|
33
33
|
*
|
|
34
34
|
* If the connection fails, the error we encountered will be thrown as a
|
|
@@ -38,8 +38,8 @@ class EndUsersResource extends BaseResource_1.default {
|
|
|
38
38
|
* your end-user in your app's UI.
|
|
39
39
|
*
|
|
40
40
|
* @param id The ID of the end-user to ping.
|
|
41
|
-
* @param integrationSlug The integration identifier for the
|
|
42
|
-
*
|
|
41
|
+
* @param integrationSlug The integration identifier for the end-user's
|
|
42
|
+
* connection you want to ping (e.g. "quickbooks-desktop").
|
|
43
43
|
* @returns The ping result with the duration in milliseconds.
|
|
44
44
|
*/
|
|
45
45
|
async ping(id, integrationSlug) {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import BaseResource from "../resources/BaseResource";
|
|
2
|
-
import IntegrationConnectionAuthSessionsResource from "../resources/IntegrationConnectionAuthSessionsResource";
|
|
3
|
-
import type { AxiosInstance } from "axios";
|
|
4
2
|
export type IntegrationSlug = "quickbooks-desktop";
|
|
5
3
|
export interface IntegrationConnection {
|
|
6
4
|
/**
|
|
@@ -8,7 +6,7 @@ export interface IntegrationConnection {
|
|
|
8
6
|
*/
|
|
9
7
|
readonly id: string;
|
|
10
8
|
/**
|
|
11
|
-
* The ID of the
|
|
9
|
+
* The ID of the EndUser who owns this IntegrationConnection.
|
|
12
10
|
*/
|
|
13
11
|
readonly endUserId: string;
|
|
14
12
|
/**
|
|
@@ -25,15 +23,13 @@ export interface IntegrationConnectionPingOutput {
|
|
|
25
23
|
readonly duration: number;
|
|
26
24
|
}
|
|
27
25
|
export default class IntegrationConnectionsResource extends BaseResource {
|
|
28
|
-
readonly
|
|
29
|
-
protected readonly ROUTE = "/integration-connections";
|
|
30
|
-
constructor(httpClient: AxiosInstance);
|
|
26
|
+
protected readonly ROUTE = "/integration_connections";
|
|
31
27
|
/**
|
|
32
|
-
* Returns a list of all
|
|
28
|
+
* Returns a list of all IntegrationConnections of all your EndUsers.
|
|
33
29
|
*/
|
|
34
30
|
list(): Promise<IntegrationConnection[]>;
|
|
35
31
|
/**
|
|
36
|
-
* Retrieves the specified
|
|
32
|
+
* Retrieves the specified IntegrationConnection.
|
|
37
33
|
*/
|
|
38
34
|
retrieve(id: IntegrationConnection["id"]): Promise<IntegrationConnection>;
|
|
39
35
|
}
|
|
@@ -4,23 +4,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const BaseResource_1 = __importDefault(require("../resources/BaseResource"));
|
|
7
|
-
const IntegrationConnectionAuthSessionsResource_1 = __importDefault(require("../resources/IntegrationConnectionAuthSessionsResource"));
|
|
8
7
|
class IntegrationConnectionsResource extends BaseResource_1.default {
|
|
9
|
-
|
|
10
|
-
ROUTE = "/integration-connections";
|
|
11
|
-
constructor(httpClient) {
|
|
12
|
-
super(httpClient);
|
|
13
|
-
this.authSessions = new IntegrationConnectionAuthSessionsResource_1.default(this.httpClient);
|
|
14
|
-
}
|
|
8
|
+
ROUTE = "/integration_connections";
|
|
15
9
|
/**
|
|
16
|
-
* Returns a list of all
|
|
10
|
+
* Returns a list of all IntegrationConnections of all your EndUsers.
|
|
17
11
|
*/
|
|
18
12
|
async list() {
|
|
19
13
|
const { data } = await this.httpClient.get(this.ROUTE);
|
|
20
14
|
return data;
|
|
21
15
|
}
|
|
22
16
|
/**
|
|
23
|
-
* Retrieves the specified
|
|
17
|
+
* Retrieves the specified IntegrationConnection.
|
|
24
18
|
*/
|
|
25
19
|
async retrieve(id) {
|
|
26
20
|
const { data } = await this.httpClient.get(`${this.ROUTE}/${id}`);
|
|
@@ -7,6 +7,9 @@ exports.checkForUpdates = void 0;
|
|
|
7
7
|
const package_json_1 = __importDefault(require("../../package.json"));
|
|
8
8
|
const node_child_process_1 = __importDefault(require("node:child_process"));
|
|
9
9
|
function checkForUpdates() {
|
|
10
|
+
if (process.env.NODE_ENV === "test") {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
10
13
|
// Exit early if npm is not installed.
|
|
11
14
|
try {
|
|
12
15
|
node_child_process_1.default.execSync("which npm");
|
|
@@ -119,7 +119,7 @@ export declare class ConductorIntegrationError extends ConductorError {
|
|
|
119
119
|
/**
|
|
120
120
|
* Raised when a connection error occurs with the third-party integration on the
|
|
121
121
|
* end-user's side. This typically indicates an issue with the end-user's
|
|
122
|
-
*
|
|
122
|
+
* IntegrationConnection or configuration, which they must resolve. In other
|
|
123
123
|
* words, you cannot take action to fix these errors.
|
|
124
124
|
*
|
|
125
125
|
* E.g., QuickBooks Web Connector (QBWC) failed to connect to QuickBooks Desktop
|
package/dist/src/utils/error.js
CHANGED
|
@@ -139,7 +139,7 @@ exports.ConductorIntegrationError = ConductorIntegrationError;
|
|
|
139
139
|
/**
|
|
140
140
|
* Raised when a connection error occurs with the third-party integration on the
|
|
141
141
|
* end-user's side. This typically indicates an issue with the end-user's
|
|
142
|
-
*
|
|
142
|
+
* IntegrationConnection or configuration, which they must resolve. In other
|
|
143
143
|
* words, you cannot take action to fix these errors.
|
|
144
144
|
*
|
|
145
145
|
* E.g., QuickBooks Web Connector (QBWC) failed to connect to QuickBooks Desktop
|
package/dist/src/utils/http.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function getApiServerUrlForEnvironment(): string;
|
package/dist/src/utils/http.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
5
|
-
if
|
|
6
|
-
|
|
3
|
+
exports.getApiServerUrlForEnvironment = void 0;
|
|
4
|
+
function getApiServerUrlForEnvironment() {
|
|
5
|
+
// Do not check if `NODE_ENV` is "production" because that requires the
|
|
6
|
+
// developer to have set `NODE_ENV` to use `conductor` as expected.
|
|
7
|
+
if (["development", "test"].includes(process.env.NODE_ENV)) {
|
|
8
|
+
return "http://localhost:4000";
|
|
7
9
|
}
|
|
8
|
-
return "
|
|
10
|
+
return "https://api.conductor.is";
|
|
9
11
|
}
|
|
10
|
-
exports.
|
|
12
|
+
exports.getApiServerUrlForEnvironment = getApiServerUrlForEnvironment;
|
package/package.json
CHANGED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import BaseResource from "../resources/BaseResource";
|
|
2
|
-
export interface IntegrationConnectionAuthSession {
|
|
3
|
-
/**
|
|
4
|
-
* The unique identifier for the object.
|
|
5
|
-
*/
|
|
6
|
-
readonly id: string;
|
|
7
|
-
/**
|
|
8
|
-
* The ID of the end-user for whom to create an integration-connection in this
|
|
9
|
-
* auth session.
|
|
10
|
-
*/
|
|
11
|
-
readonly endUserId: string;
|
|
12
|
-
/**
|
|
13
|
-
* The value that you will pass to the client to launch the authentication flow.
|
|
14
|
-
*/
|
|
15
|
-
readonly clientSecret: string;
|
|
16
|
-
/**
|
|
17
|
-
* The URL to which to redirect the end-user to return to your app after
|
|
18
|
-
* completing the authentication flow.
|
|
19
|
-
*/
|
|
20
|
-
readonly returnUrl: string;
|
|
21
|
-
/**
|
|
22
|
-
* The time at which the auth-session expires.
|
|
23
|
-
*/
|
|
24
|
-
readonly expiresAt: string;
|
|
25
|
-
}
|
|
26
|
-
export interface IntegrationConnectionAuthSessionCreateInput {
|
|
27
|
-
/**
|
|
28
|
-
* The ID of the end-user for whom to create an integration-connection in this
|
|
29
|
-
* auth session.
|
|
30
|
-
*/
|
|
31
|
-
readonly endUserId: string;
|
|
32
|
-
/**
|
|
33
|
-
* The URL to which to redirect the end-user to return to your app after
|
|
34
|
-
* completing the authentication flow.
|
|
35
|
-
*/
|
|
36
|
-
readonly returnUrl: string;
|
|
37
|
-
}
|
|
38
|
-
export default class IntegrationConnectionAuthSessionsResource extends BaseResource {
|
|
39
|
-
protected readonly ROUTE = "/integration-connection-auth-sessions";
|
|
40
|
-
/**
|
|
41
|
-
* Creates an auth session for launching the client-side
|
|
42
|
-
* integration-connection authentication flow. Use the returned session’s
|
|
43
|
-
* `clientSecret` to launch the auth flow using Conductor.js.
|
|
44
|
-
*/
|
|
45
|
-
create(input: IntegrationConnectionAuthSessionCreateInput): Promise<IntegrationConnectionAuthSession>;
|
|
46
|
-
/**
|
|
47
|
-
* Retrieves the specified integration-connection-auth-session.
|
|
48
|
-
*/
|
|
49
|
-
retrieve(id: IntegrationConnectionAuthSession["id"]): Promise<IntegrationConnectionAuthSession>;
|
|
50
|
-
}
|