@getbrevo/brevo 6.0.1 → 6.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.d.ts +10 -0
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +6 -0
- package/dist/cjs/Client.js +68 -58
- package/dist/cjs/api/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/errors/ConflictError.js +1 -1
- package/dist/cjs/api/errors/ExpectationFailedError.js +1 -1
- package/dist/cjs/api/errors/FailedDependencyError.js +1 -1
- package/dist/cjs/api/errors/ForbiddenError.js +1 -1
- package/dist/cjs/api/errors/InternalServerError.js +1 -1
- package/dist/cjs/api/errors/MethodNotAllowedError.js +1 -1
- package/dist/cjs/api/errors/NotFoundError.js +1 -1
- package/dist/cjs/api/errors/PaymentRequiredError.js +1 -1
- package/dist/cjs/api/errors/PreconditionFailedError.js +1 -1
- package/dist/cjs/api/errors/TooEarlyError.js +1 -1
- package/dist/cjs/api/errors/TooManyRequestsError.js +1 -1
- package/dist/cjs/api/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/errors/UnprocessableEntityError.js +1 -1
- package/dist/cjs/api/errors/UnsupportedMediaTypeError.js +1 -1
- package/dist/cjs/api/resources/balance/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/consentGroups/client/Client.d.ts +108 -0
- package/dist/cjs/api/resources/consentGroups/client/Client.js +383 -0
- package/dist/cjs/api/resources/consentGroups/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/consentGroups/client/index.js +17 -0
- package/dist/cjs/api/resources/consentGroups/client/requests/CreateConsentGroupRequest.d.ts +25 -0
- package/dist/cjs/api/resources/consentGroups/client/requests/CreateConsentGroupRequest.js +12 -0
- package/dist/cjs/api/resources/consentGroups/client/requests/DeleteConsentGroupRequest.d.ts +10 -0
- package/dist/cjs/api/resources/consentGroups/client/requests/DeleteConsentGroupRequest.js +3 -0
- package/dist/cjs/api/resources/consentGroups/client/requests/GetConsentGroupRequest.d.ts +10 -0
- package/dist/cjs/api/resources/consentGroups/client/requests/GetConsentGroupRequest.js +3 -0
- package/dist/cjs/api/resources/consentGroups/client/requests/GetConsentGroupsRequest.d.ts +17 -0
- package/dist/cjs/api/resources/consentGroups/client/requests/GetConsentGroupsRequest.js +3 -0
- package/dist/cjs/api/resources/consentGroups/client/requests/UpdateConsentGroupRequest.d.ts +24 -0
- package/dist/cjs/api/resources/consentGroups/client/requests/UpdateConsentGroupRequest.js +12 -0
- package/dist/cjs/api/resources/consentGroups/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/consentGroups/client/requests/index.js +7 -0
- package/dist/cjs/api/resources/consentGroups/exports.d.ts +2 -0
- package/dist/cjs/api/resources/consentGroups/exports.js +21 -0
- package/dist/cjs/api/resources/consentGroups/index.d.ts +2 -0
- package/dist/cjs/api/resources/consentGroups/index.js +18 -0
- package/dist/cjs/api/resources/consentGroups/types/GetConsentGroupsRequestSignupMode.d.ts +5 -0
- package/dist/cjs/api/resources/consentGroups/types/GetConsentGroupsRequestSignupMode.js +8 -0
- package/dist/cjs/api/resources/consentGroups/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/consentGroups/types/index.js +17 -0
- package/dist/cjs/api/resources/contacts/client/requests/ImportContactsRequest.d.ts +2 -0
- package/dist/cjs/api/resources/contacts/types/GetContactInfoResponse.d.ts +4 -1
- package/dist/cjs/api/resources/contacts/types/GetContactStatsResponse.d.ts +1 -1
- package/dist/cjs/api/resources/deals/client/Client.js +4 -1
- package/dist/cjs/api/resources/deals/client/requests/GetCrmDealsRequest.d.ts +6 -0
- package/dist/cjs/api/resources/ecommerce/types/CreateBatchOrderResponse.d.ts +2 -2
- package/dist/cjs/api/resources/index.d.ts +5 -0
- package/dist/cjs/api/resources/index.js +6 -1
- package/dist/cjs/api/resources/transactionalEmails/types/GetTransacBlockedContactsResponse.d.ts +1 -1
- package/dist/cjs/api/resources/wallet/client/Client.d.ts +34 -0
- package/dist/cjs/api/resources/wallet/client/Client.js +126 -0
- package/dist/cjs/api/resources/wallet/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/wallet/client/index.js +17 -0
- package/dist/cjs/api/resources/wallet/client/requests/GetWalletPassInstallUrlRequest.d.ts +13 -0
- package/dist/cjs/api/resources/wallet/client/requests/GetWalletPassInstallUrlRequest.js +3 -0
- package/dist/cjs/api/resources/wallet/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/wallet/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/wallet/exports.d.ts +2 -0
- package/dist/cjs/api/resources/wallet/exports.js +21 -0
- package/dist/cjs/api/resources/wallet/index.d.ts +1 -0
- package/dist/cjs/api/resources/wallet/index.js +17 -0
- package/dist/cjs/api/types/ConsentGroup.d.ts +29 -0
- package/dist/cjs/api/types/ConsentGroup.js +12 -0
- package/dist/cjs/api/types/ConsentGroupItem.d.ts +17 -0
- package/dist/cjs/api/types/ConsentGroupItem.js +12 -0
- package/dist/cjs/api/types/ConsentGroupsListResponse.d.ts +14 -0
- package/dist/cjs/api/types/ConsentGroupsListResponse.js +3 -0
- package/dist/cjs/api/types/GetCampaignStats.d.ts +11 -11
- package/dist/cjs/api/types/GetContactDetails.d.ts +3 -0
- package/dist/cjs/api/types/WalletPassInstallUrl.d.ts +4 -0
- package/dist/cjs/api/types/WalletPassInstallUrl.js +3 -0
- package/dist/cjs/api/types/index.d.ts +4 -0
- package/dist/cjs/api/types/index.js +4 -0
- package/dist/cjs/core/fetcher/getResponseBody.js +11 -0
- package/dist/cjs/core/fetcher/signals.js +9 -1
- package/dist/cjs/core/url/qs.js +2 -2
- package/dist/cjs/errors/BrevoError.d.ts +1 -0
- package/dist/cjs/errors/BrevoError.js +5 -1
- package/dist/cjs/errors/BrevoTimeoutError.d.ts +2 -2
- package/dist/cjs/errors/BrevoTimeoutError.js +40 -6
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +10 -0
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +6 -0
- package/dist/esm/Client.mjs +10 -0
- package/dist/esm/api/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/errors/ConflictError.mjs +1 -1
- package/dist/esm/api/errors/ExpectationFailedError.mjs +1 -1
- package/dist/esm/api/errors/FailedDependencyError.mjs +1 -1
- package/dist/esm/api/errors/ForbiddenError.mjs +1 -1
- package/dist/esm/api/errors/InternalServerError.mjs +1 -1
- package/dist/esm/api/errors/MethodNotAllowedError.mjs +1 -1
- package/dist/esm/api/errors/NotFoundError.mjs +1 -1
- package/dist/esm/api/errors/PaymentRequiredError.mjs +1 -1
- package/dist/esm/api/errors/PreconditionFailedError.mjs +1 -1
- package/dist/esm/api/errors/TooEarlyError.mjs +1 -1
- package/dist/esm/api/errors/TooManyRequestsError.mjs +1 -1
- package/dist/esm/api/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/errors/UnprocessableEntityError.mjs +1 -1
- package/dist/esm/api/errors/UnsupportedMediaTypeError.mjs +1 -1
- package/dist/esm/api/resources/balance/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/consentGroups/client/Client.d.mts +108 -0
- package/dist/esm/api/resources/consentGroups/client/Client.mjs +346 -0
- package/dist/esm/api/resources/consentGroups/client/index.d.mts +1 -0
- package/dist/esm/api/resources/consentGroups/client/index.mjs +1 -0
- package/dist/esm/api/resources/consentGroups/client/requests/CreateConsentGroupRequest.d.mts +25 -0
- package/dist/esm/api/resources/consentGroups/client/requests/CreateConsentGroupRequest.mjs +9 -0
- package/dist/esm/api/resources/consentGroups/client/requests/DeleteConsentGroupRequest.d.mts +10 -0
- package/dist/esm/api/resources/consentGroups/client/requests/DeleteConsentGroupRequest.mjs +2 -0
- package/dist/esm/api/resources/consentGroups/client/requests/GetConsentGroupRequest.d.mts +10 -0
- package/dist/esm/api/resources/consentGroups/client/requests/GetConsentGroupRequest.mjs +2 -0
- package/dist/esm/api/resources/consentGroups/client/requests/GetConsentGroupsRequest.d.mts +17 -0
- package/dist/esm/api/resources/consentGroups/client/requests/GetConsentGroupsRequest.mjs +2 -0
- package/dist/esm/api/resources/consentGroups/client/requests/UpdateConsentGroupRequest.d.mts +24 -0
- package/dist/esm/api/resources/consentGroups/client/requests/UpdateConsentGroupRequest.mjs +9 -0
- package/dist/esm/api/resources/consentGroups/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/consentGroups/client/requests/index.mjs +2 -0
- package/dist/esm/api/resources/consentGroups/exports.d.mts +2 -0
- package/dist/esm/api/resources/consentGroups/exports.mjs +3 -0
- package/dist/esm/api/resources/consentGroups/index.d.mts +2 -0
- package/dist/esm/api/resources/consentGroups/index.mjs +2 -0
- package/dist/esm/api/resources/consentGroups/types/GetConsentGroupsRequestSignupMode.d.mts +5 -0
- package/dist/esm/api/resources/consentGroups/types/GetConsentGroupsRequestSignupMode.mjs +5 -0
- package/dist/esm/api/resources/consentGroups/types/index.d.mts +1 -0
- package/dist/esm/api/resources/consentGroups/types/index.mjs +1 -0
- package/dist/esm/api/resources/contacts/client/requests/ImportContactsRequest.d.mts +2 -0
- package/dist/esm/api/resources/contacts/types/GetContactInfoResponse.d.mts +4 -1
- package/dist/esm/api/resources/contacts/types/GetContactStatsResponse.d.mts +1 -1
- package/dist/esm/api/resources/deals/client/Client.mjs +4 -1
- package/dist/esm/api/resources/deals/client/requests/GetCrmDealsRequest.d.mts +6 -0
- package/dist/esm/api/resources/ecommerce/types/CreateBatchOrderResponse.d.mts +2 -2
- package/dist/esm/api/resources/index.d.mts +5 -0
- package/dist/esm/api/resources/index.mjs +5 -0
- package/dist/esm/api/resources/transactionalEmails/types/GetTransacBlockedContactsResponse.d.mts +1 -1
- package/dist/esm/api/resources/wallet/client/Client.d.mts +34 -0
- package/dist/esm/api/resources/wallet/client/Client.mjs +89 -0
- package/dist/esm/api/resources/wallet/client/index.d.mts +1 -0
- package/dist/esm/api/resources/wallet/client/index.mjs +1 -0
- package/dist/esm/api/resources/wallet/client/requests/GetWalletPassInstallUrlRequest.d.mts +13 -0
- package/dist/esm/api/resources/wallet/client/requests/GetWalletPassInstallUrlRequest.mjs +2 -0
- package/dist/esm/api/resources/wallet/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/wallet/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/wallet/exports.d.mts +2 -0
- package/dist/esm/api/resources/wallet/exports.mjs +3 -0
- package/dist/esm/api/resources/wallet/index.d.mts +1 -0
- package/dist/esm/api/resources/wallet/index.mjs +1 -0
- package/dist/esm/api/types/ConsentGroup.d.mts +29 -0
- package/dist/esm/api/types/ConsentGroup.mjs +9 -0
- package/dist/esm/api/types/ConsentGroupItem.d.mts +17 -0
- package/dist/esm/api/types/ConsentGroupItem.mjs +9 -0
- package/dist/esm/api/types/ConsentGroupsListResponse.d.mts +14 -0
- package/dist/esm/api/types/ConsentGroupsListResponse.mjs +2 -0
- package/dist/esm/api/types/GetCampaignStats.d.mts +11 -11
- package/dist/esm/api/types/GetContactDetails.d.mts +3 -0
- package/dist/esm/api/types/WalletPassInstallUrl.d.mts +4 -0
- package/dist/esm/api/types/WalletPassInstallUrl.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +4 -0
- package/dist/esm/api/types/index.mjs +4 -0
- package/dist/esm/core/fetcher/getResponseBody.mjs +11 -0
- package/dist/esm/core/fetcher/signals.mjs +9 -1
- package/dist/esm/core/url/qs.mjs +2 -2
- package/dist/esm/errors/BrevoError.d.mts +1 -0
- package/dist/esm/errors/BrevoError.mjs +5 -1
- package/dist/esm/errors/BrevoTimeoutError.d.mts +2 -2
- package/dist/esm/errors/BrevoTimeoutError.mjs +7 -6
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +23 -1
- package/reference.md +403 -1
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
24
|
+
import * as core from "../../../../core/index.mjs";
|
|
25
|
+
import * as environments from "../../../../environments.mjs";
|
|
26
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
28
|
+
import * as Brevo from "../../../index.mjs";
|
|
29
|
+
export class ConsentGroupsClient {
|
|
30
|
+
constructor(options) {
|
|
31
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Returns a paginated list of consent groups for the account.
|
|
35
|
+
*
|
|
36
|
+
* <Note>This endpoint is only available when the Consent Groups feature is enabled for your account. Returns `403` if the feature is not activated.</Note>
|
|
37
|
+
*
|
|
38
|
+
* @param {Brevo.GetConsentGroupsRequest} request
|
|
39
|
+
* @param {ConsentGroupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
|
+
*
|
|
41
|
+
* @throws {@link Brevo.BadRequestError}
|
|
42
|
+
* @throws {@link Brevo.ForbiddenError}
|
|
43
|
+
* @throws {@link Brevo.TooManyRequestsError}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* await client.consentGroups.getConsentGroups()
|
|
47
|
+
*/
|
|
48
|
+
getConsentGroups(request = {}, requestOptions) {
|
|
49
|
+
return core.HttpResponsePromise.fromPromise(this.__getConsentGroups(request, requestOptions));
|
|
50
|
+
}
|
|
51
|
+
__getConsentGroups() {
|
|
52
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
54
|
+
const { limit, offset, id, name, signupMode } = request;
|
|
55
|
+
const _queryParams = {
|
|
56
|
+
limit,
|
|
57
|
+
offset,
|
|
58
|
+
id,
|
|
59
|
+
name,
|
|
60
|
+
signupMode: signupMode != null ? signupMode : undefined,
|
|
61
|
+
};
|
|
62
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
63
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
64
|
+
const _response = yield core.fetcher({
|
|
65
|
+
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.BrevoEnvironment.Default, "contacts/consent-groups"),
|
|
66
|
+
method: "GET",
|
|
67
|
+
headers: _headers,
|
|
68
|
+
queryString: core.url
|
|
69
|
+
.queryBuilder()
|
|
70
|
+
.addMany(_queryParams)
|
|
71
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
72
|
+
.build(),
|
|
73
|
+
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,
|
|
74
|
+
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,
|
|
75
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
76
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
77
|
+
logging: this._options.logging,
|
|
78
|
+
});
|
|
79
|
+
if (_response.ok) {
|
|
80
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
81
|
+
}
|
|
82
|
+
if (_response.error.reason === "status-code") {
|
|
83
|
+
switch (_response.error.statusCode) {
|
|
84
|
+
case 400:
|
|
85
|
+
throw new Brevo.BadRequestError(_response.error.body, _response.rawResponse);
|
|
86
|
+
case 403:
|
|
87
|
+
throw new Brevo.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
88
|
+
case 429:
|
|
89
|
+
throw new Brevo.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
90
|
+
default:
|
|
91
|
+
throw new errors.BrevoError({
|
|
92
|
+
statusCode: _response.error.statusCode,
|
|
93
|
+
body: _response.error.body,
|
|
94
|
+
rawResponse: _response.rawResponse,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/contacts/consent-groups");
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Creates a new consent group for the account.
|
|
103
|
+
*
|
|
104
|
+
* <Note>This endpoint is only available when the Consent Groups feature is enabled for your account.</Note>
|
|
105
|
+
*
|
|
106
|
+
* @param {Brevo.CreateConsentGroupRequest} request
|
|
107
|
+
* @param {ConsentGroupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
|
+
*
|
|
109
|
+
* @throws {@link Brevo.BadRequestError}
|
|
110
|
+
* @throws {@link Brevo.ForbiddenError}
|
|
111
|
+
* @throws {@link Brevo.ConflictError}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* await client.consentGroups.createConsentGroup({
|
|
115
|
+
* name: "Newsletter EU",
|
|
116
|
+
* signupMode: "manual"
|
|
117
|
+
* })
|
|
118
|
+
*/
|
|
119
|
+
createConsentGroup(request, requestOptions) {
|
|
120
|
+
return core.HttpResponsePromise.fromPromise(this.__createConsentGroup(request, requestOptions));
|
|
121
|
+
}
|
|
122
|
+
__createConsentGroup(request, requestOptions) {
|
|
123
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
125
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
126
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
127
|
+
const _response = yield core.fetcher({
|
|
128
|
+
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.BrevoEnvironment.Default, "contacts/consent-groups"),
|
|
129
|
+
method: "POST",
|
|
130
|
+
headers: _headers,
|
|
131
|
+
contentType: "application/json",
|
|
132
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
133
|
+
requestType: "json",
|
|
134
|
+
body: request,
|
|
135
|
+
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,
|
|
136
|
+
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,
|
|
137
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
138
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
139
|
+
logging: this._options.logging,
|
|
140
|
+
});
|
|
141
|
+
if (_response.ok) {
|
|
142
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
143
|
+
}
|
|
144
|
+
if (_response.error.reason === "status-code") {
|
|
145
|
+
switch (_response.error.statusCode) {
|
|
146
|
+
case 400:
|
|
147
|
+
throw new Brevo.BadRequestError(_response.error.body, _response.rawResponse);
|
|
148
|
+
case 403:
|
|
149
|
+
throw new Brevo.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
150
|
+
case 409:
|
|
151
|
+
throw new Brevo.ConflictError(_response.error.body, _response.rawResponse);
|
|
152
|
+
default:
|
|
153
|
+
throw new errors.BrevoError({
|
|
154
|
+
statusCode: _response.error.statusCode,
|
|
155
|
+
body: _response.error.body,
|
|
156
|
+
rawResponse: _response.rawResponse,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/contacts/consent-groups");
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Returns a single consent group by ID for the account.
|
|
165
|
+
*
|
|
166
|
+
* <Note>This endpoint is only available when the Consent Groups feature is enabled for your account.</Note>
|
|
167
|
+
*
|
|
168
|
+
* @param {Brevo.GetConsentGroupRequest} request
|
|
169
|
+
* @param {ConsentGroupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
170
|
+
*
|
|
171
|
+
* @throws {@link Brevo.BadRequestError}
|
|
172
|
+
* @throws {@link Brevo.ForbiddenError}
|
|
173
|
+
* @throws {@link Brevo.NotFoundError}
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* await client.consentGroups.getConsentGroup({
|
|
177
|
+
* id: 1000000
|
|
178
|
+
* })
|
|
179
|
+
*/
|
|
180
|
+
getConsentGroup(request, requestOptions) {
|
|
181
|
+
return core.HttpResponsePromise.fromPromise(this.__getConsentGroup(request, requestOptions));
|
|
182
|
+
}
|
|
183
|
+
__getConsentGroup(request, requestOptions) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
186
|
+
const { id } = request;
|
|
187
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
188
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
189
|
+
const _response = yield core.fetcher({
|
|
190
|
+
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.BrevoEnvironment.Default, `contacts/consent-groups/${core.url.encodePathParam(id)}`),
|
|
191
|
+
method: "GET",
|
|
192
|
+
headers: _headers,
|
|
193
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
194
|
+
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,
|
|
195
|
+
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,
|
|
196
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
197
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
198
|
+
logging: this._options.logging,
|
|
199
|
+
});
|
|
200
|
+
if (_response.ok) {
|
|
201
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
202
|
+
}
|
|
203
|
+
if (_response.error.reason === "status-code") {
|
|
204
|
+
switch (_response.error.statusCode) {
|
|
205
|
+
case 400:
|
|
206
|
+
throw new Brevo.BadRequestError(_response.error.body, _response.rawResponse);
|
|
207
|
+
case 403:
|
|
208
|
+
throw new Brevo.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
209
|
+
case 404:
|
|
210
|
+
throw new Brevo.NotFoundError(_response.error.body, _response.rawResponse);
|
|
211
|
+
default:
|
|
212
|
+
throw new errors.BrevoError({
|
|
213
|
+
statusCode: _response.error.statusCode,
|
|
214
|
+
body: _response.error.body,
|
|
215
|
+
rawResponse: _response.rawResponse,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/contacts/consent-groups/{id}");
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Updates name, description, or signupMode of a consent group. At least one field must be provided.
|
|
224
|
+
*
|
|
225
|
+
* <Note>This endpoint is only available when the Consent Groups feature is enabled for your account.</Note>
|
|
226
|
+
*
|
|
227
|
+
* @param {Brevo.UpdateConsentGroupRequest} request
|
|
228
|
+
* @param {ConsentGroupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
229
|
+
*
|
|
230
|
+
* @throws {@link Brevo.BadRequestError}
|
|
231
|
+
* @throws {@link Brevo.ForbiddenError}
|
|
232
|
+
* @throws {@link Brevo.NotFoundError}
|
|
233
|
+
* @throws {@link Brevo.ConflictError}
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* await client.consentGroups.updateConsentGroup({
|
|
237
|
+
* id: 1000000
|
|
238
|
+
* })
|
|
239
|
+
*/
|
|
240
|
+
updateConsentGroup(request, requestOptions) {
|
|
241
|
+
return core.HttpResponsePromise.fromPromise(this.__updateConsentGroup(request, requestOptions));
|
|
242
|
+
}
|
|
243
|
+
__updateConsentGroup(request, requestOptions) {
|
|
244
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
245
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
246
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
247
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
248
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
249
|
+
const _response = yield core.fetcher({
|
|
250
|
+
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.BrevoEnvironment.Default, `contacts/consent-groups/${core.url.encodePathParam(id)}`),
|
|
251
|
+
method: "PUT",
|
|
252
|
+
headers: _headers,
|
|
253
|
+
contentType: "application/json",
|
|
254
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
255
|
+
requestType: "json",
|
|
256
|
+
body: _body,
|
|
257
|
+
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,
|
|
258
|
+
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,
|
|
259
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
260
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
261
|
+
logging: this._options.logging,
|
|
262
|
+
});
|
|
263
|
+
if (_response.ok) {
|
|
264
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
265
|
+
}
|
|
266
|
+
if (_response.error.reason === "status-code") {
|
|
267
|
+
switch (_response.error.statusCode) {
|
|
268
|
+
case 400:
|
|
269
|
+
throw new Brevo.BadRequestError(_response.error.body, _response.rawResponse);
|
|
270
|
+
case 403:
|
|
271
|
+
throw new Brevo.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
272
|
+
case 404:
|
|
273
|
+
throw new Brevo.NotFoundError(_response.error.body, _response.rawResponse);
|
|
274
|
+
case 409:
|
|
275
|
+
throw new Brevo.ConflictError(_response.error.body, _response.rawResponse);
|
|
276
|
+
default:
|
|
277
|
+
throw new errors.BrevoError({
|
|
278
|
+
statusCode: _response.error.statusCode,
|
|
279
|
+
body: _response.error.body,
|
|
280
|
+
rawResponse: _response.rawResponse,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/contacts/consent-groups/{id}");
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Deletes a consent group by ID and removes it from all associated contacts.
|
|
289
|
+
*
|
|
290
|
+
* <Note>This endpoint is only available when the Consent Groups feature is enabled for your account.</Note>
|
|
291
|
+
*
|
|
292
|
+
* @param {Brevo.DeleteConsentGroupRequest} request
|
|
293
|
+
* @param {ConsentGroupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
294
|
+
*
|
|
295
|
+
* @throws {@link Brevo.BadRequestError}
|
|
296
|
+
* @throws {@link Brevo.ForbiddenError}
|
|
297
|
+
* @throws {@link Brevo.NotFoundError}
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* await client.consentGroups.deleteConsentGroup({
|
|
301
|
+
* id: 1000000
|
|
302
|
+
* })
|
|
303
|
+
*/
|
|
304
|
+
deleteConsentGroup(request, requestOptions) {
|
|
305
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteConsentGroup(request, requestOptions));
|
|
306
|
+
}
|
|
307
|
+
__deleteConsentGroup(request, requestOptions) {
|
|
308
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
309
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
310
|
+
const { id } = request;
|
|
311
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
312
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
313
|
+
const _response = yield core.fetcher({
|
|
314
|
+
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.BrevoEnvironment.Default, `contacts/consent-groups/${core.url.encodePathParam(id)}`),
|
|
315
|
+
method: "DELETE",
|
|
316
|
+
headers: _headers,
|
|
317
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
318
|
+
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,
|
|
319
|
+
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,
|
|
320
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
321
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
322
|
+
logging: this._options.logging,
|
|
323
|
+
});
|
|
324
|
+
if (_response.ok) {
|
|
325
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
326
|
+
}
|
|
327
|
+
if (_response.error.reason === "status-code") {
|
|
328
|
+
switch (_response.error.statusCode) {
|
|
329
|
+
case 400:
|
|
330
|
+
throw new Brevo.BadRequestError(_response.error.body, _response.rawResponse);
|
|
331
|
+
case 403:
|
|
332
|
+
throw new Brevo.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
333
|
+
case 404:
|
|
334
|
+
throw new Brevo.NotFoundError(_response.error.body, _response.rawResponse);
|
|
335
|
+
default:
|
|
336
|
+
throw new errors.BrevoError({
|
|
337
|
+
statusCode: _response.error.statusCode,
|
|
338
|
+
body: _response.error.body,
|
|
339
|
+
rawResponse: _response.rawResponse,
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/contacts/consent-groups/{id}");
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* name: "Newsletter EU",
|
|
5
|
+
* signupMode: "manual"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface CreateConsentGroupRequest {
|
|
9
|
+
/** Unique name for the consent group (max 255 characters) */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Optional description (max 500 characters) */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Controls how contacts are added to the group. `manual` — contacts are added explicitly via the API. `automatic` — contacts are added automatically at signup. */
|
|
14
|
+
signupMode: CreateConsentGroupRequest.SignupMode;
|
|
15
|
+
/** Optional list of contact list IDs. Contacts from these lists will be copied once into this consent group at creation time. */
|
|
16
|
+
listIds?: number[];
|
|
17
|
+
}
|
|
18
|
+
export declare namespace CreateConsentGroupRequest {
|
|
19
|
+
/** Controls how contacts are added to the group. `manual` — contacts are added explicitly via the API. `automatic` — contacts are added automatically at signup. */
|
|
20
|
+
const SignupMode: {
|
|
21
|
+
readonly Manual: "manual";
|
|
22
|
+
readonly Automatic: "automatic";
|
|
23
|
+
};
|
|
24
|
+
type SignupMode = (typeof SignupMode)[keyof typeof SignupMode];
|
|
25
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var CreateConsentGroupRequest;
|
|
3
|
+
(function (CreateConsentGroupRequest) {
|
|
4
|
+
/** Controls how contacts are added to the group. `manual` — contacts are added explicitly via the API. `automatic` — contacts are added automatically at signup. */
|
|
5
|
+
CreateConsentGroupRequest.SignupMode = {
|
|
6
|
+
Manual: "manual",
|
|
7
|
+
Automatic: "automatic",
|
|
8
|
+
};
|
|
9
|
+
})(CreateConsentGroupRequest || (CreateConsentGroupRequest = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as Brevo from "../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {}
|
|
5
|
+
*/
|
|
6
|
+
export interface GetConsentGroupsRequest {
|
|
7
|
+
/** Maximum number of results to return (default 10, max 50) */
|
|
8
|
+
limit?: number;
|
|
9
|
+
/** Number of results to skip (default 0) */
|
|
10
|
+
offset?: number;
|
|
11
|
+
/** Filter by consent group ID */
|
|
12
|
+
id?: number;
|
|
13
|
+
/** Filter by name (case-insensitive partial match) */
|
|
14
|
+
name?: string;
|
|
15
|
+
/** Filter by signup mode */
|
|
16
|
+
signupMode?: Brevo.GetConsentGroupsRequestSignupMode;
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* id: 1000000
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface UpdateConsentGroupRequest {
|
|
8
|
+
/** ID of the consent group to update */
|
|
9
|
+
id: number;
|
|
10
|
+
/** New name for the consent group (max 255 characters) */
|
|
11
|
+
name?: string;
|
|
12
|
+
/** New description (max 500 characters) */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** New signup mode */
|
|
15
|
+
signupMode?: UpdateConsentGroupRequest.SignupMode;
|
|
16
|
+
}
|
|
17
|
+
export declare namespace UpdateConsentGroupRequest {
|
|
18
|
+
/** New signup mode */
|
|
19
|
+
const SignupMode: {
|
|
20
|
+
readonly Manual: "manual";
|
|
21
|
+
readonly Automatic: "automatic";
|
|
22
|
+
};
|
|
23
|
+
type SignupMode = (typeof SignupMode)[keyof typeof SignupMode];
|
|
24
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var UpdateConsentGroupRequest;
|
|
3
|
+
(function (UpdateConsentGroupRequest) {
|
|
4
|
+
/** New signup mode */
|
|
5
|
+
UpdateConsentGroupRequest.SignupMode = {
|
|
6
|
+
Manual: "manual",
|
|
7
|
+
Automatic: "automatic",
|
|
8
|
+
};
|
|
9
|
+
})(UpdateConsentGroupRequest || (UpdateConsentGroupRequest = {}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { CreateConsentGroupRequest } from "./CreateConsentGroupRequest.mjs";
|
|
2
|
+
export type { DeleteConsentGroupRequest } from "./DeleteConsentGroupRequest.mjs";
|
|
3
|
+
export type { GetConsentGroupRequest } from "./GetConsentGroupRequest.mjs";
|
|
4
|
+
export type { GetConsentGroupsRequest } from "./GetConsentGroupsRequest.mjs";
|
|
5
|
+
export { UpdateConsentGroupRequest } from "./UpdateConsentGroupRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./GetConsentGroupsRequestSignupMode.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./GetConsentGroupsRequestSignupMode.mjs";
|
|
@@ -17,6 +17,8 @@ export interface ImportContactsRequest {
|
|
|
17
17
|
jsonBody?: ImportContactsRequest.JsonBody.Item[];
|
|
18
18
|
/** **Mandatory if newList is not defined.** Ids of the lists in which the contacts shall be imported. For example, **[2, 4, 7]**. */
|
|
19
19
|
listIds?: number[];
|
|
20
|
+
/** **Optional.** Ids of the consent groups to which all imported contacts will be added. Requires consent groups to be enabled for the organisation. For example, **[1, 3]**. */
|
|
21
|
+
consentGroupIds?: number[];
|
|
20
22
|
/** To create a new list and import the contacts into it, pass the listName and an optional folderId. */
|
|
21
23
|
newList?: ImportContactsRequest.NewList;
|
|
22
24
|
/** URL that will be called once the import process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as Brevo from "../../../index.mjs";
|
|
1
2
|
export interface GetContactInfoResponse {
|
|
2
3
|
/** Set of attributes of the contact */
|
|
3
4
|
attributes: GetContactInfoResponse.Attributes;
|
|
@@ -17,6 +18,8 @@ export interface GetContactInfoResponse {
|
|
|
17
18
|
smsBlacklisted: boolean;
|
|
18
19
|
/** Blacklist status for WhatsApp campaigns (true=blacklisted, false=not blacklisted) */
|
|
19
20
|
whatsappBlacklisted: boolean;
|
|
21
|
+
/** Consent groups the contact belongs to, with their subscription status. Only present when the Consent Groups feature is enabled for your account. */
|
|
22
|
+
consentGroups?: Brevo.ConsentGroupItem[] | undefined;
|
|
20
23
|
/** Campaign statistics of the contact */
|
|
21
24
|
statistics: GetContactInfoResponse.Statistics;
|
|
22
25
|
}
|
|
@@ -158,7 +161,7 @@ export declare namespace GetContactInfoResponse {
|
|
|
158
161
|
namespace UserUnsubscription {
|
|
159
162
|
interface Item {
|
|
160
163
|
/** ID of the campaign which generated the event */
|
|
161
|
-
campaignId: number;
|
|
164
|
+
campaignId: number | null;
|
|
162
165
|
/** UTC date-time of the event */
|
|
163
166
|
eventTime: string;
|
|
164
167
|
/** IP from which the user has unsubscribed */
|
|
@@ -125,7 +125,7 @@ export declare namespace GetContactStatsResponse {
|
|
|
125
125
|
namespace UserUnsubscription {
|
|
126
126
|
interface Item {
|
|
127
127
|
/** ID of the campaign which generated the event */
|
|
128
|
-
campaignId: number;
|
|
128
|
+
campaignId: number | null;
|
|
129
129
|
/** UTC date-time of the event */
|
|
130
130
|
eventTime: string;
|
|
131
131
|
/** IP from which the user has unsubscribed */
|
|
@@ -98,9 +98,12 @@ export class DealsClient {
|
|
|
98
98
|
__getAllDeals() {
|
|
99
99
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
100
100
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
101
|
-
const { "filters[attributes.deal_name]": filtersAttributesDealName, "filters[linkedCompaniesIds]": filtersLinkedCompaniesIds, "filters[linkedContactsIds]": filtersLinkedContactsIds, modifiedSince, createdSince, offset, limit, sort, sortBy, } = request;
|
|
101
|
+
const { "filters[attributes.deal_name]": filtersAttributesDealName, "filters[attributes.deal_owner]": filtersAttributesDealOwner, "filters[attributes.deal_stage]": filtersAttributesDealStage, "filters[attributes.pipeline]": filtersAttributesPipeline, "filters[linkedCompaniesIds]": filtersLinkedCompaniesIds, "filters[linkedContactsIds]": filtersLinkedContactsIds, modifiedSince, createdSince, offset, limit, sort, sortBy, } = request;
|
|
102
102
|
const _queryParams = {
|
|
103
103
|
"filters[attributes.deal_name]": filtersAttributesDealName,
|
|
104
|
+
"filters[attributes.deal_owner]": filtersAttributesDealOwner,
|
|
105
|
+
"filters[attributes.deal_stage]": filtersAttributesDealStage,
|
|
106
|
+
"filters[attributes.pipeline]": filtersAttributesPipeline,
|
|
104
107
|
"filters[linkedCompaniesIds]": filtersLinkedCompaniesIds,
|
|
105
108
|
"filters[linkedContactsIds]": filtersLinkedContactsIds,
|
|
106
109
|
modifiedSince,
|
|
@@ -6,6 +6,12 @@ import type * as Brevo from "../../../../index.mjs";
|
|
|
6
6
|
export interface GetCrmDealsRequest {
|
|
7
7
|
/** Filter by attributes. If you have a filter for the owner on your end, please send it as filters[attributes.deal_owner] and utilize the account email for the filtering. */
|
|
8
8
|
"filters[attributes.deal_name]"?: string;
|
|
9
|
+
/** Filter by the deal owner. Pass the account email address of the deal owner. */
|
|
10
|
+
"filters[attributes.deal_owner]"?: string;
|
|
11
|
+
/** Filter by the deal stage. Pass the stage id, retrievable from GET /crm/pipeline/details/{pipelineID}. */
|
|
12
|
+
"filters[attributes.deal_stage]"?: string;
|
|
13
|
+
/** Filter by the pipeline. Pass the pipeline id, retrievable from GET /crm/pipeline/details/{pipelineID}. */
|
|
14
|
+
"filters[attributes.pipeline]"?: string;
|
|
9
15
|
/** Filter by linked companies ids */
|
|
10
16
|
"filters[linkedCompaniesIds]"?: string;
|
|
11
17
|
/** Filter by linked contacts ids */
|
|
@@ -7,6 +7,9 @@ export * from "./balance/types/index.mjs";
|
|
|
7
7
|
export * from "./companies/client/requests/index.mjs";
|
|
8
8
|
export * as companies from "./companies/index.mjs";
|
|
9
9
|
export * from "./companies/types/index.mjs";
|
|
10
|
+
export * from "./consentGroups/client/requests/index.mjs";
|
|
11
|
+
export * as consentGroups from "./consentGroups/index.mjs";
|
|
12
|
+
export * from "./consentGroups/types/index.mjs";
|
|
10
13
|
export * from "./contacts/client/requests/index.mjs";
|
|
11
14
|
export * as contacts from "./contacts/index.mjs";
|
|
12
15
|
export * from "./contacts/types/index.mjs";
|
|
@@ -87,6 +90,8 @@ export * from "./transactionalWhatsApp/types/index.mjs";
|
|
|
87
90
|
export * from "./user/client/requests/index.mjs";
|
|
88
91
|
export * as user from "./user/index.mjs";
|
|
89
92
|
export * from "./user/types/index.mjs";
|
|
93
|
+
export * from "./wallet/client/requests/index.mjs";
|
|
94
|
+
export * as wallet from "./wallet/index.mjs";
|
|
90
95
|
export * from "./webhooks/client/requests/index.mjs";
|
|
91
96
|
export * as webhooks from "./webhooks/index.mjs";
|
|
92
97
|
export * from "./webhooks/types/index.mjs";
|