@usepylon/sdk 0.1.0-alpha.5 → 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.
Files changed (201) hide show
  1. package/dist/cjs/BaseClient.js +1 -1
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +51 -46
  4. package/dist/cjs/api/resources/accounts/client/requests/AccountsSearchRequest.d.ts +2 -0
  5. package/dist/cjs/api/resources/contacts/client/Client.d.ts +25 -1
  6. package/dist/cjs/api/resources/contacts/client/Client.js +74 -1
  7. package/dist/cjs/api/resources/contacts/client/requests/ContactsMergeRequest.d.ts +1 -1
  8. package/dist/cjs/api/resources/contacts/client/requests/ContactsPortalInvitationRequest.d.ts +10 -0
  9. package/dist/cjs/api/resources/contacts/client/requests/ContactsPortalInvitationRequest.js +3 -0
  10. package/dist/cjs/api/resources/contacts/client/requests/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/customerPortal/client/Client.d.ts +53 -0
  12. package/dist/cjs/api/resources/customerPortal/client/Client.js +193 -0
  13. package/dist/cjs/api/resources/customerPortal/client/index.d.ts +1 -0
  14. package/dist/cjs/api/resources/customerPortal/client/index.js +17 -0
  15. package/dist/cjs/api/resources/customerPortal/client/requests/CustomerPortalUpdateSettingsRequest.d.ts +15 -0
  16. package/dist/cjs/api/resources/customerPortal/client/requests/CustomerPortalUpdateSettingsRequest.js +3 -0
  17. package/dist/cjs/api/resources/customerPortal/client/requests/index.d.ts +1 -0
  18. package/dist/cjs/api/resources/customerPortal/client/requests/index.js +2 -0
  19. package/dist/cjs/api/resources/customerPortal/exports.d.ts +2 -0
  20. package/dist/cjs/api/resources/customerPortal/exports.js +21 -0
  21. package/dist/cjs/api/resources/customerPortal/index.d.ts +1 -0
  22. package/dist/cjs/api/resources/customerPortal/index.js +17 -0
  23. package/dist/cjs/api/resources/index.d.ts +2 -0
  24. package/dist/cjs/api/resources/index.js +3 -1
  25. package/dist/cjs/api/resources/issues/client/Client.d.ts +11 -0
  26. package/dist/cjs/api/resources/issues/client/Client.js +11 -0
  27. package/dist/cjs/api/resources/issues/client/requests/IssuesCreateRequest.d.ts +11 -0
  28. package/dist/cjs/api/resources/issues/client/requests/IssuesSearchRequest.d.ts +2 -0
  29. package/dist/cjs/api/resources/issues/resources/voiceCalls/client/Client.d.ts +1 -1
  30. package/dist/cjs/api/resources/issues/resources/voiceCalls/client/Client.js +1 -1
  31. package/dist/cjs/api/resources/teams/client/Client.d.ts +26 -0
  32. package/dist/cjs/api/resources/teams/client/Client.js +72 -0
  33. package/dist/cjs/api/resources/teams/client/requests/TeamsDeleteRequest.d.ts +10 -0
  34. package/dist/cjs/api/resources/teams/client/requests/TeamsDeleteRequest.js +3 -0
  35. package/dist/cjs/api/resources/teams/client/requests/index.d.ts +1 -0
  36. package/dist/cjs/api/resources/users/client/Client.d.ts +25 -0
  37. package/dist/cjs/api/resources/users/client/Client.js +71 -0
  38. package/dist/cjs/api/resources/users/client/requests/UsersInviteRequest.d.ts +15 -0
  39. package/dist/cjs/api/resources/users/client/requests/UsersInviteRequest.js +3 -0
  40. package/dist/cjs/api/resources/users/client/requests/index.d.ts +1 -0
  41. package/dist/cjs/api/types/ArticleVisibilityConfig.d.ts +5 -0
  42. package/dist/cjs/api/types/CustomerPortalAccessSettings.d.ts +16 -0
  43. package/dist/cjs/api/types/CustomerPortalAccessSettings.js +3 -0
  44. package/dist/cjs/api/types/CustomerPortalBranding.d.ts +14 -0
  45. package/dist/cjs/api/types/CustomerPortalBranding.js +3 -0
  46. package/dist/cjs/api/types/CustomerPortalDisplaySettings.d.ts +8 -0
  47. package/dist/cjs/api/types/CustomerPortalDisplaySettings.js +3 -0
  48. package/dist/cjs/api/types/CustomerPortalFooterCategory.d.ts +7 -0
  49. package/dist/cjs/api/types/CustomerPortalFooterCategory.js +3 -0
  50. package/dist/cjs/api/types/CustomerPortalInvitationResult.d.ts +4 -0
  51. package/dist/cjs/api/types/CustomerPortalInvitationResult.js +3 -0
  52. package/dist/cjs/api/types/CustomerPortalLink.d.ts +6 -0
  53. package/dist/cjs/api/types/CustomerPortalLink.js +3 -0
  54. package/dist/cjs/api/types/CustomerPortalNavigation.d.ts +7 -0
  55. package/dist/cjs/api/types/CustomerPortalNavigation.js +3 -0
  56. package/dist/cjs/api/types/CustomerPortalSettings.d.ts +11 -0
  57. package/dist/cjs/api/types/CustomerPortalSettings.js +3 -0
  58. package/dist/cjs/api/types/CustomerPortalTabs.d.ts +8 -0
  59. package/dist/cjs/api/types/CustomerPortalTabs.js +3 -0
  60. package/dist/cjs/api/types/CustomerPortalUserPermissions.d.ts +8 -0
  61. package/dist/cjs/api/types/CustomerPortalUserPermissions.js +3 -0
  62. package/dist/cjs/api/types/DeleteTeamResponseBody.d.ts +4 -0
  63. package/dist/cjs/api/types/DeleteTeamResponseBody.js +3 -0
  64. package/dist/cjs/api/types/DestinationMetadata.d.ts +2 -0
  65. package/dist/cjs/api/types/ErrorApiResponseBody.d.ts +7 -1
  66. package/dist/cjs/api/types/ExternalIssue.d.ts +8 -0
  67. package/dist/cjs/api/types/Filter.d.ts +17 -7
  68. package/dist/cjs/api/types/Filter.js +6 -1
  69. package/dist/cjs/api/types/FilterError.d.ts +26 -0
  70. package/dist/cjs/api/types/FilterError.js +3 -0
  71. package/dist/cjs/api/types/FilterRelatedObject.d.ts +14 -0
  72. package/dist/cjs/api/types/FilterRelatedObject.js +3 -0
  73. package/dist/cjs/api/types/GetCustomerPortalSettingsResponseBody.d.ts +6 -0
  74. package/dist/cjs/api/types/GetCustomerPortalSettingsResponseBody.js +3 -0
  75. package/dist/cjs/api/types/IssueThread.d.ts +6 -0
  76. package/dist/cjs/api/types/SearchAccountsSort.d.ts +23 -0
  77. package/dist/cjs/api/types/SearchAccountsSort.js +20 -0
  78. package/dist/cjs/api/types/SearchIssuesSort.d.ts +23 -0
  79. package/dist/cjs/api/types/SearchIssuesSort.js +20 -0
  80. package/dist/cjs/api/types/SendCustomerPortalInvitationResponseBody.d.ts +6 -0
  81. package/dist/cjs/api/types/SendCustomerPortalInvitationResponseBody.js +3 -0
  82. package/dist/cjs/api/types/Task.d.ts +2 -0
  83. package/dist/cjs/api/types/TicketFormLayoutField.d.ts +11 -1
  84. package/dist/cjs/api/types/UpdateCustomerPortalAccessSettings.d.ts +16 -0
  85. package/dist/cjs/api/types/UpdateCustomerPortalAccessSettings.js +3 -0
  86. package/dist/cjs/api/types/UpdateCustomerPortalBranding.d.ts +14 -0
  87. package/dist/cjs/api/types/UpdateCustomerPortalBranding.js +3 -0
  88. package/dist/cjs/api/types/UpdateCustomerPortalDisplaySettings.d.ts +8 -0
  89. package/dist/cjs/api/types/UpdateCustomerPortalDisplaySettings.js +3 -0
  90. package/dist/cjs/api/types/UpdateCustomerPortalNavigation.d.ts +7 -0
  91. package/dist/cjs/api/types/UpdateCustomerPortalNavigation.js +3 -0
  92. package/dist/cjs/api/types/UpdateCustomerPortalTabs.d.ts +8 -0
  93. package/dist/cjs/api/types/UpdateCustomerPortalTabs.js +3 -0
  94. package/dist/cjs/api/types/UpdateCustomerPortalUserPermissions.d.ts +8 -0
  95. package/dist/cjs/api/types/UpdateCustomerPortalUserPermissions.js +3 -0
  96. package/dist/cjs/api/types/VoiceCall.d.ts +2 -0
  97. package/dist/cjs/api/types/VoiceCallParticipant.d.ts +20 -0
  98. package/dist/cjs/api/types/VoiceCallParticipant.js +3 -0
  99. package/dist/cjs/api/types/index.d.ts +24 -0
  100. package/dist/cjs/api/types/index.js +24 -0
  101. package/dist/esm/BaseClient.js +1 -1
  102. package/dist/esm/Client.d.ts +3 -0
  103. package/dist/esm/Client.js +5 -0
  104. package/dist/esm/api/resources/accounts/client/requests/AccountsSearchRequest.d.ts +2 -0
  105. package/dist/esm/api/resources/contacts/client/Client.d.ts +25 -1
  106. package/dist/esm/api/resources/contacts/client/Client.js +74 -1
  107. package/dist/esm/api/resources/contacts/client/requests/ContactsMergeRequest.d.ts +1 -1
  108. package/dist/esm/api/resources/contacts/client/requests/ContactsPortalInvitationRequest.d.ts +10 -0
  109. package/dist/esm/api/resources/contacts/client/requests/ContactsPortalInvitationRequest.js +2 -0
  110. package/dist/esm/api/resources/contacts/client/requests/index.d.ts +1 -0
  111. package/dist/esm/api/resources/customerPortal/client/Client.d.ts +53 -0
  112. package/dist/esm/api/resources/customerPortal/client/Client.js +156 -0
  113. package/dist/esm/api/resources/customerPortal/client/index.d.ts +1 -0
  114. package/dist/esm/api/resources/customerPortal/client/index.js +1 -0
  115. package/dist/esm/api/resources/customerPortal/client/requests/CustomerPortalUpdateSettingsRequest.d.ts +15 -0
  116. package/dist/esm/api/resources/customerPortal/client/requests/CustomerPortalUpdateSettingsRequest.js +2 -0
  117. package/dist/esm/api/resources/customerPortal/client/requests/index.d.ts +1 -0
  118. package/dist/esm/api/resources/customerPortal/client/requests/index.js +1 -0
  119. package/dist/esm/api/resources/customerPortal/exports.d.ts +2 -0
  120. package/dist/esm/api/resources/customerPortal/exports.js +3 -0
  121. package/dist/esm/api/resources/customerPortal/index.d.ts +1 -0
  122. package/dist/esm/api/resources/customerPortal/index.js +1 -0
  123. package/dist/esm/api/resources/index.d.ts +2 -0
  124. package/dist/esm/api/resources/index.js +2 -0
  125. package/dist/esm/api/resources/issues/client/Client.d.ts +11 -0
  126. package/dist/esm/api/resources/issues/client/Client.js +11 -0
  127. package/dist/esm/api/resources/issues/client/requests/IssuesCreateRequest.d.ts +11 -0
  128. package/dist/esm/api/resources/issues/client/requests/IssuesSearchRequest.d.ts +2 -0
  129. package/dist/esm/api/resources/issues/resources/voiceCalls/client/Client.d.ts +1 -1
  130. package/dist/esm/api/resources/issues/resources/voiceCalls/client/Client.js +1 -1
  131. package/dist/esm/api/resources/teams/client/Client.d.ts +26 -0
  132. package/dist/esm/api/resources/teams/client/Client.js +72 -0
  133. package/dist/esm/api/resources/teams/client/requests/TeamsDeleteRequest.d.ts +10 -0
  134. package/dist/esm/api/resources/teams/client/requests/TeamsDeleteRequest.js +2 -0
  135. package/dist/esm/api/resources/teams/client/requests/index.d.ts +1 -0
  136. package/dist/esm/api/resources/users/client/Client.d.ts +25 -0
  137. package/dist/esm/api/resources/users/client/Client.js +71 -0
  138. package/dist/esm/api/resources/users/client/requests/UsersInviteRequest.d.ts +15 -0
  139. package/dist/esm/api/resources/users/client/requests/UsersInviteRequest.js +2 -0
  140. package/dist/esm/api/resources/users/client/requests/index.d.ts +1 -0
  141. package/dist/esm/api/types/ArticleVisibilityConfig.d.ts +5 -0
  142. package/dist/esm/api/types/CustomerPortalAccessSettings.d.ts +16 -0
  143. package/dist/esm/api/types/CustomerPortalAccessSettings.js +2 -0
  144. package/dist/esm/api/types/CustomerPortalBranding.d.ts +14 -0
  145. package/dist/esm/api/types/CustomerPortalBranding.js +2 -0
  146. package/dist/esm/api/types/CustomerPortalDisplaySettings.d.ts +8 -0
  147. package/dist/esm/api/types/CustomerPortalDisplaySettings.js +2 -0
  148. package/dist/esm/api/types/CustomerPortalFooterCategory.d.ts +7 -0
  149. package/dist/esm/api/types/CustomerPortalFooterCategory.js +2 -0
  150. package/dist/esm/api/types/CustomerPortalInvitationResult.d.ts +4 -0
  151. package/dist/esm/api/types/CustomerPortalInvitationResult.js +2 -0
  152. package/dist/esm/api/types/CustomerPortalLink.d.ts +6 -0
  153. package/dist/esm/api/types/CustomerPortalLink.js +2 -0
  154. package/dist/esm/api/types/CustomerPortalNavigation.d.ts +7 -0
  155. package/dist/esm/api/types/CustomerPortalNavigation.js +2 -0
  156. package/dist/esm/api/types/CustomerPortalSettings.d.ts +11 -0
  157. package/dist/esm/api/types/CustomerPortalSettings.js +2 -0
  158. package/dist/esm/api/types/CustomerPortalTabs.d.ts +8 -0
  159. package/dist/esm/api/types/CustomerPortalTabs.js +2 -0
  160. package/dist/esm/api/types/CustomerPortalUserPermissions.d.ts +8 -0
  161. package/dist/esm/api/types/CustomerPortalUserPermissions.js +2 -0
  162. package/dist/esm/api/types/DeleteTeamResponseBody.d.ts +4 -0
  163. package/dist/esm/api/types/DeleteTeamResponseBody.js +2 -0
  164. package/dist/esm/api/types/DestinationMetadata.d.ts +2 -0
  165. package/dist/esm/api/types/ErrorApiResponseBody.d.ts +7 -1
  166. package/dist/esm/api/types/ExternalIssue.d.ts +8 -0
  167. package/dist/esm/api/types/Filter.d.ts +17 -7
  168. package/dist/esm/api/types/Filter.js +6 -1
  169. package/dist/esm/api/types/FilterError.d.ts +26 -0
  170. package/dist/esm/api/types/FilterError.js +2 -0
  171. package/dist/esm/api/types/FilterRelatedObject.d.ts +14 -0
  172. package/dist/esm/api/types/FilterRelatedObject.js +2 -0
  173. package/dist/esm/api/types/GetCustomerPortalSettingsResponseBody.d.ts +6 -0
  174. package/dist/esm/api/types/GetCustomerPortalSettingsResponseBody.js +2 -0
  175. package/dist/esm/api/types/IssueThread.d.ts +6 -0
  176. package/dist/esm/api/types/SearchAccountsSort.d.ts +23 -0
  177. package/dist/esm/api/types/SearchAccountsSort.js +17 -0
  178. package/dist/esm/api/types/SearchIssuesSort.d.ts +23 -0
  179. package/dist/esm/api/types/SearchIssuesSort.js +17 -0
  180. package/dist/esm/api/types/SendCustomerPortalInvitationResponseBody.d.ts +6 -0
  181. package/dist/esm/api/types/SendCustomerPortalInvitationResponseBody.js +2 -0
  182. package/dist/esm/api/types/Task.d.ts +2 -0
  183. package/dist/esm/api/types/TicketFormLayoutField.d.ts +11 -1
  184. package/dist/esm/api/types/UpdateCustomerPortalAccessSettings.d.ts +16 -0
  185. package/dist/esm/api/types/UpdateCustomerPortalAccessSettings.js +2 -0
  186. package/dist/esm/api/types/UpdateCustomerPortalBranding.d.ts +14 -0
  187. package/dist/esm/api/types/UpdateCustomerPortalBranding.js +2 -0
  188. package/dist/esm/api/types/UpdateCustomerPortalDisplaySettings.d.ts +8 -0
  189. package/dist/esm/api/types/UpdateCustomerPortalDisplaySettings.js +2 -0
  190. package/dist/esm/api/types/UpdateCustomerPortalNavigation.d.ts +7 -0
  191. package/dist/esm/api/types/UpdateCustomerPortalNavigation.js +2 -0
  192. package/dist/esm/api/types/UpdateCustomerPortalTabs.d.ts +8 -0
  193. package/dist/esm/api/types/UpdateCustomerPortalTabs.js +2 -0
  194. package/dist/esm/api/types/UpdateCustomerPortalUserPermissions.d.ts +8 -0
  195. package/dist/esm/api/types/UpdateCustomerPortalUserPermissions.js +2 -0
  196. package/dist/esm/api/types/VoiceCall.d.ts +2 -0
  197. package/dist/esm/api/types/VoiceCallParticipant.d.ts +20 -0
  198. package/dist/esm/api/types/VoiceCallParticipant.js +2 -0
  199. package/dist/esm/api/types/index.d.ts +24 -0
  200. package/dist/esm/api/types/index.js +24 -0
  201. package/package.json +1 -1
@@ -42,7 +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
+ "User-Agent": "@usepylon/sdk/0.1.0-beta.2",
46
46
  "X-Fern-Runtime": core.RUNTIME.type,
47
47
  "X-Fern-Runtime-Version": core.RUNTIME.version,
48
48
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -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;
@@ -51,29 +51,30 @@ const Client_js_4 = require("./api/resources/attachments/client/Client.js");
51
51
  const Client_js_5 = require("./api/resources/auditLogs/client/Client.js");
52
52
  const Client_js_6 = require("./api/resources/callRecordings/client/Client.js");
53
53
  const Client_js_7 = require("./api/resources/contacts/client/Client.js");
54
- const Client_js_8 = require("./api/resources/customFields/client/Client.js");
55
- const Client_js_9 = require("./api/resources/customObjects/client/Client.js");
56
- const Client_js_10 = require("./api/resources/emailSuppressions/client/Client.js");
57
- const Client_js_11 = require("./api/resources/featureRequests/client/Client.js");
58
- const Client_js_12 = require("./api/resources/issueGroups/client/Client.js");
59
- const Client_js_13 = require("./api/resources/issueStatuses/client/Client.js");
60
- const Client_js_14 = require("./api/resources/issues/client/Client.js");
61
- const Client_js_15 = require("./api/resources/knowledgeBases/client/Client.js");
62
- const Client_js_16 = require("./api/resources/macroGroups/client/Client.js");
63
- const Client_js_17 = require("./api/resources/macros/client/Client.js");
64
- const Client_js_18 = require("./api/resources/me/client/Client.js");
65
- const Client_js_19 = require("./api/resources/milestones/client/Client.js");
66
- const Client_js_20 = require("./api/resources/projects/client/Client.js");
67
- const Client_js_21 = require("./api/resources/surveys/client/Client.js");
68
- const Client_js_22 = require("./api/resources/tags/client/Client.js");
69
- const Client_js_23 = require("./api/resources/taskStatuses/client/Client.js");
70
- const Client_js_24 = require("./api/resources/tasks/client/Client.js");
71
- const Client_js_25 = require("./api/resources/teams/client/Client.js");
72
- const Client_js_26 = require("./api/resources/ticketForms/client/Client.js");
73
- const Client_js_27 = require("./api/resources/trainingData/client/Client.js");
74
- const Client_js_28 = require("./api/resources/userRoles/client/Client.js");
75
- const Client_js_29 = require("./api/resources/userStatuses/client/Client.js");
76
- const Client_js_30 = require("./api/resources/users/client/Client.js");
54
+ const Client_js_8 = require("./api/resources/customerPortal/client/Client.js");
55
+ const Client_js_9 = require("./api/resources/customFields/client/Client.js");
56
+ const Client_js_10 = require("./api/resources/customObjects/client/Client.js");
57
+ const Client_js_11 = require("./api/resources/emailSuppressions/client/Client.js");
58
+ const Client_js_12 = require("./api/resources/featureRequests/client/Client.js");
59
+ const Client_js_13 = require("./api/resources/issueGroups/client/Client.js");
60
+ const Client_js_14 = require("./api/resources/issueStatuses/client/Client.js");
61
+ const Client_js_15 = require("./api/resources/issues/client/Client.js");
62
+ const Client_js_16 = require("./api/resources/knowledgeBases/client/Client.js");
63
+ const Client_js_17 = require("./api/resources/macroGroups/client/Client.js");
64
+ const Client_js_18 = require("./api/resources/macros/client/Client.js");
65
+ const Client_js_19 = require("./api/resources/me/client/Client.js");
66
+ const Client_js_20 = require("./api/resources/milestones/client/Client.js");
67
+ const Client_js_21 = require("./api/resources/projects/client/Client.js");
68
+ const Client_js_22 = require("./api/resources/surveys/client/Client.js");
69
+ const Client_js_23 = require("./api/resources/tags/client/Client.js");
70
+ const Client_js_24 = require("./api/resources/taskStatuses/client/Client.js");
71
+ const Client_js_25 = require("./api/resources/tasks/client/Client.js");
72
+ const Client_js_26 = require("./api/resources/teams/client/Client.js");
73
+ const Client_js_27 = require("./api/resources/ticketForms/client/Client.js");
74
+ const Client_js_28 = require("./api/resources/trainingData/client/Client.js");
75
+ const Client_js_29 = require("./api/resources/userRoles/client/Client.js");
76
+ const Client_js_30 = require("./api/resources/userStatuses/client/Client.js");
77
+ const Client_js_31 = require("./api/resources/users/client/Client.js");
77
78
  const BaseClient_js_1 = require("./BaseClient.js");
78
79
  const core = __importStar(require("./core/index.js"));
79
80
  class PylonClient {
@@ -110,95 +111,99 @@ class PylonClient {
110
111
  }
111
112
  get customFields() {
112
113
  var _a;
113
- return ((_a = this._customFields) !== null && _a !== void 0 ? _a : (this._customFields = new Client_js_8.CustomFieldsClient(this._options)));
114
+ return ((_a = this._customFields) !== null && _a !== void 0 ? _a : (this._customFields = new Client_js_9.CustomFieldsClient(this._options)));
114
115
  }
115
116
  get customObjects() {
116
117
  var _a;
117
- return ((_a = this._customObjects) !== null && _a !== void 0 ? _a : (this._customObjects = new Client_js_9.CustomObjectsClient(this._options)));
118
+ return ((_a = this._customObjects) !== null && _a !== void 0 ? _a : (this._customObjects = new Client_js_10.CustomObjectsClient(this._options)));
119
+ }
120
+ get customerPortal() {
121
+ var _a;
122
+ return ((_a = this._customerPortal) !== null && _a !== void 0 ? _a : (this._customerPortal = new Client_js_8.CustomerPortalClient(this._options)));
118
123
  }
119
124
  get emailSuppressions() {
120
125
  var _a;
121
- return ((_a = this._emailSuppressions) !== null && _a !== void 0 ? _a : (this._emailSuppressions = new Client_js_10.EmailSuppressionsClient(this._options)));
126
+ return ((_a = this._emailSuppressions) !== null && _a !== void 0 ? _a : (this._emailSuppressions = new Client_js_11.EmailSuppressionsClient(this._options)));
122
127
  }
123
128
  get featureRequests() {
124
129
  var _a;
125
- return ((_a = this._featureRequests) !== null && _a !== void 0 ? _a : (this._featureRequests = new Client_js_11.FeatureRequestsClient(this._options)));
130
+ return ((_a = this._featureRequests) !== null && _a !== void 0 ? _a : (this._featureRequests = new Client_js_12.FeatureRequestsClient(this._options)));
126
131
  }
127
132
  get issueGroups() {
128
133
  var _a;
129
- return ((_a = this._issueGroups) !== null && _a !== void 0 ? _a : (this._issueGroups = new Client_js_12.IssueGroupsClient(this._options)));
134
+ return ((_a = this._issueGroups) !== null && _a !== void 0 ? _a : (this._issueGroups = new Client_js_13.IssueGroupsClient(this._options)));
130
135
  }
131
136
  get issueStatuses() {
132
137
  var _a;
133
- return ((_a = this._issueStatuses) !== null && _a !== void 0 ? _a : (this._issueStatuses = new Client_js_13.IssueStatusesClient(this._options)));
138
+ return ((_a = this._issueStatuses) !== null && _a !== void 0 ? _a : (this._issueStatuses = new Client_js_14.IssueStatusesClient(this._options)));
134
139
  }
135
140
  get issues() {
136
141
  var _a;
137
- return ((_a = this._issues) !== null && _a !== void 0 ? _a : (this._issues = new Client_js_14.IssuesClient(this._options)));
142
+ return ((_a = this._issues) !== null && _a !== void 0 ? _a : (this._issues = new Client_js_15.IssuesClient(this._options)));
138
143
  }
139
144
  get knowledgeBases() {
140
145
  var _a;
141
- return ((_a = this._knowledgeBases) !== null && _a !== void 0 ? _a : (this._knowledgeBases = new Client_js_15.KnowledgeBasesClient(this._options)));
146
+ return ((_a = this._knowledgeBases) !== null && _a !== void 0 ? _a : (this._knowledgeBases = new Client_js_16.KnowledgeBasesClient(this._options)));
142
147
  }
143
148
  get macroGroups() {
144
149
  var _a;
145
- return ((_a = this._macroGroups) !== null && _a !== void 0 ? _a : (this._macroGroups = new Client_js_16.MacroGroupsClient(this._options)));
150
+ return ((_a = this._macroGroups) !== null && _a !== void 0 ? _a : (this._macroGroups = new Client_js_17.MacroGroupsClient(this._options)));
146
151
  }
147
152
  get macros() {
148
153
  var _a;
149
- return ((_a = this._macros) !== null && _a !== void 0 ? _a : (this._macros = new Client_js_17.MacrosClient(this._options)));
154
+ return ((_a = this._macros) !== null && _a !== void 0 ? _a : (this._macros = new Client_js_18.MacrosClient(this._options)));
150
155
  }
151
156
  get me() {
152
157
  var _a;
153
- return ((_a = this._me) !== null && _a !== void 0 ? _a : (this._me = new Client_js_18.MeClient(this._options)));
158
+ return ((_a = this._me) !== null && _a !== void 0 ? _a : (this._me = new Client_js_19.MeClient(this._options)));
154
159
  }
155
160
  get milestones() {
156
161
  var _a;
157
- return ((_a = this._milestones) !== null && _a !== void 0 ? _a : (this._milestones = new Client_js_19.MilestonesClient(this._options)));
162
+ return ((_a = this._milestones) !== null && _a !== void 0 ? _a : (this._milestones = new Client_js_20.MilestonesClient(this._options)));
158
163
  }
159
164
  get projects() {
160
165
  var _a;
161
- return ((_a = this._projects) !== null && _a !== void 0 ? _a : (this._projects = new Client_js_20.ProjectsClient(this._options)));
166
+ return ((_a = this._projects) !== null && _a !== void 0 ? _a : (this._projects = new Client_js_21.ProjectsClient(this._options)));
162
167
  }
163
168
  get surveys() {
164
169
  var _a;
165
- return ((_a = this._surveys) !== null && _a !== void 0 ? _a : (this._surveys = new Client_js_21.SurveysClient(this._options)));
170
+ return ((_a = this._surveys) !== null && _a !== void 0 ? _a : (this._surveys = new Client_js_22.SurveysClient(this._options)));
166
171
  }
167
172
  get tags() {
168
173
  var _a;
169
- return ((_a = this._tags) !== null && _a !== void 0 ? _a : (this._tags = new Client_js_22.TagsClient(this._options)));
174
+ return ((_a = this._tags) !== null && _a !== void 0 ? _a : (this._tags = new Client_js_23.TagsClient(this._options)));
170
175
  }
171
176
  get taskStatuses() {
172
177
  var _a;
173
- return ((_a = this._taskStatuses) !== null && _a !== void 0 ? _a : (this._taskStatuses = new Client_js_23.TaskStatusesClient(this._options)));
178
+ return ((_a = this._taskStatuses) !== null && _a !== void 0 ? _a : (this._taskStatuses = new Client_js_24.TaskStatusesClient(this._options)));
174
179
  }
175
180
  get tasks() {
176
181
  var _a;
177
- return ((_a = this._tasks) !== null && _a !== void 0 ? _a : (this._tasks = new Client_js_24.TasksClient(this._options)));
182
+ return ((_a = this._tasks) !== null && _a !== void 0 ? _a : (this._tasks = new Client_js_25.TasksClient(this._options)));
178
183
  }
179
184
  get teams() {
180
185
  var _a;
181
- return ((_a = this._teams) !== null && _a !== void 0 ? _a : (this._teams = new Client_js_25.TeamsClient(this._options)));
186
+ return ((_a = this._teams) !== null && _a !== void 0 ? _a : (this._teams = new Client_js_26.TeamsClient(this._options)));
182
187
  }
183
188
  get ticketForms() {
184
189
  var _a;
185
- return ((_a = this._ticketForms) !== null && _a !== void 0 ? _a : (this._ticketForms = new Client_js_26.TicketFormsClient(this._options)));
190
+ return ((_a = this._ticketForms) !== null && _a !== void 0 ? _a : (this._ticketForms = new Client_js_27.TicketFormsClient(this._options)));
186
191
  }
187
192
  get trainingData() {
188
193
  var _a;
189
- return ((_a = this._trainingData) !== null && _a !== void 0 ? _a : (this._trainingData = new Client_js_27.TrainingDataClient(this._options)));
194
+ return ((_a = this._trainingData) !== null && _a !== void 0 ? _a : (this._trainingData = new Client_js_28.TrainingDataClient(this._options)));
190
195
  }
191
196
  get userRoles() {
192
197
  var _a;
193
- return ((_a = this._userRoles) !== null && _a !== void 0 ? _a : (this._userRoles = new Client_js_28.UserRolesClient(this._options)));
198
+ return ((_a = this._userRoles) !== null && _a !== void 0 ? _a : (this._userRoles = new Client_js_29.UserRolesClient(this._options)));
194
199
  }
195
200
  get userStatuses() {
196
201
  var _a;
197
- return ((_a = this._userStatuses) !== null && _a !== void 0 ? _a : (this._userStatuses = new Client_js_29.UserStatusesClient(this._options)));
202
+ return ((_a = this._userStatuses) !== null && _a !== void 0 ? _a : (this._userStatuses = new Client_js_30.UserStatusesClient(this._options)));
198
203
  }
199
204
  get users() {
200
205
  var _a;
201
- return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_30.UsersClient(this._options)));
206
+ return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_31.UsersClient(this._options)));
202
207
  }
203
208
  /**
204
209
  * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
@@ -11,4 +11,6 @@ export interface AccountsSearchRequest {
11
11
  limit?: number;
12
12
  /** Fuzzy text search. Results are intersected with any provided filter. */
13
13
  search_text?: string;
14
+ /** The order of results, as a list of sort keys. Only one sort key is supported right now. Omit for the default order. Send the same sort with every page of a cursor. */
15
+ sort?: Pylon.SearchAccountsSort[];
14
16
  }
@@ -56,7 +56,7 @@ export declare class ContactsClient {
56
56
  create(request: Pylon.ContactsCreateRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<Pylon.CreateContactResponseBody>;
57
57
  private __create;
58
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.
59
+ * Merges a contact into a surviving contact. Both contacts must belong to the same account, unless the merged contact has no account, in which case 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
60
  *
61
61
  * **Rate limit:** 30 requests per minute
62
62
  *
@@ -180,4 +180,28 @@ export declare class ContactsClient {
180
180
  */
181
181
  update(request: Pylon.ContactsUpdateRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<Pylon.UpdateContactResponseBody>;
182
182
  private __update;
183
+ /**
184
+ * Sends or resends a portal invitation to the contact's primary email. The portal must be enabled and the contact must already have portal access. Does not change the contact's role. Requires customer portal settings write permission and write access to the contact's primary account, if any. Each successful call requests another invitation; success does not guarantee email delivery.
185
+ *
186
+ * **Rate limit:** 30 requests per minute
187
+ *
188
+ * @param {Pylon.ContactsPortalInvitationRequest} request
189
+ * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
190
+ *
191
+ * @throws {@link Pylon.BadRequestError}
192
+ * @throws {@link Pylon.UnauthorizedError}
193
+ * @throws {@link Pylon.ForbiddenError}
194
+ * @throws {@link Pylon.NotFoundError}
195
+ * @throws {@link Pylon.TooManyRequestsError}
196
+ * @throws {@link Pylon.InternalServerError}
197
+ * @throws {@link errors.PylonError}
198
+ * @throws {@link errors.PylonTimeoutError}
199
+ *
200
+ * @example
201
+ * await client.contacts.portalInvitation({
202
+ * contact_id: "id"
203
+ * })
204
+ */
205
+ portalInvitation(request: Pylon.ContactsPortalInvitationRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<Pylon.SendCustomerPortalInvitationResponseBody>;
206
+ private __portalInvitation;
183
207
  }
@@ -233,7 +233,7 @@ class ContactsClient {
233
233
  });
234
234
  }
235
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.
236
+ * Merges a contact into a surviving contact. Both contacts must belong to the same account, unless the merged contact has no account, in which case 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
237
  *
238
238
  * **Rate limit:** 30 requests per minute
239
239
  *
@@ -608,5 +608,78 @@ class ContactsClient {
608
608
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/contacts/{id}");
609
609
  });
610
610
  }
611
+ /**
612
+ * Sends or resends a portal invitation to the contact's primary email. The portal must be enabled and the contact must already have portal access. Does not change the contact's role. Requires customer portal settings write permission and write access to the contact's primary account, if any. Each successful call requests another invitation; success does not guarantee email delivery.
613
+ *
614
+ * **Rate limit:** 30 requests per minute
615
+ *
616
+ * @param {Pylon.ContactsPortalInvitationRequest} request
617
+ * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
618
+ *
619
+ * @throws {@link Pylon.BadRequestError}
620
+ * @throws {@link Pylon.UnauthorizedError}
621
+ * @throws {@link Pylon.ForbiddenError}
622
+ * @throws {@link Pylon.NotFoundError}
623
+ * @throws {@link Pylon.TooManyRequestsError}
624
+ * @throws {@link Pylon.InternalServerError}
625
+ * @throws {@link errors.PylonError}
626
+ * @throws {@link errors.PylonTimeoutError}
627
+ *
628
+ * @example
629
+ * await client.contacts.portalInvitation({
630
+ * contact_id: "id"
631
+ * })
632
+ */
633
+ portalInvitation(request, requestOptions) {
634
+ return core.HttpResponsePromise.fromPromise(this.__portalInvitation(request, requestOptions));
635
+ }
636
+ __portalInvitation(request, requestOptions) {
637
+ return __awaiter(this, void 0, void 0, function* () {
638
+ var _a, _b, _c, _d, _e, _f, _g;
639
+ const { contact_id: contactId } = request;
640
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
641
+ 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);
642
+ const _response = yield core.fetcher({
643
+ 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/${core.url.encodePathParam(contactId)}/portal-invitation`),
644
+ method: "POST",
645
+ headers: _headers,
646
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
647
+ 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,
648
+ maxRetries: 0,
649
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
650
+ fetchFn: (_g = this._options) === null || _g === void 0 ? void 0 : _g.fetch,
651
+ logging: this._options.logging,
652
+ });
653
+ if (_response.ok) {
654
+ return {
655
+ data: _response.body,
656
+ rawResponse: _response.rawResponse,
657
+ };
658
+ }
659
+ if (_response.error.reason === "status-code") {
660
+ switch (_response.error.statusCode) {
661
+ case 400:
662
+ throw new Pylon.BadRequestError(_response.error.body, _response.rawResponse);
663
+ case 401:
664
+ throw new Pylon.UnauthorizedError(_response.error.body, _response.rawResponse);
665
+ case 403:
666
+ throw new Pylon.ForbiddenError(_response.error.body, _response.rawResponse);
667
+ case 404:
668
+ throw new Pylon.NotFoundError(_response.error.body, _response.rawResponse);
669
+ case 429:
670
+ throw new Pylon.TooManyRequestsError(_response.error.body, _response.rawResponse);
671
+ case 500:
672
+ throw new Pylon.InternalServerError(_response.error.body, _response.rawResponse);
673
+ default:
674
+ throw new errors.PylonError({
675
+ statusCode: _response.error.statusCode,
676
+ body: _response.error.body,
677
+ rawResponse: _response.rawResponse,
678
+ });
679
+ }
680
+ }
681
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/contacts/{contact_id}/portal-invitation");
682
+ });
683
+ }
611
684
  }
612
685
  exports.ContactsClient = ContactsClient;
@@ -8,6 +8,6 @@
8
8
  export interface ContactsMergeRequest {
9
9
  /** The ID of the contact to merge into the surviving contact. This contact is permanently deleted after its data is transferred. */
10
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. */
11
+ /** The ID of the contact that will survive the merge and receive the merged data. If the merged contact belongs to an account, this contact must belong to the same account. */
12
12
  merge_into_contact_id: string;
13
13
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * contact_id: "id"
5
+ * }
6
+ */
7
+ export interface ContactsPortalInvitationRequest {
8
+ /** The ID of the contact to invite. */
9
+ contact_id: string;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,5 +3,6 @@ export type { ContactsDeleteRequest } from "./ContactsDeleteRequest.js";
3
3
  export type { ContactsGetRequest } from "./ContactsGetRequest.js";
4
4
  export type { ContactsListRequest } from "./ContactsListRequest.js";
5
5
  export type { ContactsMergeRequest } from "./ContactsMergeRequest.js";
6
+ export type { ContactsPortalInvitationRequest } from "./ContactsPortalInvitationRequest.js";
6
7
  export type { ContactsSearchRequest } from "./ContactsSearchRequest.js";
7
8
  export type { ContactsUpdateRequest } from "./ContactsUpdateRequest.js";
@@ -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,193 @@
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.CustomerPortalClient = 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 requestBody_js_1 = require("../../../../core/requestBody.js");
51
+ const environments = __importStar(require("../../../../environments.js"));
52
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
53
+ const errors = __importStar(require("../../../../errors/index.js"));
54
+ const Pylon = __importStar(require("../../../index.js"));
55
+ class CustomerPortalClient {
56
+ constructor(options) {
57
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
58
+ }
59
+ /**
60
+ * Returns the organization's customer portal settings.
61
+ *
62
+ * **Rate limit:** 120 requests per minute
63
+ *
64
+ * @param {CustomerPortalClient.RequestOptions} requestOptions - Request-specific configuration.
65
+ *
66
+ * @throws {@link Pylon.UnauthorizedError}
67
+ * @throws {@link Pylon.ForbiddenError}
68
+ * @throws {@link Pylon.TooManyRequestsError}
69
+ * @throws {@link Pylon.InternalServerError}
70
+ * @throws {@link errors.PylonError}
71
+ * @throws {@link errors.PylonTimeoutError}
72
+ *
73
+ * @example
74
+ * await client.customerPortal.getSettings()
75
+ */
76
+ getSettings(requestOptions) {
77
+ return core.HttpResponsePromise.fromPromise(this.__getSettings(requestOptions));
78
+ }
79
+ __getSettings(requestOptions) {
80
+ return __awaiter(this, void 0, void 0, function* () {
81
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
82
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
83
+ 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);
84
+ const _response = yield core.fetcher({
85
+ 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"),
86
+ method: "GET",
87
+ headers: _headers,
88
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
89
+ 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,
90
+ 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,
91
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
92
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
93
+ logging: this._options.logging,
94
+ });
95
+ if (_response.ok) {
96
+ return {
97
+ data: _response.body,
98
+ rawResponse: _response.rawResponse,
99
+ };
100
+ }
101
+ if (_response.error.reason === "status-code") {
102
+ switch (_response.error.statusCode) {
103
+ case 401:
104
+ throw new Pylon.UnauthorizedError(_response.error.body, _response.rawResponse);
105
+ case 403:
106
+ throw new Pylon.ForbiddenError(_response.error.body, _response.rawResponse);
107
+ case 429:
108
+ throw new Pylon.TooManyRequestsError(_response.error.body, _response.rawResponse);
109
+ case 500:
110
+ throw new Pylon.InternalServerError(_response.error.body, _response.rawResponse);
111
+ default:
112
+ throw new errors.PylonError({
113
+ statusCode: _response.error.statusCode,
114
+ body: _response.error.body,
115
+ rawResponse: _response.rawResponse,
116
+ });
117
+ }
118
+ }
119
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer-portal/settings");
120
+ });
121
+ }
122
+ /**
123
+ * Updates the organization's customer portal settings. Only provided fields are modified.
124
+ *
125
+ * **Rate limit:** 30 requests per minute
126
+ *
127
+ * @param {Pylon.CustomerPortalUpdateSettingsRequest} request
128
+ * @param {CustomerPortalClient.RequestOptions} requestOptions - Request-specific configuration.
129
+ *
130
+ * @throws {@link Pylon.BadRequestError}
131
+ * @throws {@link Pylon.UnauthorizedError}
132
+ * @throws {@link Pylon.ForbiddenError}
133
+ * @throws {@link Pylon.TooManyRequestsError}
134
+ * @throws {@link Pylon.InternalServerError}
135
+ * @throws {@link errors.PylonError}
136
+ * @throws {@link errors.PylonTimeoutError}
137
+ *
138
+ * @example
139
+ * await client.customerPortal.updateSettings()
140
+ */
141
+ updateSettings(request = {}, requestOptions) {
142
+ return core.HttpResponsePromise.fromPromise(this.__updateSettings(request, requestOptions));
143
+ }
144
+ __updateSettings() {
145
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
146
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
147
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
148
+ 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);
149
+ const _response = yield core.fetcher({
150
+ 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"),
151
+ method: "PATCH",
152
+ headers: _headers,
153
+ contentType: "application/json",
154
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
155
+ requestType: "json",
156
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
157
+ 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,
158
+ 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,
159
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
160
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
161
+ logging: this._options.logging,
162
+ });
163
+ if (_response.ok) {
164
+ return {
165
+ data: _response.body,
166
+ rawResponse: _response.rawResponse,
167
+ };
168
+ }
169
+ if (_response.error.reason === "status-code") {
170
+ switch (_response.error.statusCode) {
171
+ case 400:
172
+ throw new Pylon.BadRequestError(_response.error.body, _response.rawResponse);
173
+ case 401:
174
+ throw new Pylon.UnauthorizedError(_response.error.body, _response.rawResponse);
175
+ case 403:
176
+ throw new Pylon.ForbiddenError(_response.error.body, _response.rawResponse);
177
+ case 429:
178
+ throw new Pylon.TooManyRequestsError(_response.error.body, _response.rawResponse);
179
+ case 500:
180
+ throw new Pylon.InternalServerError(_response.error.body, _response.rawResponse);
181
+ default:
182
+ throw new errors.PylonError({
183
+ statusCode: _response.error.statusCode,
184
+ body: _response.error.body,
185
+ rawResponse: _response.rawResponse,
186
+ });
187
+ }
188
+ }
189
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/customer-portal/settings");
190
+ });
191
+ }
192
+ }
193
+ exports.CustomerPortalClient = CustomerPortalClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";