@usepylon/sdk 0.1.0-alpha.3 → 0.1.0-alpha.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/dist/cjs/BaseClient.js +1 -0
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +7 -2
- package/dist/cjs/api/resources/accounts/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/accounts/client/Client.js +11 -6
- package/dist/cjs/api/resources/accounts/resources/emailActivities/client/Client.d.ts +39 -0
- package/dist/cjs/api/resources/accounts/resources/emailActivities/client/Client.js +159 -0
- package/dist/cjs/api/resources/accounts/resources/emailActivities/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/accounts/resources/emailActivities/client/index.js +17 -0
- package/dist/cjs/api/resources/accounts/resources/emailActivities/client/requests/AccountsEmailActivitiesListRequest.d.ts +18 -0
- package/dist/cjs/api/resources/accounts/resources/emailActivities/client/requests/AccountsEmailActivitiesListRequest.js +3 -0
- package/dist/cjs/api/resources/accounts/resources/emailActivities/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/accounts/resources/emailActivities/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/accounts/resources/emailActivities/exports.d.ts +2 -0
- package/dist/cjs/api/resources/accounts/resources/emailActivities/exports.js +21 -0
- package/dist/cjs/api/resources/accounts/resources/emailActivities/index.d.ts +1 -0
- package/dist/cjs/api/resources/accounts/resources/emailActivities/index.js +17 -0
- package/dist/cjs/api/resources/accounts/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/accounts/resources/index.js +3 -1
- package/dist/cjs/api/resources/contacts/client/Client.d.ts +25 -0
- package/dist/cjs/api/resources/contacts/client/Client.js +73 -0
- package/dist/cjs/api/resources/contacts/client/requests/ContactsMergeRequest.d.ts +13 -0
- package/dist/cjs/api/resources/contacts/client/requests/ContactsMergeRequest.js +3 -0
- package/dist/cjs/api/resources/contacts/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.js +2 -1
- package/dist/cjs/api/resources/issues/client/requests/IssuesCreateDraftReplyRequest.d.ts +6 -0
- package/dist/cjs/api/resources/issues/client/requests/IssuesCreateRequest.d.ts +2 -0
- package/dist/cjs/api/resources/knowledgeBases/resources/articles/client/Client.d.ts +0 -1
- package/dist/cjs/api/resources/knowledgeBases/resources/articles/client/Client.js +0 -1
- package/dist/cjs/api/resources/knowledgeBases/resources/articles/client/requests/KnowledgeBasesArticlesCreateRequest.d.ts +6 -3
- package/dist/cjs/api/resources/knowledgeBases/resources/articles/client/requests/KnowledgeBasesArticlesUpdateRequest.d.ts +4 -0
- package/dist/cjs/api/resources/projects/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/projects/client/Client.js +1 -1
- package/dist/cjs/api/resources/projects/client/requests/ProjectsCreateRequest.d.ts +3 -1
- package/dist/cjs/api/resources/projects/client/requests/ProjectsUpdateRequest.d.ts +2 -0
- package/dist/cjs/api/resources/tasks/client/requests/TasksCreateRequest.d.ts +4 -0
- package/dist/cjs/api/resources/tasks/client/requests/TasksUpdateRequest.d.ts +4 -0
- package/dist/cjs/api/resources/userStatuses/client/Client.d.ts +33 -0
- package/dist/cjs/api/resources/userStatuses/client/Client.js +122 -0
- package/dist/cjs/api/resources/userStatuses/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/userStatuses/client/index.js +2 -0
- package/dist/cjs/api/resources/userStatuses/exports.d.ts +2 -0
- package/dist/cjs/api/resources/userStatuses/exports.js +21 -0
- package/dist/cjs/api/resources/userStatuses/index.d.ts +1 -0
- package/dist/cjs/api/resources/userStatuses/index.js +17 -0
- package/dist/cjs/api/resources/users/client/requests/UsersUpdateRequest.d.ts +10 -11
- package/dist/cjs/api/resources/users/client/requests/UsersUpdateRequest.js +0 -10
- package/dist/cjs/api/resources/users/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/users/client/requests/index.js +0 -3
- package/dist/cjs/api/types/Account.d.ts +2 -0
- package/dist/cjs/api/types/Article.d.ts +4 -0
- package/dist/cjs/api/types/ArticleTranslationInput.d.ts +4 -2
- package/dist/cjs/api/types/EmailActivity.d.ts +11 -0
- package/dist/cjs/api/types/EmailActivity.js +3 -0
- package/dist/cjs/api/types/EmailActivityMessage.d.ts +18 -0
- package/dist/cjs/api/types/EmailActivityMessage.js +3 -0
- package/dist/cjs/api/types/GetEmailActivitiesResponseBody.d.ts +8 -0
- package/dist/cjs/api/types/GetEmailActivitiesResponseBody.js +3 -0
- package/dist/cjs/api/types/GetUserStatusesResponseBody.d.ts +7 -0
- package/dist/cjs/api/types/GetUserStatusesResponseBody.js +3 -0
- package/dist/cjs/api/types/ImportIssueRequest.d.ts +1 -1
- package/dist/cjs/api/types/Issue.d.ts +12 -0
- package/dist/cjs/api/types/MergeContactsResponseBody.d.ts +6 -0
- package/dist/cjs/api/types/MergeContactsResponseBody.js +3 -0
- package/dist/cjs/api/types/Message.d.ts +3 -0
- package/dist/cjs/api/types/MessageReaction.d.ts +6 -0
- package/dist/cjs/api/types/MessageReaction.js +3 -0
- package/dist/cjs/api/types/Project.d.ts +2 -0
- package/dist/cjs/api/types/SlaTimes.d.ts +6 -2
- package/dist/cjs/api/types/SlackMessageInfo.d.ts +10 -0
- package/dist/cjs/api/types/SlackMessageInfo.js +3 -0
- package/dist/cjs/api/types/Task.d.ts +6 -0
- package/dist/cjs/api/types/TeamAssignmentConfiguration.d.ts +10 -1
- package/dist/cjs/api/types/TeamAssignmentConfigurationInput.d.ts +10 -1
- package/dist/cjs/api/types/TeamSla.d.ts +2 -0
- package/dist/cjs/api/types/User.d.ts +3 -5
- package/dist/cjs/api/types/UserSkill.d.ts +13 -0
- package/dist/cjs/api/types/UserSkill.js +3 -0
- package/dist/cjs/api/types/UserSkillValue.d.ts +6 -0
- package/dist/cjs/api/types/UserSkillValue.js +3 -0
- package/dist/cjs/api/types/UserStatus.d.ts +12 -0
- package/dist/cjs/api/types/UserStatus.js +3 -0
- package/dist/cjs/api/types/index.d.ts +10 -0
- package/dist/cjs/api/types/index.js +10 -0
- package/dist/esm/BaseClient.js +1 -0
- package/dist/esm/Client.d.ts +3 -0
- package/dist/esm/Client.js +5 -0
- package/dist/esm/api/resources/accounts/client/Client.d.ts +3 -0
- package/dist/esm/api/resources/accounts/client/Client.js +5 -0
- package/dist/esm/api/resources/accounts/resources/emailActivities/client/Client.d.ts +39 -0
- package/dist/esm/api/resources/accounts/resources/emailActivities/client/Client.js +122 -0
- package/dist/esm/api/resources/accounts/resources/emailActivities/client/index.d.ts +1 -0
- package/dist/esm/api/resources/accounts/resources/emailActivities/client/index.js +1 -0
- package/dist/esm/api/resources/accounts/resources/emailActivities/client/requests/AccountsEmailActivitiesListRequest.d.ts +18 -0
- package/dist/esm/api/resources/accounts/resources/emailActivities/client/requests/AccountsEmailActivitiesListRequest.js +2 -0
- package/dist/esm/api/resources/accounts/resources/emailActivities/client/requests/index.d.ts +1 -0
- package/dist/esm/api/resources/accounts/resources/emailActivities/client/requests/index.js +1 -0
- package/dist/esm/api/resources/accounts/resources/emailActivities/exports.d.ts +2 -0
- package/dist/esm/api/resources/accounts/resources/emailActivities/exports.js +3 -0
- package/dist/esm/api/resources/accounts/resources/emailActivities/index.d.ts +1 -0
- package/dist/esm/api/resources/accounts/resources/emailActivities/index.js +1 -0
- package/dist/esm/api/resources/accounts/resources/index.d.ts +2 -0
- package/dist/esm/api/resources/accounts/resources/index.js +2 -0
- package/dist/esm/api/resources/contacts/client/Client.d.ts +25 -0
- package/dist/esm/api/resources/contacts/client/Client.js +73 -0
- package/dist/esm/api/resources/contacts/client/requests/ContactsMergeRequest.d.ts +13 -0
- package/dist/esm/api/resources/contacts/client/requests/ContactsMergeRequest.js +2 -0
- package/dist/esm/api/resources/contacts/client/requests/index.d.ts +1 -0
- package/dist/esm/api/resources/index.d.ts +1 -0
- package/dist/esm/api/resources/index.js +1 -0
- package/dist/esm/api/resources/issues/client/requests/IssuesCreateDraftReplyRequest.d.ts +6 -0
- package/dist/esm/api/resources/issues/client/requests/IssuesCreateRequest.d.ts +2 -0
- package/dist/esm/api/resources/knowledgeBases/resources/articles/client/Client.d.ts +0 -1
- package/dist/esm/api/resources/knowledgeBases/resources/articles/client/Client.js +0 -1
- package/dist/esm/api/resources/knowledgeBases/resources/articles/client/requests/KnowledgeBasesArticlesCreateRequest.d.ts +6 -3
- package/dist/esm/api/resources/knowledgeBases/resources/articles/client/requests/KnowledgeBasesArticlesUpdateRequest.d.ts +4 -0
- package/dist/esm/api/resources/projects/client/Client.d.ts +1 -1
- package/dist/esm/api/resources/projects/client/Client.js +1 -1
- package/dist/esm/api/resources/projects/client/requests/ProjectsCreateRequest.d.ts +3 -1
- package/dist/esm/api/resources/projects/client/requests/ProjectsUpdateRequest.d.ts +2 -0
- package/dist/esm/api/resources/tasks/client/requests/TasksCreateRequest.d.ts +4 -0
- package/dist/esm/api/resources/tasks/client/requests/TasksUpdateRequest.d.ts +4 -0
- package/dist/esm/api/resources/userStatuses/client/Client.d.ts +33 -0
- package/dist/esm/api/resources/userStatuses/client/Client.js +85 -0
- package/dist/esm/api/resources/userStatuses/client/index.d.ts +1 -0
- package/dist/esm/api/resources/userStatuses/client/index.js +1 -0
- package/dist/esm/api/resources/userStatuses/exports.d.ts +2 -0
- package/dist/esm/api/resources/userStatuses/exports.js +3 -0
- package/dist/esm/api/resources/userStatuses/index.d.ts +1 -0
- package/dist/esm/api/resources/userStatuses/index.js +1 -0
- package/dist/esm/api/resources/users/client/requests/UsersUpdateRequest.d.ts +10 -11
- package/dist/esm/api/resources/users/client/requests/UsersUpdateRequest.js +1 -9
- package/dist/esm/api/resources/users/client/requests/index.d.ts +1 -1
- package/dist/esm/api/resources/users/client/requests/index.js +1 -1
- package/dist/esm/api/types/Account.d.ts +2 -0
- package/dist/esm/api/types/Article.d.ts +4 -0
- package/dist/esm/api/types/ArticleTranslationInput.d.ts +4 -2
- package/dist/esm/api/types/EmailActivity.d.ts +11 -0
- package/dist/esm/api/types/EmailActivity.js +2 -0
- package/dist/esm/api/types/EmailActivityMessage.d.ts +18 -0
- package/dist/esm/api/types/EmailActivityMessage.js +2 -0
- package/dist/esm/api/types/GetEmailActivitiesResponseBody.d.ts +8 -0
- package/dist/esm/api/types/GetEmailActivitiesResponseBody.js +2 -0
- package/dist/esm/api/types/GetUserStatusesResponseBody.d.ts +7 -0
- package/dist/esm/api/types/GetUserStatusesResponseBody.js +2 -0
- package/dist/esm/api/types/ImportIssueRequest.d.ts +1 -1
- package/dist/esm/api/types/Issue.d.ts +12 -0
- package/dist/esm/api/types/MergeContactsResponseBody.d.ts +6 -0
- package/dist/esm/api/types/MergeContactsResponseBody.js +2 -0
- package/dist/esm/api/types/Message.d.ts +3 -0
- package/dist/esm/api/types/MessageReaction.d.ts +6 -0
- package/dist/esm/api/types/MessageReaction.js +2 -0
- package/dist/esm/api/types/Project.d.ts +2 -0
- package/dist/esm/api/types/SlaTimes.d.ts +6 -2
- package/dist/esm/api/types/SlackMessageInfo.d.ts +10 -0
- package/dist/esm/api/types/SlackMessageInfo.js +2 -0
- package/dist/esm/api/types/Task.d.ts +6 -0
- package/dist/esm/api/types/TeamAssignmentConfiguration.d.ts +10 -1
- package/dist/esm/api/types/TeamAssignmentConfigurationInput.d.ts +10 -1
- package/dist/esm/api/types/TeamSla.d.ts +2 -0
- package/dist/esm/api/types/User.d.ts +3 -5
- package/dist/esm/api/types/UserSkill.d.ts +13 -0
- package/dist/esm/api/types/UserSkill.js +2 -0
- package/dist/esm/api/types/UserSkillValue.d.ts +6 -0
- package/dist/esm/api/types/UserSkillValue.js +2 -0
- package/dist/esm/api/types/UserStatus.d.ts +12 -0
- package/dist/esm/api/types/UserStatus.js +2 -0
- package/dist/esm/api/types/index.d.ts +10 -0
- package/dist/esm/api/types/index.js +10 -0
- package/package.json +1 -1
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -42,6 +42,7 @@ const core = __importStar(require("./core/index.js"));
|
|
|
42
42
|
function normalizeClientOptions(options) {
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
|
+
"User-Agent": "@usepylon/sdk/0.1.0-alpha.5",
|
|
45
46
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
46
47
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
47
48
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ import { TeamsClient } from "./api/resources/teams/client/Client.js";
|
|
|
26
26
|
import { TicketFormsClient } from "./api/resources/ticketForms/client/Client.js";
|
|
27
27
|
import { TrainingDataClient } from "./api/resources/trainingData/client/Client.js";
|
|
28
28
|
import { UserRolesClient } from "./api/resources/userRoles/client/Client.js";
|
|
29
|
+
import { UserStatusesClient } from "./api/resources/userStatuses/client/Client.js";
|
|
29
30
|
import { UsersClient } from "./api/resources/users/client/Client.js";
|
|
30
31
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
31
32
|
import { type NormalizedClientOptionsWithAuth } from "./BaseClient.js";
|
|
@@ -65,6 +66,7 @@ export declare class PylonClient {
|
|
|
65
66
|
protected _ticketForms: TicketFormsClient | undefined;
|
|
66
67
|
protected _trainingData: TrainingDataClient | undefined;
|
|
67
68
|
protected _userRoles: UserRolesClient | undefined;
|
|
69
|
+
protected _userStatuses: UserStatusesClient | undefined;
|
|
68
70
|
protected _users: UsersClient | undefined;
|
|
69
71
|
constructor(options: PylonClient.Options);
|
|
70
72
|
get accounts(): AccountsClient;
|
|
@@ -95,6 +97,7 @@ export declare class PylonClient {
|
|
|
95
97
|
get ticketForms(): TicketFormsClient;
|
|
96
98
|
get trainingData(): TrainingDataClient;
|
|
97
99
|
get userRoles(): UserRolesClient;
|
|
100
|
+
get userStatuses(): UserStatusesClient;
|
|
98
101
|
get users(): UsersClient;
|
|
99
102
|
/**
|
|
100
103
|
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
|
package/dist/cjs/Client.js
CHANGED
|
@@ -72,7 +72,8 @@ const Client_js_25 = require("./api/resources/teams/client/Client.js");
|
|
|
72
72
|
const Client_js_26 = require("./api/resources/ticketForms/client/Client.js");
|
|
73
73
|
const Client_js_27 = require("./api/resources/trainingData/client/Client.js");
|
|
74
74
|
const Client_js_28 = require("./api/resources/userRoles/client/Client.js");
|
|
75
|
-
const Client_js_29 = require("./api/resources/
|
|
75
|
+
const Client_js_29 = require("./api/resources/userStatuses/client/Client.js");
|
|
76
|
+
const Client_js_30 = require("./api/resources/users/client/Client.js");
|
|
76
77
|
const BaseClient_js_1 = require("./BaseClient.js");
|
|
77
78
|
const core = __importStar(require("./core/index.js"));
|
|
78
79
|
class PylonClient {
|
|
@@ -191,9 +192,13 @@ class PylonClient {
|
|
|
191
192
|
var _a;
|
|
192
193
|
return ((_a = this._userRoles) !== null && _a !== void 0 ? _a : (this._userRoles = new Client_js_28.UserRolesClient(this._options)));
|
|
193
194
|
}
|
|
195
|
+
get userStatuses() {
|
|
196
|
+
var _a;
|
|
197
|
+
return ((_a = this._userStatuses) !== null && _a !== void 0 ? _a : (this._userStatuses = new Client_js_29.UserStatusesClient(this._options)));
|
|
198
|
+
}
|
|
194
199
|
get users() {
|
|
195
200
|
var _a;
|
|
196
|
-
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new
|
|
201
|
+
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_30.UsersClient(this._options)));
|
|
197
202
|
}
|
|
198
203
|
/**
|
|
199
204
|
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
|
|
@@ -3,6 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"
|
|
|
3
3
|
import * as core from "../../../../core/index.js";
|
|
4
4
|
import * as Pylon from "../../../index.js";
|
|
5
5
|
import { ActivitiesClient } from "../resources/activities/client/Client.js";
|
|
6
|
+
import { EmailActivitiesClient } from "../resources/emailActivities/client/Client.js";
|
|
6
7
|
import { HighlightsClient } from "../resources/highlights/client/Client.js";
|
|
7
8
|
import { NotebookBlocksClient } from "../resources/notebookBlocks/client/Client.js";
|
|
8
9
|
import { RelationshipsClient } from "../resources/relationships/client/Client.js";
|
|
@@ -16,11 +17,13 @@ export declare class AccountsClient {
|
|
|
16
17
|
protected _highlights: HighlightsClient | undefined;
|
|
17
18
|
protected _relationships: RelationshipsClient | undefined;
|
|
18
19
|
protected _activities: ActivitiesClient | undefined;
|
|
20
|
+
protected _emailActivities: EmailActivitiesClient | undefined;
|
|
19
21
|
protected _notebookBlocks: NotebookBlocksClient | undefined;
|
|
20
22
|
constructor(options: AccountsClient.Options);
|
|
21
23
|
get highlights(): HighlightsClient;
|
|
22
24
|
get relationships(): RelationshipsClient;
|
|
23
25
|
get activities(): ActivitiesClient;
|
|
26
|
+
get emailActivities(): EmailActivitiesClient;
|
|
24
27
|
get notebookBlocks(): NotebookBlocksClient;
|
|
25
28
|
/**
|
|
26
29
|
* Returns a paginated list of accounts for the organization.
|
|
@@ -64,28 +64,33 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
|
|
|
64
64
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
65
65
|
const Pylon = __importStar(require("../../../index.js"));
|
|
66
66
|
const Client_js_1 = require("../resources/activities/client/Client.js");
|
|
67
|
-
const Client_js_2 = require("../resources/
|
|
68
|
-
const Client_js_3 = require("../resources/
|
|
69
|
-
const Client_js_4 = require("../resources/
|
|
67
|
+
const Client_js_2 = require("../resources/emailActivities/client/Client.js");
|
|
68
|
+
const Client_js_3 = require("../resources/highlights/client/Client.js");
|
|
69
|
+
const Client_js_4 = require("../resources/notebookBlocks/client/Client.js");
|
|
70
|
+
const Client_js_5 = require("../resources/relationships/client/Client.js");
|
|
70
71
|
class AccountsClient {
|
|
71
72
|
constructor(options) {
|
|
72
73
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
73
74
|
}
|
|
74
75
|
get highlights() {
|
|
75
76
|
var _a;
|
|
76
|
-
return ((_a = this._highlights) !== null && _a !== void 0 ? _a : (this._highlights = new
|
|
77
|
+
return ((_a = this._highlights) !== null && _a !== void 0 ? _a : (this._highlights = new Client_js_3.HighlightsClient(this._options)));
|
|
77
78
|
}
|
|
78
79
|
get relationships() {
|
|
79
80
|
var _a;
|
|
80
|
-
return ((_a = this._relationships) !== null && _a !== void 0 ? _a : (this._relationships = new
|
|
81
|
+
return ((_a = this._relationships) !== null && _a !== void 0 ? _a : (this._relationships = new Client_js_5.RelationshipsClient(this._options)));
|
|
81
82
|
}
|
|
82
83
|
get activities() {
|
|
83
84
|
var _a;
|
|
84
85
|
return ((_a = this._activities) !== null && _a !== void 0 ? _a : (this._activities = new Client_js_1.ActivitiesClient(this._options)));
|
|
85
86
|
}
|
|
87
|
+
get emailActivities() {
|
|
88
|
+
var _a;
|
|
89
|
+
return ((_a = this._emailActivities) !== null && _a !== void 0 ? _a : (this._emailActivities = new Client_js_2.EmailActivitiesClient(this._options)));
|
|
90
|
+
}
|
|
86
91
|
get notebookBlocks() {
|
|
87
92
|
var _a;
|
|
88
|
-
return ((_a = this._notebookBlocks) !== null && _a !== void 0 ? _a : (this._notebookBlocks = new
|
|
93
|
+
return ((_a = this._notebookBlocks) !== null && _a !== void 0 ? _a : (this._notebookBlocks = new Client_js_4.NotebookBlocksClient(this._options)));
|
|
89
94
|
}
|
|
90
95
|
/**
|
|
91
96
|
* Returns a paginated list of accounts for the organization.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../../../core/index.js";
|
|
4
|
+
import * as Pylon from "../../../../../index.js";
|
|
5
|
+
export declare namespace EmailActivitiesClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class EmailActivitiesClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<EmailActivitiesClient.Options>;
|
|
12
|
+
constructor(options: EmailActivitiesClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Returns email threads synced to the specified account from connected Gmail and Outlook inboxes, ordered by their latest email from newest to oldest.
|
|
15
|
+
* The {id} parameter accepts either:
|
|
16
|
+
* Internal account ID (UUID format)
|
|
17
|
+
* External ID (any string format)
|
|
18
|
+
*
|
|
19
|
+
* **Rate limit:** 120 requests per minute
|
|
20
|
+
*
|
|
21
|
+
* @param {Pylon.accounts.AccountsEmailActivitiesListRequest} request
|
|
22
|
+
* @param {EmailActivitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
23
|
+
*
|
|
24
|
+
* @throws {@link Pylon.BadRequestError}
|
|
25
|
+
* @throws {@link Pylon.UnauthorizedError}
|
|
26
|
+
* @throws {@link Pylon.ForbiddenError}
|
|
27
|
+
* @throws {@link Pylon.NotFoundError}
|
|
28
|
+
* @throws {@link Pylon.TooManyRequestsError}
|
|
29
|
+
* @throws {@link Pylon.InternalServerError}
|
|
30
|
+
* @throws {@link errors.PylonError}
|
|
31
|
+
* @throws {@link errors.PylonTimeoutError}
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* await client.accounts.emailActivities.list({
|
|
35
|
+
* account_id: "id"
|
|
36
|
+
* })
|
|
37
|
+
*/
|
|
38
|
+
list(request: Pylon.accounts.AccountsEmailActivitiesListRequest, requestOptions?: EmailActivitiesClient.RequestOptions): Promise<core.Page<Pylon.EmailActivity, Pylon.GetEmailActivitiesResponseBody>>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.EmailActivitiesClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../../../BaseClient.js");
|
|
48
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
49
|
+
const core = __importStar(require("../../../../../../core/index.js"));
|
|
50
|
+
const environments = __importStar(require("../../../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
|
|
52
|
+
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
53
|
+
const Pylon = __importStar(require("../../../../../index.js"));
|
|
54
|
+
class EmailActivitiesClient {
|
|
55
|
+
constructor(options) {
|
|
56
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Returns email threads synced to the specified account from connected Gmail and Outlook inboxes, ordered by their latest email from newest to oldest.
|
|
60
|
+
* The {id} parameter accepts either:
|
|
61
|
+
* Internal account ID (UUID format)
|
|
62
|
+
* External ID (any string format)
|
|
63
|
+
*
|
|
64
|
+
* **Rate limit:** 120 requests per minute
|
|
65
|
+
*
|
|
66
|
+
* @param {Pylon.accounts.AccountsEmailActivitiesListRequest} request
|
|
67
|
+
* @param {EmailActivitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
68
|
+
*
|
|
69
|
+
* @throws {@link Pylon.BadRequestError}
|
|
70
|
+
* @throws {@link Pylon.UnauthorizedError}
|
|
71
|
+
* @throws {@link Pylon.ForbiddenError}
|
|
72
|
+
* @throws {@link Pylon.NotFoundError}
|
|
73
|
+
* @throws {@link Pylon.TooManyRequestsError}
|
|
74
|
+
* @throws {@link Pylon.InternalServerError}
|
|
75
|
+
* @throws {@link errors.PylonError}
|
|
76
|
+
* @throws {@link errors.PylonTimeoutError}
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* await client.accounts.emailActivities.list({
|
|
80
|
+
* account_id: "id"
|
|
81
|
+
* })
|
|
82
|
+
*/
|
|
83
|
+
list(request, requestOptions) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
87
|
+
const { account_id: accountId, start_time: startTime, end_time: endTime, cursor, limit } = request;
|
|
88
|
+
const _queryParams = {
|
|
89
|
+
start_time: startTime != null ? startTime : undefined,
|
|
90
|
+
end_time: endTime != null ? endTime : undefined,
|
|
91
|
+
cursor,
|
|
92
|
+
limit,
|
|
93
|
+
};
|
|
94
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
95
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
96
|
+
const _response = yield core.fetcher({
|
|
97
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PylonEnvironment.Us, `accounts/${core.url.encodePathParam(accountId)}/email-activities`),
|
|
98
|
+
method: "GET",
|
|
99
|
+
headers: _headers,
|
|
100
|
+
queryString: core.url
|
|
101
|
+
.queryBuilder()
|
|
102
|
+
.addMany(_queryParams)
|
|
103
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
104
|
+
.build(),
|
|
105
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
106
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
107
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
108
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
109
|
+
logging: this._options.logging,
|
|
110
|
+
});
|
|
111
|
+
if (_response.ok) {
|
|
112
|
+
return {
|
|
113
|
+
data: _response.body,
|
|
114
|
+
rawResponse: _response.rawResponse,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
if (_response.error.reason === "status-code") {
|
|
118
|
+
switch (_response.error.statusCode) {
|
|
119
|
+
case 400:
|
|
120
|
+
throw new Pylon.BadRequestError(_response.error.body, _response.rawResponse);
|
|
121
|
+
case 401:
|
|
122
|
+
throw new Pylon.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
123
|
+
case 403:
|
|
124
|
+
throw new Pylon.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
125
|
+
case 404:
|
|
126
|
+
throw new Pylon.NotFoundError(_response.error.body, _response.rawResponse);
|
|
127
|
+
case 429:
|
|
128
|
+
throw new Pylon.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
129
|
+
case 500:
|
|
130
|
+
throw new Pylon.InternalServerError(_response.error.body, _response.rawResponse);
|
|
131
|
+
default:
|
|
132
|
+
throw new errors.PylonError({
|
|
133
|
+
statusCode: _response.error.statusCode,
|
|
134
|
+
body: _response.error.body,
|
|
135
|
+
rawResponse: _response.rawResponse,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/accounts/{account_id}/email-activities");
|
|
140
|
+
}));
|
|
141
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
142
|
+
return new core.Page({
|
|
143
|
+
response: dataWithRawResponse.data,
|
|
144
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
145
|
+
hasNextPage: (response) => {
|
|
146
|
+
var _a, _b, _c;
|
|
147
|
+
return ((_a = response === null || response === void 0 ? void 0 : response.pagination) === null || _a === void 0 ? void 0 : _a.cursor) != null &&
|
|
148
|
+
!(typeof ((_b = response === null || response === void 0 ? void 0 : response.pagination) === null || _b === void 0 ? void 0 : _b.cursor) === "string" && ((_c = response === null || response === void 0 ? void 0 : response.pagination) === null || _c === void 0 ? void 0 : _c.cursor) === "");
|
|
149
|
+
},
|
|
150
|
+
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.data) !== null && _a !== void 0 ? _a : []; },
|
|
151
|
+
loadPage: (response) => {
|
|
152
|
+
var _a;
|
|
153
|
+
return list(core.setObjectProperty(request, "cursor", (_a = response === null || response === void 0 ? void 0 : response.pagination) === null || _a === void 0 ? void 0 : _a.cursor));
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
exports.EmailActivitiesClient = EmailActivitiesClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* account_id: "id"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface AccountsEmailActivitiesListRequest {
|
|
8
|
+
/** The ID or external ID of the account to fetch email activities for. */
|
|
9
|
+
account_id: string;
|
|
10
|
+
/** The start time (RFC3339) of the activity time range, compared against each thread's latest email. */
|
|
11
|
+
start_time?: string;
|
|
12
|
+
/** The end time (RFC3339) of the activity time range, compared against each thread's latest email. */
|
|
13
|
+
end_time?: string;
|
|
14
|
+
/** The cursor to use for pagination. */
|
|
15
|
+
cursor?: string;
|
|
16
|
+
/** The number of email activities to fetch. Defaults to 20. Must be greater than 0 and less than or equal to 50. */
|
|
17
|
+
limit?: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { AccountsEmailActivitiesListRequest } from "./AccountsEmailActivitiesListRequest.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.EmailActivitiesClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "EmailActivitiesClient", { enumerable: true, get: function () { return Client_js_1.EmailActivitiesClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from "./activities/client/requests/index.js";
|
|
2
2
|
export * as activities from "./activities/index.js";
|
|
3
|
+
export * from "./emailActivities/client/requests/index.js";
|
|
4
|
+
export * as emailActivities from "./emailActivities/index.js";
|
|
3
5
|
export * from "./highlights/client/requests/index.js";
|
|
4
6
|
export * as highlights from "./highlights/index.js";
|
|
5
7
|
export * as notebookBlocks from "./notebookBlocks/index.js";
|
|
@@ -36,9 +36,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.relationships = exports.notebookBlocks = exports.highlights = exports.activities = void 0;
|
|
39
|
+
exports.relationships = exports.notebookBlocks = exports.highlights = exports.emailActivities = exports.activities = void 0;
|
|
40
40
|
__exportStar(require("./activities/client/requests/index.js"), exports);
|
|
41
41
|
exports.activities = __importStar(require("./activities/index.js"));
|
|
42
|
+
__exportStar(require("./emailActivities/client/requests/index.js"), exports);
|
|
43
|
+
exports.emailActivities = __importStar(require("./emailActivities/index.js"));
|
|
42
44
|
__exportStar(require("./highlights/client/requests/index.js"), exports);
|
|
43
45
|
exports.highlights = __importStar(require("./highlights/index.js"));
|
|
44
46
|
exports.notebookBlocks = __importStar(require("./notebookBlocks/index.js"));
|
|
@@ -55,6 +55,31 @@ export declare class ContactsClient {
|
|
|
55
55
|
*/
|
|
56
56
|
create(request: Pylon.ContactsCreateRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<Pylon.CreateContactResponseBody>;
|
|
57
57
|
private __create;
|
|
58
|
+
/**
|
|
59
|
+
* Merges a contact into a surviving contact. If the merged contact belongs to a different account, it is first moved to the surviving contact's account. Issues, emails, phone numbers, survey responses, and other associated data are then transferred to the surviving contact, and the merged contact is permanently deleted. This cannot be undone.
|
|
60
|
+
*
|
|
61
|
+
* **Rate limit:** 30 requests per minute
|
|
62
|
+
*
|
|
63
|
+
* @param {Pylon.ContactsMergeRequest} request
|
|
64
|
+
* @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
65
|
+
*
|
|
66
|
+
* @throws {@link Pylon.BadRequestError}
|
|
67
|
+
* @throws {@link Pylon.UnauthorizedError}
|
|
68
|
+
* @throws {@link Pylon.ForbiddenError}
|
|
69
|
+
* @throws {@link Pylon.NotFoundError}
|
|
70
|
+
* @throws {@link Pylon.TooManyRequestsError}
|
|
71
|
+
* @throws {@link Pylon.InternalServerError}
|
|
72
|
+
* @throws {@link errors.PylonError}
|
|
73
|
+
* @throws {@link errors.PylonTimeoutError}
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* await client.contacts.merge({
|
|
77
|
+
* merge_contact_id: "merge_contact_id",
|
|
78
|
+
* merge_into_contact_id: "merge_into_contact_id"
|
|
79
|
+
* })
|
|
80
|
+
*/
|
|
81
|
+
merge(request: Pylon.ContactsMergeRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<Pylon.MergeContactsResponseBody>;
|
|
82
|
+
private __merge;
|
|
58
83
|
/**
|
|
59
84
|
* Filterable fields and their allowed operators:
|
|
60
85
|
*
|
|
@@ -232,6 +232,79 @@ class ContactsClient {
|
|
|
232
232
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/contacts");
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Merges a contact into a surviving contact. If the merged contact belongs to a different account, it is first moved to the surviving contact's account. Issues, emails, phone numbers, survey responses, and other associated data are then transferred to the surviving contact, and the merged contact is permanently deleted. This cannot be undone.
|
|
237
|
+
*
|
|
238
|
+
* **Rate limit:** 30 requests per minute
|
|
239
|
+
*
|
|
240
|
+
* @param {Pylon.ContactsMergeRequest} request
|
|
241
|
+
* @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
242
|
+
*
|
|
243
|
+
* @throws {@link Pylon.BadRequestError}
|
|
244
|
+
* @throws {@link Pylon.UnauthorizedError}
|
|
245
|
+
* @throws {@link Pylon.ForbiddenError}
|
|
246
|
+
* @throws {@link Pylon.NotFoundError}
|
|
247
|
+
* @throws {@link Pylon.TooManyRequestsError}
|
|
248
|
+
* @throws {@link Pylon.InternalServerError}
|
|
249
|
+
* @throws {@link errors.PylonError}
|
|
250
|
+
* @throws {@link errors.PylonTimeoutError}
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* await client.contacts.merge({
|
|
254
|
+
* merge_contact_id: "merge_contact_id",
|
|
255
|
+
* merge_into_contact_id: "merge_into_contact_id"
|
|
256
|
+
* })
|
|
257
|
+
*/
|
|
258
|
+
merge(request, requestOptions) {
|
|
259
|
+
return core.HttpResponsePromise.fromPromise(this.__merge(request, requestOptions));
|
|
260
|
+
}
|
|
261
|
+
__merge(request, requestOptions) {
|
|
262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
264
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
265
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
266
|
+
const _response = yield core.fetcher({
|
|
267
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PylonEnvironment.Us, "contacts/merge"),
|
|
268
|
+
method: "POST",
|
|
269
|
+
headers: _headers,
|
|
270
|
+
contentType: "application/json",
|
|
271
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
272
|
+
requestType: "json",
|
|
273
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
274
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
275
|
+
maxRetries: 0,
|
|
276
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
277
|
+
fetchFn: (_g = this._options) === null || _g === void 0 ? void 0 : _g.fetch,
|
|
278
|
+
logging: this._options.logging,
|
|
279
|
+
});
|
|
280
|
+
if (_response.ok) {
|
|
281
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
282
|
+
}
|
|
283
|
+
if (_response.error.reason === "status-code") {
|
|
284
|
+
switch (_response.error.statusCode) {
|
|
285
|
+
case 400:
|
|
286
|
+
throw new Pylon.BadRequestError(_response.error.body, _response.rawResponse);
|
|
287
|
+
case 401:
|
|
288
|
+
throw new Pylon.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
289
|
+
case 403:
|
|
290
|
+
throw new Pylon.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
291
|
+
case 404:
|
|
292
|
+
throw new Pylon.NotFoundError(_response.error.body, _response.rawResponse);
|
|
293
|
+
case 429:
|
|
294
|
+
throw new Pylon.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
295
|
+
case 500:
|
|
296
|
+
throw new Pylon.InternalServerError(_response.error.body, _response.rawResponse);
|
|
297
|
+
default:
|
|
298
|
+
throw new errors.PylonError({
|
|
299
|
+
statusCode: _response.error.statusCode,
|
|
300
|
+
body: _response.error.body,
|
|
301
|
+
rawResponse: _response.rawResponse,
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/contacts/merge");
|
|
306
|
+
});
|
|
307
|
+
}
|
|
235
308
|
/**
|
|
236
309
|
* Filterable fields and their allowed operators:
|
|
237
310
|
*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* merge_contact_id: "merge_contact_id",
|
|
5
|
+
* merge_into_contact_id: "merge_into_contact_id"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface ContactsMergeRequest {
|
|
9
|
+
/** The ID of the contact to merge into the surviving contact. This contact is permanently deleted after its data is transferred. */
|
|
10
|
+
merge_contact_id: string;
|
|
11
|
+
/** The ID of the contact that will survive the merge and receive the merged data. The contact must belong to an account. */
|
|
12
|
+
merge_into_contact_id: string;
|
|
13
|
+
}
|
|
@@ -2,5 +2,6 @@ export type { ContactsCreateRequest } from "./ContactsCreateRequest.js";
|
|
|
2
2
|
export type { ContactsDeleteRequest } from "./ContactsDeleteRequest.js";
|
|
3
3
|
export type { ContactsGetRequest } from "./ContactsGetRequest.js";
|
|
4
4
|
export type { ContactsListRequest } from "./ContactsListRequest.js";
|
|
5
|
+
export type { ContactsMergeRequest } from "./ContactsMergeRequest.js";
|
|
5
6
|
export type { ContactsSearchRequest } from "./ContactsSearchRequest.js";
|
|
6
7
|
export type { ContactsUpdateRequest } from "./ContactsUpdateRequest.js";
|
|
@@ -49,5 +49,6 @@ export * as ticketForms from "./ticketForms/index.js";
|
|
|
49
49
|
export * from "./trainingData/client/requests/index.js";
|
|
50
50
|
export * as trainingData from "./trainingData/index.js";
|
|
51
51
|
export * as userRoles from "./userRoles/index.js";
|
|
52
|
+
export * as userStatuses from "./userStatuses/index.js";
|
|
52
53
|
export * from "./users/client/requests/index.js";
|
|
53
54
|
export * as users from "./users/index.js";
|
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.users = exports.userRoles = exports.trainingData = exports.ticketForms = exports.teams = exports.tasks = exports.taskStatuses = exports.tags = exports.surveys = exports.projects = exports.milestones = exports.me = exports.macros = exports.macroGroups = exports.knowledgeBases = exports.issues = exports.issueStatuses = exports.issueGroups = exports.featureRequests = exports.emailSuppressions = exports.customObjects = exports.customFields = exports.contacts = exports.callRecordings = exports.auditLogs = exports.attachments = exports.articleFeedback = exports.activityTypes = exports.accounts = void 0;
|
|
39
|
+
exports.users = exports.userStatuses = exports.userRoles = exports.trainingData = exports.ticketForms = exports.teams = exports.tasks = exports.taskStatuses = exports.tags = exports.surveys = exports.projects = exports.milestones = exports.me = exports.macros = exports.macroGroups = exports.knowledgeBases = exports.issues = exports.issueStatuses = exports.issueGroups = exports.featureRequests = exports.emailSuppressions = exports.customObjects = exports.customFields = exports.contacts = exports.callRecordings = exports.auditLogs = exports.attachments = exports.articleFeedback = exports.activityTypes = exports.accounts = void 0;
|
|
40
40
|
__exportStar(require("./accounts/client/requests/index.js"), exports);
|
|
41
41
|
exports.accounts = __importStar(require("./accounts/index.js"));
|
|
42
42
|
exports.activityTypes = __importStar(require("./activityTypes/index.js"));
|
|
@@ -88,5 +88,6 @@ exports.ticketForms = __importStar(require("./ticketForms/index.js"));
|
|
|
88
88
|
__exportStar(require("./trainingData/client/requests/index.js"), exports);
|
|
89
89
|
exports.trainingData = __importStar(require("./trainingData/index.js"));
|
|
90
90
|
exports.userRoles = __importStar(require("./userRoles/index.js"));
|
|
91
|
+
exports.userStatuses = __importStar(require("./userStatuses/index.js"));
|
|
91
92
|
__exportStar(require("./users/client/requests/index.js"), exports);
|
|
92
93
|
exports.users = __importStar(require("./users/index.js"));
|
|
@@ -8,8 +8,14 @@
|
|
|
8
8
|
export interface IssuesCreateDraftReplyRequest {
|
|
9
9
|
/** The ID of the issue. */
|
|
10
10
|
issue_id: string;
|
|
11
|
+
/** The draft's BCC recipients. See to_emails. */
|
|
12
|
+
bcc_emails?: string[];
|
|
11
13
|
/** The draft body in HTML. */
|
|
12
14
|
body_html: string;
|
|
15
|
+
/** The draft's CC recipients. See to_emails. */
|
|
16
|
+
cc_emails?: string[];
|
|
17
|
+
/** The draft's To recipients. If any of to_emails, cc_emails, or bcc_emails is provided, the draft uses exactly those lists and an omitted list is saved empty; omit all three to use the composer's default recipients. */
|
|
18
|
+
to_emails?: string[];
|
|
13
19
|
/** The active Pylon user who should own and see the draft. Defaults to the API-token user when it is a human Pylon user; required for unlinked or service API tokens. */
|
|
14
20
|
user_id?: string;
|
|
15
21
|
}
|