@usepylon/sdk 0.1.0-beta.1 → 0.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.js +1 -1
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +51 -46
- package/dist/cjs/api/resources/customerPortal/client/Client.d.ts +53 -0
- package/dist/cjs/api/resources/customerPortal/client/Client.js +193 -0
- package/dist/cjs/api/resources/customerPortal/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/customerPortal/client/index.js +17 -0
- package/dist/cjs/api/resources/customerPortal/client/requests/CustomerPortalUpdateSettingsRequest.d.ts +15 -0
- package/dist/cjs/api/resources/customerPortal/client/requests/CustomerPortalUpdateSettingsRequest.js +3 -0
- package/dist/cjs/api/resources/customerPortal/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/customerPortal/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/customerPortal/exports.d.ts +2 -0
- package/dist/cjs/api/resources/customerPortal/exports.js +21 -0
- package/dist/cjs/api/resources/customerPortal/index.d.ts +1 -0
- package/dist/cjs/api/resources/customerPortal/index.js +17 -0
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/resources/users/client/Client.d.ts +25 -0
- package/dist/cjs/api/resources/users/client/Client.js +71 -0
- package/dist/cjs/api/resources/users/client/requests/UsersInviteRequest.d.ts +15 -0
- package/dist/cjs/api/resources/users/client/requests/UsersInviteRequest.js +3 -0
- package/dist/cjs/api/resources/users/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/types/CustomerPortalAccessSettings.d.ts +16 -0
- package/dist/cjs/api/types/CustomerPortalAccessSettings.js +3 -0
- package/dist/cjs/api/types/CustomerPortalBranding.d.ts +14 -0
- package/dist/cjs/api/types/CustomerPortalBranding.js +3 -0
- package/dist/cjs/api/types/CustomerPortalDisplaySettings.d.ts +8 -0
- package/dist/cjs/api/types/CustomerPortalDisplaySettings.js +3 -0
- package/dist/cjs/api/types/CustomerPortalFooterCategory.d.ts +7 -0
- package/dist/cjs/api/types/CustomerPortalFooterCategory.js +3 -0
- package/dist/cjs/api/types/CustomerPortalLink.d.ts +6 -0
- package/dist/cjs/api/types/CustomerPortalLink.js +3 -0
- package/dist/cjs/api/types/CustomerPortalNavigation.d.ts +7 -0
- package/dist/cjs/api/types/CustomerPortalNavigation.js +3 -0
- package/dist/cjs/api/types/CustomerPortalSettings.d.ts +11 -0
- package/dist/cjs/api/types/CustomerPortalSettings.js +3 -0
- package/dist/cjs/api/types/CustomerPortalTabs.d.ts +8 -0
- package/dist/cjs/api/types/CustomerPortalTabs.js +3 -0
- package/dist/cjs/api/types/CustomerPortalUserPermissions.d.ts +8 -0
- package/dist/cjs/api/types/CustomerPortalUserPermissions.js +3 -0
- package/dist/cjs/api/types/ErrorApiResponseBody.d.ts +7 -1
- package/dist/cjs/api/types/Filter.d.ts +6 -3
- package/dist/cjs/api/types/Filter.js +1 -1
- package/dist/cjs/api/types/FilterError.d.ts +26 -0
- package/dist/cjs/api/types/FilterError.js +3 -0
- package/dist/cjs/api/types/FilterRelatedObject.d.ts +14 -0
- package/dist/cjs/api/types/FilterRelatedObject.js +3 -0
- package/dist/cjs/api/types/GetCustomerPortalSettingsResponseBody.d.ts +6 -0
- package/dist/cjs/api/types/GetCustomerPortalSettingsResponseBody.js +3 -0
- package/dist/cjs/api/types/IssueThread.d.ts +6 -0
- package/dist/cjs/api/types/TicketFormLayoutField.d.ts +9 -1
- package/dist/cjs/api/types/UpdateCustomerPortalAccessSettings.d.ts +16 -0
- package/dist/cjs/api/types/UpdateCustomerPortalAccessSettings.js +3 -0
- package/dist/cjs/api/types/UpdateCustomerPortalBranding.d.ts +14 -0
- package/dist/cjs/api/types/UpdateCustomerPortalBranding.js +3 -0
- package/dist/cjs/api/types/UpdateCustomerPortalDisplaySettings.d.ts +8 -0
- package/dist/cjs/api/types/UpdateCustomerPortalDisplaySettings.js +3 -0
- package/dist/cjs/api/types/UpdateCustomerPortalNavigation.d.ts +7 -0
- package/dist/cjs/api/types/UpdateCustomerPortalNavigation.js +3 -0
- package/dist/cjs/api/types/UpdateCustomerPortalTabs.d.ts +8 -0
- package/dist/cjs/api/types/UpdateCustomerPortalTabs.js +3 -0
- package/dist/cjs/api/types/UpdateCustomerPortalUserPermissions.d.ts +8 -0
- package/dist/cjs/api/types/UpdateCustomerPortalUserPermissions.js +3 -0
- package/dist/cjs/api/types/index.d.ts +18 -0
- package/dist/cjs/api/types/index.js +18 -0
- package/dist/esm/BaseClient.js +1 -1
- package/dist/esm/Client.d.ts +3 -0
- package/dist/esm/Client.js +5 -0
- package/dist/esm/api/resources/customerPortal/client/Client.d.ts +53 -0
- package/dist/esm/api/resources/customerPortal/client/Client.js +156 -0
- package/dist/esm/api/resources/customerPortal/client/index.d.ts +1 -0
- package/dist/esm/api/resources/customerPortal/client/index.js +1 -0
- package/dist/esm/api/resources/customerPortal/client/requests/CustomerPortalUpdateSettingsRequest.d.ts +15 -0
- package/dist/esm/api/resources/customerPortal/client/requests/CustomerPortalUpdateSettingsRequest.js +2 -0
- package/dist/esm/api/resources/customerPortal/client/requests/index.d.ts +1 -0
- package/dist/esm/api/resources/customerPortal/client/requests/index.js +1 -0
- package/dist/esm/api/resources/customerPortal/exports.d.ts +2 -0
- package/dist/esm/api/resources/customerPortal/exports.js +3 -0
- package/dist/esm/api/resources/customerPortal/index.d.ts +1 -0
- package/dist/esm/api/resources/customerPortal/index.js +1 -0
- package/dist/esm/api/resources/index.d.ts +2 -0
- package/dist/esm/api/resources/index.js +2 -0
- package/dist/esm/api/resources/users/client/Client.d.ts +25 -0
- package/dist/esm/api/resources/users/client/Client.js +71 -0
- package/dist/esm/api/resources/users/client/requests/UsersInviteRequest.d.ts +15 -0
- package/dist/esm/api/resources/users/client/requests/UsersInviteRequest.js +2 -0
- package/dist/esm/api/resources/users/client/requests/index.d.ts +1 -0
- package/dist/esm/api/types/CustomerPortalAccessSettings.d.ts +16 -0
- package/dist/esm/api/types/CustomerPortalAccessSettings.js +2 -0
- package/dist/esm/api/types/CustomerPortalBranding.d.ts +14 -0
- package/dist/esm/api/types/CustomerPortalBranding.js +2 -0
- package/dist/esm/api/types/CustomerPortalDisplaySettings.d.ts +8 -0
- package/dist/esm/api/types/CustomerPortalDisplaySettings.js +2 -0
- package/dist/esm/api/types/CustomerPortalFooterCategory.d.ts +7 -0
- package/dist/esm/api/types/CustomerPortalFooterCategory.js +2 -0
- package/dist/esm/api/types/CustomerPortalLink.d.ts +6 -0
- package/dist/esm/api/types/CustomerPortalLink.js +2 -0
- package/dist/esm/api/types/CustomerPortalNavigation.d.ts +7 -0
- package/dist/esm/api/types/CustomerPortalNavigation.js +2 -0
- package/dist/esm/api/types/CustomerPortalSettings.d.ts +11 -0
- package/dist/esm/api/types/CustomerPortalSettings.js +2 -0
- package/dist/esm/api/types/CustomerPortalTabs.d.ts +8 -0
- package/dist/esm/api/types/CustomerPortalTabs.js +2 -0
- package/dist/esm/api/types/CustomerPortalUserPermissions.d.ts +8 -0
- package/dist/esm/api/types/CustomerPortalUserPermissions.js +2 -0
- package/dist/esm/api/types/ErrorApiResponseBody.d.ts +7 -1
- package/dist/esm/api/types/Filter.d.ts +6 -3
- package/dist/esm/api/types/Filter.js +1 -1
- package/dist/esm/api/types/FilterError.d.ts +26 -0
- package/dist/esm/api/types/FilterError.js +2 -0
- package/dist/esm/api/types/FilterRelatedObject.d.ts +14 -0
- package/dist/esm/api/types/FilterRelatedObject.js +2 -0
- package/dist/esm/api/types/GetCustomerPortalSettingsResponseBody.d.ts +6 -0
- package/dist/esm/api/types/GetCustomerPortalSettingsResponseBody.js +2 -0
- package/dist/esm/api/types/IssueThread.d.ts +6 -0
- package/dist/esm/api/types/TicketFormLayoutField.d.ts +9 -1
- package/dist/esm/api/types/UpdateCustomerPortalAccessSettings.d.ts +16 -0
- package/dist/esm/api/types/UpdateCustomerPortalAccessSettings.js +2 -0
- package/dist/esm/api/types/UpdateCustomerPortalBranding.d.ts +14 -0
- package/dist/esm/api/types/UpdateCustomerPortalBranding.js +2 -0
- package/dist/esm/api/types/UpdateCustomerPortalDisplaySettings.d.ts +8 -0
- package/dist/esm/api/types/UpdateCustomerPortalDisplaySettings.js +2 -0
- package/dist/esm/api/types/UpdateCustomerPortalNavigation.d.ts +7 -0
- package/dist/esm/api/types/UpdateCustomerPortalNavigation.js +2 -0
- package/dist/esm/api/types/UpdateCustomerPortalTabs.d.ts +8 -0
- package/dist/esm/api/types/UpdateCustomerPortalTabs.js +2 -0
- package/dist/esm/api/types/UpdateCustomerPortalUserPermissions.d.ts +8 -0
- package/dist/esm/api/types/UpdateCustomerPortalUserPermissions.js +2 -0
- package/dist/esm/api/types/index.d.ts +18 -0
- package/dist/esm/api/types/index.js +18 -0
- package/package.json +1 -1
package/dist/esm/BaseClient.js
CHANGED
|
@@ -5,7 +5,7 @@ import * as core from "./core/index.js";
|
|
|
5
5
|
export function normalizeClientOptions(options) {
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
|
-
"User-Agent": "@usepylon/sdk/0.1.0-beta.
|
|
8
|
+
"User-Agent": "@usepylon/sdk/0.1.0-beta.2",
|
|
9
9
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
10
10
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
11
11
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/esm/Client.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { AttachmentsClient } from "./api/resources/attachments/client/Client.js"
|
|
|
5
5
|
import { AuditLogsClient } from "./api/resources/auditLogs/client/Client.js";
|
|
6
6
|
import { CallRecordingsClient } from "./api/resources/callRecordings/client/Client.js";
|
|
7
7
|
import { ContactsClient } from "./api/resources/contacts/client/Client.js";
|
|
8
|
+
import { CustomerPortalClient } from "./api/resources/customerPortal/client/Client.js";
|
|
8
9
|
import { CustomFieldsClient } from "./api/resources/customFields/client/Client.js";
|
|
9
10
|
import { CustomObjectsClient } from "./api/resources/customObjects/client/Client.js";
|
|
10
11
|
import { EmailSuppressionsClient } from "./api/resources/emailSuppressions/client/Client.js";
|
|
@@ -47,6 +48,7 @@ export declare class PylonClient {
|
|
|
47
48
|
protected _contacts: ContactsClient | undefined;
|
|
48
49
|
protected _customFields: CustomFieldsClient | undefined;
|
|
49
50
|
protected _customObjects: CustomObjectsClient | undefined;
|
|
51
|
+
protected _customerPortal: CustomerPortalClient | undefined;
|
|
50
52
|
protected _emailSuppressions: EmailSuppressionsClient | undefined;
|
|
51
53
|
protected _featureRequests: FeatureRequestsClient | undefined;
|
|
52
54
|
protected _issueGroups: IssueGroupsClient | undefined;
|
|
@@ -78,6 +80,7 @@ export declare class PylonClient {
|
|
|
78
80
|
get contacts(): ContactsClient;
|
|
79
81
|
get customFields(): CustomFieldsClient;
|
|
80
82
|
get customObjects(): CustomObjectsClient;
|
|
83
|
+
get customerPortal(): CustomerPortalClient;
|
|
81
84
|
get emailSuppressions(): EmailSuppressionsClient;
|
|
82
85
|
get featureRequests(): FeatureRequestsClient;
|
|
83
86
|
get issueGroups(): IssueGroupsClient;
|
package/dist/esm/Client.js
CHANGED
|
@@ -15,6 +15,7 @@ import { AttachmentsClient } from "./api/resources/attachments/client/Client.js"
|
|
|
15
15
|
import { AuditLogsClient } from "./api/resources/auditLogs/client/Client.js";
|
|
16
16
|
import { CallRecordingsClient } from "./api/resources/callRecordings/client/Client.js";
|
|
17
17
|
import { ContactsClient } from "./api/resources/contacts/client/Client.js";
|
|
18
|
+
import { CustomerPortalClient } from "./api/resources/customerPortal/client/Client.js";
|
|
18
19
|
import { CustomFieldsClient } from "./api/resources/customFields/client/Client.js";
|
|
19
20
|
import { CustomObjectsClient } from "./api/resources/customObjects/client/Client.js";
|
|
20
21
|
import { EmailSuppressionsClient } from "./api/resources/emailSuppressions/client/Client.js";
|
|
@@ -80,6 +81,10 @@ export class PylonClient {
|
|
|
80
81
|
var _a;
|
|
81
82
|
return ((_a = this._customObjects) !== null && _a !== void 0 ? _a : (this._customObjects = new CustomObjectsClient(this._options)));
|
|
82
83
|
}
|
|
84
|
+
get customerPortal() {
|
|
85
|
+
var _a;
|
|
86
|
+
return ((_a = this._customerPortal) !== null && _a !== void 0 ? _a : (this._customerPortal = new CustomerPortalClient(this._options)));
|
|
87
|
+
}
|
|
83
88
|
get emailSuppressions() {
|
|
84
89
|
var _a;
|
|
85
90
|
return ((_a = this._emailSuppressions) !== null && _a !== void 0 ? _a : (this._emailSuppressions = new EmailSuppressionsClient(this._options)));
|
|
@@ -0,0 +1,53 @@
|
|
|
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 CustomerPortalClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class CustomerPortalClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<CustomerPortalClient.Options>;
|
|
12
|
+
constructor(options: CustomerPortalClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Returns the organization's customer portal settings.
|
|
15
|
+
*
|
|
16
|
+
* **Rate limit:** 120 requests per minute
|
|
17
|
+
*
|
|
18
|
+
* @param {CustomerPortalClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
19
|
+
*
|
|
20
|
+
* @throws {@link Pylon.UnauthorizedError}
|
|
21
|
+
* @throws {@link Pylon.ForbiddenError}
|
|
22
|
+
* @throws {@link Pylon.TooManyRequestsError}
|
|
23
|
+
* @throws {@link Pylon.InternalServerError}
|
|
24
|
+
* @throws {@link errors.PylonError}
|
|
25
|
+
* @throws {@link errors.PylonTimeoutError}
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* await client.customerPortal.getSettings()
|
|
29
|
+
*/
|
|
30
|
+
getSettings(requestOptions?: CustomerPortalClient.RequestOptions): core.HttpResponsePromise<Pylon.GetCustomerPortalSettingsResponseBody>;
|
|
31
|
+
private __getSettings;
|
|
32
|
+
/**
|
|
33
|
+
* Updates the organization's customer portal settings. Only provided fields are modified.
|
|
34
|
+
*
|
|
35
|
+
* **Rate limit:** 30 requests per minute
|
|
36
|
+
*
|
|
37
|
+
* @param {Pylon.CustomerPortalUpdateSettingsRequest} request
|
|
38
|
+
* @param {CustomerPortalClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link Pylon.BadRequestError}
|
|
41
|
+
* @throws {@link Pylon.UnauthorizedError}
|
|
42
|
+
* @throws {@link Pylon.ForbiddenError}
|
|
43
|
+
* @throws {@link Pylon.TooManyRequestsError}
|
|
44
|
+
* @throws {@link Pylon.InternalServerError}
|
|
45
|
+
* @throws {@link errors.PylonError}
|
|
46
|
+
* @throws {@link errors.PylonTimeoutError}
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* await client.customerPortal.updateSettings()
|
|
50
|
+
*/
|
|
51
|
+
updateSettings(request?: Pylon.CustomerPortalUpdateSettingsRequest, requestOptions?: CustomerPortalClient.RequestOptions): core.HttpResponsePromise<Pylon.GetCustomerPortalSettingsResponseBody>;
|
|
52
|
+
private __updateSettings;
|
|
53
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.js";
|
|
13
|
+
import * as core from "../../../../core/index.js";
|
|
14
|
+
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js";
|
|
15
|
+
import * as environments from "../../../../environments.js";
|
|
16
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
|
|
17
|
+
import * as errors from "../../../../errors/index.js";
|
|
18
|
+
import * as Pylon from "../../../index.js";
|
|
19
|
+
export class CustomerPortalClient {
|
|
20
|
+
constructor(options) {
|
|
21
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Returns the organization's customer portal settings.
|
|
25
|
+
*
|
|
26
|
+
* **Rate limit:** 120 requests per minute
|
|
27
|
+
*
|
|
28
|
+
* @param {CustomerPortalClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
|
+
*
|
|
30
|
+
* @throws {@link Pylon.UnauthorizedError}
|
|
31
|
+
* @throws {@link Pylon.ForbiddenError}
|
|
32
|
+
* @throws {@link Pylon.TooManyRequestsError}
|
|
33
|
+
* @throws {@link Pylon.InternalServerError}
|
|
34
|
+
* @throws {@link errors.PylonError}
|
|
35
|
+
* @throws {@link errors.PylonTimeoutError}
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* await client.customerPortal.getSettings()
|
|
39
|
+
*/
|
|
40
|
+
getSettings(requestOptions) {
|
|
41
|
+
return core.HttpResponsePromise.fromPromise(this.__getSettings(requestOptions));
|
|
42
|
+
}
|
|
43
|
+
__getSettings(requestOptions) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
46
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
47
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
48
|
+
const _response = yield core.fetcher({
|
|
49
|
+
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, "customer-portal/settings"),
|
|
50
|
+
method: "GET",
|
|
51
|
+
headers: _headers,
|
|
52
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
53
|
+
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,
|
|
54
|
+
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,
|
|
55
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
56
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
57
|
+
logging: this._options.logging,
|
|
58
|
+
});
|
|
59
|
+
if (_response.ok) {
|
|
60
|
+
return {
|
|
61
|
+
data: _response.body,
|
|
62
|
+
rawResponse: _response.rawResponse,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (_response.error.reason === "status-code") {
|
|
66
|
+
switch (_response.error.statusCode) {
|
|
67
|
+
case 401:
|
|
68
|
+
throw new Pylon.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
69
|
+
case 403:
|
|
70
|
+
throw new Pylon.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
71
|
+
case 429:
|
|
72
|
+
throw new Pylon.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
73
|
+
case 500:
|
|
74
|
+
throw new Pylon.InternalServerError(_response.error.body, _response.rawResponse);
|
|
75
|
+
default:
|
|
76
|
+
throw new errors.PylonError({
|
|
77
|
+
statusCode: _response.error.statusCode,
|
|
78
|
+
body: _response.error.body,
|
|
79
|
+
rawResponse: _response.rawResponse,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer-portal/settings");
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Updates the organization's customer portal settings. Only provided fields are modified.
|
|
88
|
+
*
|
|
89
|
+
* **Rate limit:** 30 requests per minute
|
|
90
|
+
*
|
|
91
|
+
* @param {Pylon.CustomerPortalUpdateSettingsRequest} request
|
|
92
|
+
* @param {CustomerPortalClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
93
|
+
*
|
|
94
|
+
* @throws {@link Pylon.BadRequestError}
|
|
95
|
+
* @throws {@link Pylon.UnauthorizedError}
|
|
96
|
+
* @throws {@link Pylon.ForbiddenError}
|
|
97
|
+
* @throws {@link Pylon.TooManyRequestsError}
|
|
98
|
+
* @throws {@link Pylon.InternalServerError}
|
|
99
|
+
* @throws {@link errors.PylonError}
|
|
100
|
+
* @throws {@link errors.PylonTimeoutError}
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* await client.customerPortal.updateSettings()
|
|
104
|
+
*/
|
|
105
|
+
updateSettings(request = {}, requestOptions) {
|
|
106
|
+
return core.HttpResponsePromise.fromPromise(this.__updateSettings(request, requestOptions));
|
|
107
|
+
}
|
|
108
|
+
__updateSettings() {
|
|
109
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
110
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
111
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
112
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
113
|
+
const _response = yield core.fetcher({
|
|
114
|
+
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, "customer-portal/settings"),
|
|
115
|
+
method: "PATCH",
|
|
116
|
+
headers: _headers,
|
|
117
|
+
contentType: "application/json",
|
|
118
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
119
|
+
requestType: "json",
|
|
120
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
121
|
+
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,
|
|
122
|
+
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,
|
|
123
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
124
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
125
|
+
logging: this._options.logging,
|
|
126
|
+
});
|
|
127
|
+
if (_response.ok) {
|
|
128
|
+
return {
|
|
129
|
+
data: _response.body,
|
|
130
|
+
rawResponse: _response.rawResponse,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
if (_response.error.reason === "status-code") {
|
|
134
|
+
switch (_response.error.statusCode) {
|
|
135
|
+
case 400:
|
|
136
|
+
throw new Pylon.BadRequestError(_response.error.body, _response.rawResponse);
|
|
137
|
+
case 401:
|
|
138
|
+
throw new Pylon.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
139
|
+
case 403:
|
|
140
|
+
throw new Pylon.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
141
|
+
case 429:
|
|
142
|
+
throw new Pylon.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
143
|
+
case 500:
|
|
144
|
+
throw new Pylon.InternalServerError(_response.error.body, _response.rawResponse);
|
|
145
|
+
default:
|
|
146
|
+
throw new errors.PylonError({
|
|
147
|
+
statusCode: _response.error.statusCode,
|
|
148
|
+
body: _response.error.body,
|
|
149
|
+
rawResponse: _response.rawResponse,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/customer-portal/settings");
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type * as Pylon from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {}
|
|
5
|
+
*/
|
|
6
|
+
export interface CustomerPortalUpdateSettingsRequest {
|
|
7
|
+
access?: Pylon.UpdateCustomerPortalAccessSettings;
|
|
8
|
+
branding?: Pylon.UpdateCustomerPortalBranding;
|
|
9
|
+
display?: Pylon.UpdateCustomerPortalDisplaySettings;
|
|
10
|
+
/** Whether the customer portal is enabled. Enabling it requires a plan that includes the customer portal. */
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
navigation?: Pylon.UpdateCustomerPortalNavigation;
|
|
13
|
+
portal_user_permissions?: Pylon.UpdateCustomerPortalUserPermissions;
|
|
14
|
+
tabs?: Pylon.UpdateCustomerPortalTabs;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { CustomerPortalUpdateSettingsRequest } from "./CustomerPortalUpdateSettingsRequest.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -11,6 +11,8 @@ export * from "./callRecordings/client/requests/index.js";
|
|
|
11
11
|
export * as callRecordings from "./callRecordings/index.js";
|
|
12
12
|
export * from "./contacts/client/requests/index.js";
|
|
13
13
|
export * as contacts from "./contacts/index.js";
|
|
14
|
+
export * from "./customerPortal/client/requests/index.js";
|
|
15
|
+
export * as customerPortal from "./customerPortal/index.js";
|
|
14
16
|
export * from "./customFields/client/requests/index.js";
|
|
15
17
|
export * as customFields from "./customFields/index.js";
|
|
16
18
|
export * from "./customFields/types/index.js";
|
|
@@ -11,6 +11,8 @@ export * from "./callRecordings/client/requests/index.js";
|
|
|
11
11
|
export * as callRecordings from "./callRecordings/index.js";
|
|
12
12
|
export * from "./contacts/client/requests/index.js";
|
|
13
13
|
export * as contacts from "./contacts/index.js";
|
|
14
|
+
export * from "./customerPortal/client/requests/index.js";
|
|
15
|
+
export * as customerPortal from "./customerPortal/index.js";
|
|
14
16
|
export * from "./customFields/client/requests/index.js";
|
|
15
17
|
export * as customFields from "./customFields/index.js";
|
|
16
18
|
export * from "./customFields/types/index.js";
|
|
@@ -32,6 +32,31 @@ export declare class UsersClient {
|
|
|
32
32
|
*/
|
|
33
33
|
list(request?: Pylon.UsersListRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Pylon.GetUsersResponseBody>;
|
|
34
34
|
private __list;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a user and emails them an invitation to join the organization. If a user with this email already exists,
|
|
37
|
+
* they are reactivated if needed and sent a new invitation, and any pending invitation is canceled. Requires admin permissions.
|
|
38
|
+
*
|
|
39
|
+
* **Rate limit:** 30 requests per minute
|
|
40
|
+
*
|
|
41
|
+
* @param {Pylon.UsersInviteRequest} request
|
|
42
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
|
+
*
|
|
44
|
+
* @throws {@link Pylon.BadRequestError}
|
|
45
|
+
* @throws {@link Pylon.UnauthorizedError}
|
|
46
|
+
* @throws {@link Pylon.ForbiddenError}
|
|
47
|
+
* @throws {@link Pylon.TooManyRequestsError}
|
|
48
|
+
* @throws {@link Pylon.InternalServerError}
|
|
49
|
+
* @throws {@link errors.PylonError}
|
|
50
|
+
* @throws {@link errors.PylonTimeoutError}
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* await client.users.invite({
|
|
54
|
+
* email: "jane@example.com",
|
|
55
|
+
* name: "name"
|
|
56
|
+
* })
|
|
57
|
+
*/
|
|
58
|
+
invite(request: Pylon.UsersInviteRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Pylon.GetUserResponseBody>;
|
|
59
|
+
private __invite;
|
|
35
60
|
/**
|
|
36
61
|
* Filterable fields and their allowed operators:
|
|
37
62
|
*
|
|
@@ -106,6 +106,77 @@ export class UsersClient {
|
|
|
106
106
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/users");
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Creates a user and emails them an invitation to join the organization. If a user with this email already exists,
|
|
111
|
+
* they are reactivated if needed and sent a new invitation, and any pending invitation is canceled. Requires admin permissions.
|
|
112
|
+
*
|
|
113
|
+
* **Rate limit:** 30 requests per minute
|
|
114
|
+
*
|
|
115
|
+
* @param {Pylon.UsersInviteRequest} request
|
|
116
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
117
|
+
*
|
|
118
|
+
* @throws {@link Pylon.BadRequestError}
|
|
119
|
+
* @throws {@link Pylon.UnauthorizedError}
|
|
120
|
+
* @throws {@link Pylon.ForbiddenError}
|
|
121
|
+
* @throws {@link Pylon.TooManyRequestsError}
|
|
122
|
+
* @throws {@link Pylon.InternalServerError}
|
|
123
|
+
* @throws {@link errors.PylonError}
|
|
124
|
+
* @throws {@link errors.PylonTimeoutError}
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* await client.users.invite({
|
|
128
|
+
* email: "jane@example.com",
|
|
129
|
+
* name: "name"
|
|
130
|
+
* })
|
|
131
|
+
*/
|
|
132
|
+
invite(request, requestOptions) {
|
|
133
|
+
return core.HttpResponsePromise.fromPromise(this.__invite(request, requestOptions));
|
|
134
|
+
}
|
|
135
|
+
__invite(request, requestOptions) {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
138
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
139
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
140
|
+
const _response = yield core.fetcher({
|
|
141
|
+
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, "users/invite"),
|
|
142
|
+
method: "POST",
|
|
143
|
+
headers: _headers,
|
|
144
|
+
contentType: "application/json",
|
|
145
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
146
|
+
requestType: "json",
|
|
147
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
148
|
+
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,
|
|
149
|
+
maxRetries: 0,
|
|
150
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
151
|
+
fetchFn: (_g = this._options) === null || _g === void 0 ? void 0 : _g.fetch,
|
|
152
|
+
logging: this._options.logging,
|
|
153
|
+
});
|
|
154
|
+
if (_response.ok) {
|
|
155
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
156
|
+
}
|
|
157
|
+
if (_response.error.reason === "status-code") {
|
|
158
|
+
switch (_response.error.statusCode) {
|
|
159
|
+
case 400:
|
|
160
|
+
throw new Pylon.BadRequestError(_response.error.body, _response.rawResponse);
|
|
161
|
+
case 401:
|
|
162
|
+
throw new Pylon.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
163
|
+
case 403:
|
|
164
|
+
throw new Pylon.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
165
|
+
case 429:
|
|
166
|
+
throw new Pylon.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
167
|
+
case 500:
|
|
168
|
+
throw new Pylon.InternalServerError(_response.error.body, _response.rawResponse);
|
|
169
|
+
default:
|
|
170
|
+
throw new errors.PylonError({
|
|
171
|
+
statusCode: _response.error.statusCode,
|
|
172
|
+
body: _response.error.body,
|
|
173
|
+
rawResponse: _response.rawResponse,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/users/invite");
|
|
178
|
+
});
|
|
179
|
+
}
|
|
109
180
|
/**
|
|
110
181
|
* Filterable fields and their allowed operators:
|
|
111
182
|
*
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* email: "jane@example.com",
|
|
5
|
+
* name: "name"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface UsersInviteRequest {
|
|
9
|
+
/** The email address to send the invitation to. */
|
|
10
|
+
email: string;
|
|
11
|
+
/** The name of the user to invite. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** The ID of the role to give the user. See GET /user-roles. Defaults to the organization's default role. */
|
|
14
|
+
role_id?: string;
|
|
15
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { UsersGetRequest } from "./UsersGetRequest.js";
|
|
2
|
+
export type { UsersInviteRequest } from "./UsersInviteRequest.js";
|
|
2
3
|
export type { UsersListRequest } from "./UsersListRequest.js";
|
|
3
4
|
export type { UsersSearchRequest } from "./UsersSearchRequest.js";
|
|
4
5
|
export type { UsersUpdateRequest } from "./UsersUpdateRequest.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface CustomerPortalAccessSettings {
|
|
2
|
+
/**
|
|
3
|
+
* Whether new contacts get portal access with the default role when they are created. Applies only to contacts whose email
|
|
4
|
+
* domain matches their account; other new contacts get no access unless invited.
|
|
5
|
+
*/
|
|
6
|
+
auto_grant_new_contacts: boolean;
|
|
7
|
+
/** Whether someone without a contact who logs in to the portal gets one created, if their email domain matches an existing account. */
|
|
8
|
+
create_contacts_on_login: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The portal role contacts get when they are granted access without an explicit role: `no_access`, `member`, `admin`, a custom
|
|
11
|
+
* role's slug, or a custom role's ID if it has no slug.
|
|
12
|
+
*/
|
|
13
|
+
default_role: string;
|
|
14
|
+
/** Whether contacts granted access automatically are emailed a portal invitation. */
|
|
15
|
+
invite_auto_granted_contacts: boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface CustomerPortalBranding {
|
|
2
|
+
/** The brand color as a 6-digit hex code, such as `#1A2B3C`. Empty when unset. */
|
|
3
|
+
brand_color: string;
|
|
4
|
+
/** The footer logo URL used in dark mode. Empty when unset. */
|
|
5
|
+
dark_mode_footer_logo_url: string;
|
|
6
|
+
/** The header logo URL used in dark mode. Empty when unset. */
|
|
7
|
+
dark_mode_logo_url: string;
|
|
8
|
+
/** The footer logo URL. Empty when unset. */
|
|
9
|
+
footer_logo_url: string;
|
|
10
|
+
/** Where the header logo links to. Empty when the logo is not a link. */
|
|
11
|
+
logo_link_url: string;
|
|
12
|
+
/** The header logo URL. Empty when unset. */
|
|
13
|
+
logo_url: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface CustomerPortalDisplaySettings {
|
|
2
|
+
/** Whether the portal shows feature request descriptions. */
|
|
3
|
+
feature_request_descriptions: boolean;
|
|
4
|
+
/** Whether portal tasks show their linked issues. */
|
|
5
|
+
task_linked_issues: boolean;
|
|
6
|
+
/** Whether portal tasks show their linked tasks. */
|
|
7
|
+
task_linked_tasks: boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as Pylon from "../index.js";
|
|
2
|
+
export interface CustomerPortalNavigation {
|
|
3
|
+
/** The link groups in the portal footer, in order. */
|
|
4
|
+
footer_categories: Pylon.CustomerPortalFooterCategory[];
|
|
5
|
+
/** The links in the portal header, in order. */
|
|
6
|
+
header_links: Pylon.CustomerPortalLink[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as Pylon from "../index.js";
|
|
2
|
+
export interface CustomerPortalSettings {
|
|
3
|
+
access: Pylon.CustomerPortalAccessSettings;
|
|
4
|
+
branding: Pylon.CustomerPortalBranding;
|
|
5
|
+
display: Pylon.CustomerPortalDisplaySettings;
|
|
6
|
+
/** Whether the customer portal is enabled. */
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
navigation: Pylon.CustomerPortalNavigation;
|
|
9
|
+
portal_user_permissions: Pylon.CustomerPortalUserPermissions;
|
|
10
|
+
tabs: Pylon.CustomerPortalTabs;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface CustomerPortalTabs {
|
|
2
|
+
/** Whether the portal shows the feature requests tab. */
|
|
3
|
+
feature_requests: boolean;
|
|
4
|
+
/** Whether the portal shows the issues tab. */
|
|
5
|
+
issues: boolean;
|
|
6
|
+
/** Whether the portal shows the projects and tasks tab. */
|
|
7
|
+
projects_and_tasks: boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface CustomerPortalUserPermissions {
|
|
2
|
+
/** Whether portal users can edit their own profile. */
|
|
3
|
+
edit_profile: boolean;
|
|
4
|
+
/** Whether portal users can edit the CC list on their replies. */
|
|
5
|
+
edit_reply_ccs: boolean;
|
|
6
|
+
/** Whether portal users can export their issues as CSV. */
|
|
7
|
+
export_issues_csv: boolean;
|
|
8
|
+
}
|