@foru-ms/sdk 2.1.4 → 2.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/BaseClient.d.ts +0 -4
- package/dist/cjs/BaseClient.js +2 -3
- package/dist/cjs/Client.d.ts +1 -1
- package/dist/cjs/Client.js +1 -1
- package/dist/cjs/api/errors/ConflictError.d.ts +6 -0
- package/dist/cjs/api/errors/ConflictError.js +54 -0
- package/dist/cjs/api/errors/ForbiddenError.d.ts +6 -0
- package/dist/cjs/api/errors/ForbiddenError.js +54 -0
- package/dist/cjs/api/errors/index.d.ts +2 -0
- package/dist/cjs/api/errors/index.js +2 -0
- package/dist/cjs/api/resources/auth/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/auth/client/Client.js +36 -46
- package/dist/cjs/api/resources/integrations/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/integrations/client/Client.js +36 -46
- package/dist/cjs/api/resources/notifications/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/notifications/client/Client.js +36 -46
- package/dist/cjs/api/resources/posts/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/posts/client/Client.js +85 -109
- package/dist/cjs/api/resources/privateMessages/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/privateMessages/client/Client.js +64 -82
- package/dist/cjs/api/resources/provisioning/client/Client.d.ts +97 -3
- package/dist/cjs/api/resources/provisioning/client/Client.js +472 -214
- package/dist/cjs/api/resources/provisioning/client/requests/AddDomainProvisioningRequest.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/CreateInstance.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/CreateWebhookProvisioningRequest.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/DeleteInstance.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/DeleteWebhookProvisioningRequest.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/ExportDataProvisioningRequest.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/GetBillingProvisioningRequest.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/GetOwnershipProvisioningRequest.d.ts +13 -0
- package/dist/cjs/api/resources/provisioning/client/requests/GetOwnershipProvisioningRequest.js +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/GetUsageProvisioningRequest.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/InviteTeamProvisioningRequest.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/ListDomainsProvisioningRequest.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/ListProvisioningRequest.d.ts +5 -1
- package/dist/cjs/api/resources/provisioning/client/requests/ListTeamProvisioningRequest.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/ListWebhooksProvisioningRequest.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/LoginProvisioningRequest.d.ts +13 -0
- package/dist/cjs/api/resources/provisioning/client/requests/LoginProvisioningRequest.js +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/RegenerateApiKeyProvisioningRequest.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/RegisterProvisioningRequest.d.ts +15 -0
- package/dist/cjs/api/resources/provisioning/client/requests/RegisterProvisioningRequest.js +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/RemoveDomainProvisioningRequest.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/RemoveTeamMemberProvisioningRequest.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/TransferOwnershipProvisioningRequest.d.ts +15 -0
- package/dist/cjs/api/resources/provisioning/client/requests/TransferOwnershipProvisioningRequest.js +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/UpdateInstance.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/UpdateWebhookProvisioningRequest.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/UpgradeInstance.d.ts +3 -0
- package/dist/cjs/api/resources/provisioning/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/provisioning/types/GetOwnershipProvisioningResponse.d.ts +4 -0
- package/dist/cjs/api/resources/provisioning/types/GetOwnershipProvisioningResponse.js +3 -0
- package/dist/cjs/api/resources/provisioning/types/LoginProvisioningResponse.d.ts +4 -0
- package/dist/cjs/api/resources/provisioning/types/LoginProvisioningResponse.js +3 -0
- package/dist/cjs/api/resources/provisioning/types/RegisterProvisioningResponse.d.ts +4 -0
- package/dist/cjs/api/resources/provisioning/types/RegisterProvisioningResponse.js +3 -0
- package/dist/cjs/api/resources/provisioning/types/TransferOwnershipProvisioningResponse.d.ts +16 -0
- package/dist/cjs/api/resources/provisioning/types/TransferOwnershipProvisioningResponse.js +3 -0
- package/dist/cjs/api/resources/provisioning/types/index.d.ts +4 -0
- package/dist/cjs/api/resources/provisioning/types/index.js +4 -0
- package/dist/cjs/api/resources/reports/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/reports/client/Client.js +36 -46
- package/dist/cjs/api/resources/roles/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/roles/client/Client.js +36 -46
- package/dist/cjs/api/resources/search/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/search/client/Client.js +8 -10
- package/dist/cjs/api/resources/ssOs/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/ssOs/client/Client.js +36 -46
- package/dist/cjs/api/resources/tags/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/tags/client/Client.js +57 -73
- package/dist/cjs/api/resources/threads/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/threads/client/Client.js +127 -163
- package/dist/cjs/api/resources/users/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/users/client/Client.js +78 -100
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/webhooks/client/Client.js +57 -73
- package/dist/cjs/api/types/ConflictErrorBody.d.ts +13 -0
- package/dist/cjs/api/types/ConflictErrorBody.js +3 -0
- package/dist/cjs/api/types/OwnershipInfo.d.ts +18 -0
- package/dist/cjs/api/types/OwnershipInfo.js +3 -0
- package/dist/cjs/api/types/ProvisioningAuthResponse.d.ts +5 -0
- package/dist/cjs/api/types/ProvisioningAuthResponse.js +3 -0
- package/dist/cjs/api/types/index.d.ts +3 -0
- package/dist/cjs/api/types/index.js +3 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +0 -4
- package/dist/esm/BaseClient.mjs +2 -3
- package/dist/esm/Client.d.mts +1 -1
- package/dist/esm/Client.mjs +1 -1
- package/dist/esm/api/errors/ConflictError.d.mts +6 -0
- package/dist/esm/api/errors/ConflictError.mjs +17 -0
- package/dist/esm/api/errors/ForbiddenError.d.mts +6 -0
- package/dist/esm/api/errors/ForbiddenError.mjs +17 -0
- package/dist/esm/api/errors/index.d.mts +2 -0
- package/dist/esm/api/errors/index.mjs +2 -0
- package/dist/esm/api/resources/auth/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/auth/client/Client.mjs +37 -47
- package/dist/esm/api/resources/integrations/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/integrations/client/Client.mjs +37 -47
- package/dist/esm/api/resources/notifications/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/notifications/client/Client.mjs +37 -47
- package/dist/esm/api/resources/posts/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/posts/client/Client.mjs +86 -110
- package/dist/esm/api/resources/privateMessages/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/privateMessages/client/Client.mjs +65 -83
- package/dist/esm/api/resources/provisioning/client/Client.d.mts +97 -3
- package/dist/esm/api/resources/provisioning/client/Client.mjs +472 -214
- package/dist/esm/api/resources/provisioning/client/requests/AddDomainProvisioningRequest.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/CreateInstance.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/CreateWebhookProvisioningRequest.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/DeleteInstance.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/DeleteWebhookProvisioningRequest.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/ExportDataProvisioningRequest.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/GetBillingProvisioningRequest.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/GetOwnershipProvisioningRequest.d.mts +13 -0
- package/dist/esm/api/resources/provisioning/client/requests/GetOwnershipProvisioningRequest.mjs +2 -0
- package/dist/esm/api/resources/provisioning/client/requests/GetUsageProvisioningRequest.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/InviteTeamProvisioningRequest.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/ListDomainsProvisioningRequest.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/ListProvisioningRequest.d.mts +5 -1
- package/dist/esm/api/resources/provisioning/client/requests/ListTeamProvisioningRequest.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/ListWebhooksProvisioningRequest.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/LoginProvisioningRequest.d.mts +13 -0
- package/dist/esm/api/resources/provisioning/client/requests/LoginProvisioningRequest.mjs +2 -0
- package/dist/esm/api/resources/provisioning/client/requests/RegenerateApiKeyProvisioningRequest.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/RegisterProvisioningRequest.d.mts +15 -0
- package/dist/esm/api/resources/provisioning/client/requests/RegisterProvisioningRequest.mjs +2 -0
- package/dist/esm/api/resources/provisioning/client/requests/RemoveDomainProvisioningRequest.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/RemoveTeamMemberProvisioningRequest.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/TransferOwnershipProvisioningRequest.d.mts +15 -0
- package/dist/esm/api/resources/provisioning/client/requests/TransferOwnershipProvisioningRequest.mjs +2 -0
- package/dist/esm/api/resources/provisioning/client/requests/UpdateInstance.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/UpdateWebhookProvisioningRequest.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/UpgradeInstance.d.mts +3 -0
- package/dist/esm/api/resources/provisioning/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/provisioning/types/GetOwnershipProvisioningResponse.d.mts +4 -0
- package/dist/esm/api/resources/provisioning/types/GetOwnershipProvisioningResponse.mjs +2 -0
- package/dist/esm/api/resources/provisioning/types/LoginProvisioningResponse.d.mts +4 -0
- package/dist/esm/api/resources/provisioning/types/LoginProvisioningResponse.mjs +2 -0
- package/dist/esm/api/resources/provisioning/types/RegisterProvisioningResponse.d.mts +4 -0
- package/dist/esm/api/resources/provisioning/types/RegisterProvisioningResponse.mjs +2 -0
- package/dist/esm/api/resources/provisioning/types/TransferOwnershipProvisioningResponse.d.mts +16 -0
- package/dist/esm/api/resources/provisioning/types/TransferOwnershipProvisioningResponse.mjs +2 -0
- package/dist/esm/api/resources/provisioning/types/index.d.mts +4 -0
- package/dist/esm/api/resources/provisioning/types/index.mjs +4 -0
- package/dist/esm/api/resources/reports/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/reports/client/Client.mjs +37 -47
- package/dist/esm/api/resources/roles/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/roles/client/Client.mjs +37 -47
- package/dist/esm/api/resources/search/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/search/client/Client.mjs +9 -11
- package/dist/esm/api/resources/ssOs/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/ssOs/client/Client.mjs +37 -47
- package/dist/esm/api/resources/tags/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/tags/client/Client.mjs +58 -74
- package/dist/esm/api/resources/threads/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/threads/client/Client.mjs +128 -164
- package/dist/esm/api/resources/users/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/users/client/Client.mjs +79 -101
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/webhooks/client/Client.mjs +58 -74
- package/dist/esm/api/types/ConflictErrorBody.d.mts +13 -0
- package/dist/esm/api/types/ConflictErrorBody.mjs +2 -0
- package/dist/esm/api/types/OwnershipInfo.d.mts +18 -0
- package/dist/esm/api/types/OwnershipInfo.mjs +2 -0
- package/dist/esm/api/types/ProvisioningAuthResponse.d.mts +5 -0
- package/dist/esm/api/types/ProvisioningAuthResponse.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +3 -0
- package/dist/esm/api/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +286 -1
|
@@ -66,7 +66,7 @@ const Forum = __importStar(require("../../../index.js"));
|
|
|
66
66
|
* Operations for webhooks
|
|
67
67
|
*/
|
|
68
68
|
class WebhooksClient {
|
|
69
|
-
constructor(options) {
|
|
69
|
+
constructor(options = {}) {
|
|
70
70
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
@@ -90,25 +90,23 @@ class WebhooksClient {
|
|
|
90
90
|
}
|
|
91
91
|
__list() {
|
|
92
92
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
93
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
93
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
94
94
|
const { limit, cursor } = request;
|
|
95
95
|
const _queryParams = {
|
|
96
96
|
limit,
|
|
97
97
|
cursor,
|
|
98
98
|
};
|
|
99
99
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
100
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
104
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "webhooks"),
|
|
100
|
+
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);
|
|
101
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
102
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "webhooks"),
|
|
105
103
|
method: "GET",
|
|
106
104
|
headers: _headers,
|
|
107
105
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
108
|
-
timeoutMs: ((
|
|
109
|
-
maxRetries: (
|
|
106
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
107
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
110
108
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
111
|
-
fetchFn: (
|
|
109
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
112
110
|
logging: this._options.logging,
|
|
113
111
|
});
|
|
114
112
|
if (_response.ok) {
|
|
@@ -161,23 +159,21 @@ class WebhooksClient {
|
|
|
161
159
|
}
|
|
162
160
|
__create(request, requestOptions) {
|
|
163
161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
164
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
162
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
165
163
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
166
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
170
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "webhooks"),
|
|
164
|
+
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);
|
|
165
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
166
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "webhooks"),
|
|
171
167
|
method: "POST",
|
|
172
168
|
headers: _headers,
|
|
173
169
|
contentType: "application/json",
|
|
174
170
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
175
171
|
requestType: "json",
|
|
176
172
|
body: request,
|
|
177
|
-
timeoutMs: ((
|
|
178
|
-
maxRetries: (
|
|
173
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
174
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
179
175
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
180
|
-
fetchFn: (
|
|
176
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
181
177
|
logging: this._options.logging,
|
|
182
178
|
});
|
|
183
179
|
if (_response.ok) {
|
|
@@ -230,21 +226,19 @@ class WebhooksClient {
|
|
|
230
226
|
}
|
|
231
227
|
__retrieve(request, requestOptions) {
|
|
232
228
|
return __awaiter(this, void 0, void 0, function* () {
|
|
233
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
229
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
234
230
|
const { id } = request;
|
|
235
231
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
236
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
240
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, `webhooks/${core.url.encodePathParam(id)}`),
|
|
232
|
+
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);
|
|
233
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
234
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `webhooks/${core.url.encodePathParam(id)}`),
|
|
241
235
|
method: "GET",
|
|
242
236
|
headers: _headers,
|
|
243
237
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
244
|
-
timeoutMs: ((
|
|
245
|
-
maxRetries: (
|
|
238
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
239
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
246
240
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
247
|
-
fetchFn: (
|
|
241
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
248
242
|
logging: this._options.logging,
|
|
249
243
|
});
|
|
250
244
|
if (_response.ok) {
|
|
@@ -297,21 +291,19 @@ class WebhooksClient {
|
|
|
297
291
|
}
|
|
298
292
|
__delete(request, requestOptions) {
|
|
299
293
|
return __awaiter(this, void 0, void 0, function* () {
|
|
300
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
294
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
301
295
|
const { id } = request;
|
|
302
296
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
303
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
307
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, `webhooks/${core.url.encodePathParam(id)}`),
|
|
297
|
+
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);
|
|
298
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
299
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `webhooks/${core.url.encodePathParam(id)}`),
|
|
308
300
|
method: "DELETE",
|
|
309
301
|
headers: _headers,
|
|
310
302
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
311
|
-
timeoutMs: ((
|
|
312
|
-
maxRetries: (
|
|
303
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
304
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
313
305
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
314
|
-
fetchFn: (
|
|
306
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
315
307
|
logging: this._options.logging,
|
|
316
308
|
});
|
|
317
309
|
if (_response.ok) {
|
|
@@ -365,24 +357,22 @@ class WebhooksClient {
|
|
|
365
357
|
}
|
|
366
358
|
__update(request, requestOptions) {
|
|
367
359
|
return __awaiter(this, void 0, void 0, function* () {
|
|
368
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
360
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
369
361
|
const { id } = request, _body = __rest(request, ["id"]);
|
|
370
362
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
371
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
375
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, `webhooks/${core.url.encodePathParam(id)}`),
|
|
363
|
+
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);
|
|
364
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
365
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `webhooks/${core.url.encodePathParam(id)}`),
|
|
376
366
|
method: "PATCH",
|
|
377
367
|
headers: _headers,
|
|
378
368
|
contentType: "application/json",
|
|
379
369
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
380
370
|
requestType: "json",
|
|
381
371
|
body: _body,
|
|
382
|
-
timeoutMs: ((
|
|
383
|
-
maxRetries: (
|
|
372
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
373
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
384
374
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
385
|
-
fetchFn: (
|
|
375
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
386
376
|
logging: this._options.logging,
|
|
387
377
|
});
|
|
388
378
|
if (_response.ok) {
|
|
@@ -436,25 +426,23 @@ class WebhooksClient {
|
|
|
436
426
|
}
|
|
437
427
|
__listDeliveries(request, requestOptions) {
|
|
438
428
|
return __awaiter(this, void 0, void 0, function* () {
|
|
439
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
429
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
440
430
|
const { id, cursor, limit } = request;
|
|
441
431
|
const _queryParams = {
|
|
442
432
|
cursor,
|
|
443
433
|
limit,
|
|
444
434
|
};
|
|
445
435
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
446
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
450
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, `webhooks/${core.url.encodePathParam(id)}/deliveries`),
|
|
436
|
+
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);
|
|
437
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
438
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `webhooks/${core.url.encodePathParam(id)}/deliveries`),
|
|
451
439
|
method: "GET",
|
|
452
440
|
headers: _headers,
|
|
453
441
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
454
|
-
timeoutMs: ((
|
|
455
|
-
maxRetries: (
|
|
442
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
443
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
456
444
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
457
|
-
fetchFn: (
|
|
445
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
458
446
|
logging: this._options.logging,
|
|
459
447
|
});
|
|
460
448
|
if (_response.ok) {
|
|
@@ -501,21 +489,19 @@ class WebhooksClient {
|
|
|
501
489
|
}
|
|
502
490
|
__retrieveDelivery(request, requestOptions) {
|
|
503
491
|
return __awaiter(this, void 0, void 0, function* () {
|
|
504
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
492
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
505
493
|
const { id, subId } = request;
|
|
506
494
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
507
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
511
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, `webhooks/${core.url.encodePathParam(id)}/deliveries/${core.url.encodePathParam(subId)}`),
|
|
495
|
+
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);
|
|
496
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
497
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `webhooks/${core.url.encodePathParam(id)}/deliveries/${core.url.encodePathParam(subId)}`),
|
|
512
498
|
method: "GET",
|
|
513
499
|
headers: _headers,
|
|
514
500
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
515
|
-
timeoutMs: ((
|
|
516
|
-
maxRetries: (
|
|
501
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
502
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
517
503
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
518
|
-
fetchFn: (
|
|
504
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
519
505
|
logging: this._options.logging,
|
|
520
506
|
});
|
|
521
507
|
if (_response.ok) {
|
|
@@ -565,21 +551,19 @@ class WebhooksClient {
|
|
|
565
551
|
}
|
|
566
552
|
__deleteDelivery(request, requestOptions) {
|
|
567
553
|
return __awaiter(this, void 0, void 0, function* () {
|
|
568
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
554
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
569
555
|
const { id, subId } = request;
|
|
570
556
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
571
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
575
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, `webhooks/${core.url.encodePathParam(id)}/deliveries/${core.url.encodePathParam(subId)}`),
|
|
557
|
+
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);
|
|
558
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
559
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `webhooks/${core.url.encodePathParam(id)}/deliveries/${core.url.encodePathParam(subId)}`),
|
|
576
560
|
method: "DELETE",
|
|
577
561
|
headers: _headers,
|
|
578
562
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
579
|
-
timeoutMs: ((
|
|
580
|
-
maxRetries: (
|
|
563
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
564
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
581
565
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
582
|
-
fetchFn: (
|
|
566
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
583
567
|
logging: this._options.logging,
|
|
584
568
|
});
|
|
585
569
|
if (_response.ok) {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface OwnershipInfo {
|
|
2
|
+
handle: string;
|
|
3
|
+
owner: OwnershipInfo.Owner;
|
|
4
|
+
creator: OwnershipInfo.Creator;
|
|
5
|
+
isCurrentUserOwner: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace OwnershipInfo {
|
|
8
|
+
interface Owner {
|
|
9
|
+
id: string;
|
|
10
|
+
email: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
}
|
|
13
|
+
interface Creator {
|
|
14
|
+
id: string;
|
|
15
|
+
email: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -2,6 +2,7 @@ export * from "./Auth.js";
|
|
|
2
2
|
export * from "./AuthListResponse.js";
|
|
3
3
|
export * from "./AuthResponse.js";
|
|
4
4
|
export * from "./BillingInfo.js";
|
|
5
|
+
export * from "./ConflictErrorBody.js";
|
|
5
6
|
export * from "./ErrorResponse.js";
|
|
6
7
|
export * from "./ForgotPasswordResponse.js";
|
|
7
8
|
export * from "./Instance.js";
|
|
@@ -22,6 +23,7 @@ export * from "./NotificationList.js";
|
|
|
22
23
|
export * from "./NotificationListResponse.js";
|
|
23
24
|
export * from "./NotificationResponse.js";
|
|
24
25
|
export * from "./NotificationUpdate.js";
|
|
26
|
+
export * from "./OwnershipInfo.js";
|
|
25
27
|
export * from "./Post.js";
|
|
26
28
|
export * from "./PostCreate.js";
|
|
27
29
|
export * from "./PostList.js";
|
|
@@ -45,6 +47,7 @@ export * from "./PrivateMessageReplyListResponse.js";
|
|
|
45
47
|
export * from "./PrivateMessageReplyResponse.js";
|
|
46
48
|
export * from "./PrivateMessageResponse.js";
|
|
47
49
|
export * from "./PrivateMessageUpdate.js";
|
|
50
|
+
export * from "./ProvisioningAuthResponse.js";
|
|
48
51
|
export * from "./RegisterResponse.js";
|
|
49
52
|
export * from "./Report.js";
|
|
50
53
|
export * from "./ReportCreate.js";
|
|
@@ -18,6 +18,7 @@ __exportStar(require("./Auth.js"), exports);
|
|
|
18
18
|
__exportStar(require("./AuthListResponse.js"), exports);
|
|
19
19
|
__exportStar(require("./AuthResponse.js"), exports);
|
|
20
20
|
__exportStar(require("./BillingInfo.js"), exports);
|
|
21
|
+
__exportStar(require("./ConflictErrorBody.js"), exports);
|
|
21
22
|
__exportStar(require("./ErrorResponse.js"), exports);
|
|
22
23
|
__exportStar(require("./ForgotPasswordResponse.js"), exports);
|
|
23
24
|
__exportStar(require("./Instance.js"), exports);
|
|
@@ -38,6 +39,7 @@ __exportStar(require("./NotificationList.js"), exports);
|
|
|
38
39
|
__exportStar(require("./NotificationListResponse.js"), exports);
|
|
39
40
|
__exportStar(require("./NotificationResponse.js"), exports);
|
|
40
41
|
__exportStar(require("./NotificationUpdate.js"), exports);
|
|
42
|
+
__exportStar(require("./OwnershipInfo.js"), exports);
|
|
41
43
|
__exportStar(require("./Post.js"), exports);
|
|
42
44
|
__exportStar(require("./PostCreate.js"), exports);
|
|
43
45
|
__exportStar(require("./PostList.js"), exports);
|
|
@@ -61,6 +63,7 @@ __exportStar(require("./PrivateMessageReplyListResponse.js"), exports);
|
|
|
61
63
|
__exportStar(require("./PrivateMessageReplyResponse.js"), exports);
|
|
62
64
|
__exportStar(require("./PrivateMessageResponse.js"), exports);
|
|
63
65
|
__exportStar(require("./PrivateMessageUpdate.js"), exports);
|
|
66
|
+
__exportStar(require("./ProvisioningAuthResponse.js"), exports);
|
|
64
67
|
__exportStar(require("./RegisterResponse.js"), exports);
|
|
65
68
|
__exportStar(require("./Report.js"), exports);
|
|
66
69
|
__exportStar(require("./ReportCreate.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.1.
|
|
1
|
+
export declare const SDK_VERSION = "2.1.6";
|
package/dist/cjs/version.js
CHANGED
|
@@ -5,8 +5,6 @@ export type BaseClientOptions = {
|
|
|
5
5
|
environment?: core.Supplier<environments.ForumEnvironment | string>;
|
|
6
6
|
/** Specify a custom URL to connect the client to. */
|
|
7
7
|
baseUrl?: core.Supplier<string>;
|
|
8
|
-
/** Override the x-provisioning-key header */
|
|
9
|
-
provisioningKey: core.Supplier<string>;
|
|
10
8
|
/** Additional headers to include in requests. */
|
|
11
9
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
12
10
|
/** The default maximum time to wait for a response in seconds. */
|
|
@@ -26,8 +24,6 @@ export interface BaseRequestOptions {
|
|
|
26
24
|
maxRetries?: number;
|
|
27
25
|
/** A hook to abort the request. */
|
|
28
26
|
abortSignal?: AbortSignal;
|
|
29
|
-
/** Override the x-provisioning-key header */
|
|
30
|
-
provisioningKey?: string;
|
|
31
27
|
/** Additional query string parameters to include in the request. */
|
|
32
28
|
queryParams?: Record<string, unknown>;
|
|
33
29
|
/** Additional headers to include in the request. */
|
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,11 +6,10 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@foru-ms/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "2.1.
|
|
10
|
-
"User-Agent": "@foru-ms/sdk/2.1.
|
|
9
|
+
"X-Fern-SDK-Version": "2.1.6",
|
|
10
|
+
"User-Agent": "@foru-ms/sdk/2.1.6",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
|
-
"x-provisioning-key": options === null || options === void 0 ? void 0 : options.provisioningKey,
|
|
14
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
15
14
|
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
|
|
16
15
|
}
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -35,7 +35,7 @@ export declare class ForumClient {
|
|
|
35
35
|
protected _integrations: IntegrationsClient | undefined;
|
|
36
36
|
protected _ssOs: SsOsClient | undefined;
|
|
37
37
|
protected _provisioning: ProvisioningClient | undefined;
|
|
38
|
-
constructor(options
|
|
38
|
+
constructor(options?: ForumClient.Options);
|
|
39
39
|
get auth(): AuthClient;
|
|
40
40
|
get search(): SearchClient;
|
|
41
41
|
get tags(): TagsClient;
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { UsersClient } from "./api/resources/users/client/Client.mjs";
|
|
|
15
15
|
import { WebhooksClient } from "./api/resources/webhooks/client/Client.mjs";
|
|
16
16
|
import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
17
17
|
export class ForumClient {
|
|
18
|
-
constructor(options) {
|
|
18
|
+
constructor(options = {}) {
|
|
19
19
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
20
20
|
}
|
|
21
21
|
get auth() {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.mjs";
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
import type * as Forum from "../index.mjs";
|
|
4
|
+
export declare class ConflictError extends errors.ForumError {
|
|
5
|
+
constructor(body: Forum.ConflictErrorBody, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class ConflictError extends errors.ForumError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "ConflictError",
|
|
7
|
+
statusCode: 409,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.mjs";
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
import type * as Forum from "../index.mjs";
|
|
4
|
+
export declare class ForbiddenError extends errors.ForumError {
|
|
5
|
+
constructor(body: Forum.ErrorResponse, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class ForbiddenError extends errors.ForumError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "ForbiddenError",
|
|
7
|
+
statusCode: 403,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -12,7 +12,7 @@ export declare namespace AuthClient {
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class AuthClient {
|
|
14
14
|
protected readonly _options: NormalizedClientOptionsWithAuth<AuthClient.Options>;
|
|
15
|
-
constructor(options
|
|
15
|
+
constructor(options?: AuthClient.Options);
|
|
16
16
|
/**
|
|
17
17
|
* Register a new user in your forum instance. Requires API key for instance identification. Returns a JWT token for subsequent authenticated requests.
|
|
18
18
|
*
|