@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
|
@@ -12,6 +12,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.getResponseBody = getResponseBody;
|
|
13
13
|
const json_js_1 = require("../json.js");
|
|
14
14
|
const BinaryResponse_js_1 = require("./BinaryResponse.js");
|
|
15
|
+
// Pins the upstream Response so undici's FinalizationRegistry can't GC it and cancel the body stream.
|
|
16
|
+
function retainResponse(target, response) {
|
|
17
|
+
Object.defineProperty(target, "__fern_response_ref", {
|
|
18
|
+
value: response,
|
|
19
|
+
enumerable: false,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: false,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
15
24
|
function getResponseBody(response, responseType) {
|
|
16
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
26
|
switch (responseType) {
|
|
@@ -31,6 +40,7 @@ function getResponseBody(response, responseType) {
|
|
|
31
40
|
},
|
|
32
41
|
};
|
|
33
42
|
}
|
|
43
|
+
retainResponse(response.body, response);
|
|
34
44
|
return response.body;
|
|
35
45
|
case "streaming":
|
|
36
46
|
if (response.body == null) {
|
|
@@ -42,6 +52,7 @@ function getResponseBody(response, responseType) {
|
|
|
42
52
|
},
|
|
43
53
|
};
|
|
44
54
|
}
|
|
55
|
+
retainResponse(response.body, response);
|
|
45
56
|
return response.body;
|
|
46
57
|
case "text":
|
|
47
58
|
return yield response.text();
|
|
@@ -14,11 +14,19 @@ function anySignal(...args) {
|
|
|
14
14
|
for (const signal of signals) {
|
|
15
15
|
if (signal.aborted) {
|
|
16
16
|
controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason);
|
|
17
|
-
|
|
17
|
+
return controller.signal;
|
|
18
18
|
}
|
|
19
19
|
signal.addEventListener("abort", () => controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason), {
|
|
20
20
|
signal: controller.signal,
|
|
21
21
|
});
|
|
22
|
+
// Re-check after adding listener: the signal may have aborted
|
|
23
|
+
// between the initial `signal.aborted` check and the `addEventListener`
|
|
24
|
+
// call above. If it did, the abort event was already dispatched and
|
|
25
|
+
// the listener will never fire — we must manually abort.
|
|
26
|
+
if (signal.aborted) {
|
|
27
|
+
controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason);
|
|
28
|
+
return controller.signal;
|
|
29
|
+
}
|
|
22
30
|
}
|
|
23
31
|
return controller.signal;
|
|
24
32
|
}
|
package/dist/cjs/core/url/qs.js
CHANGED
|
@@ -19,7 +19,7 @@ function stringifyObject(obj, prefix = "", options) {
|
|
|
19
19
|
const parts = [];
|
|
20
20
|
for (const [key, value] of Object.entries(obj)) {
|
|
21
21
|
const fullKey = prefix ? `${prefix}[${key}]` : key;
|
|
22
|
-
if (value
|
|
22
|
+
if (value == null) {
|
|
23
23
|
continue;
|
|
24
24
|
}
|
|
25
25
|
if (Array.isArray(value)) {
|
|
@@ -39,7 +39,7 @@ function stringifyObject(obj, prefix = "", options) {
|
|
|
39
39
|
else {
|
|
40
40
|
for (let i = 0; i < value.length; i++) {
|
|
41
41
|
const item = value[i];
|
|
42
|
-
if (item
|
|
42
|
+
if (item == null) {
|
|
43
43
|
continue;
|
|
44
44
|
}
|
|
45
45
|
if (typeof item === "object" && !Array.isArray(item) && item !== null) {
|
|
@@ -10,7 +10,7 @@ class BrevoError extends Error {
|
|
|
10
10
|
if (Error.captureStackTrace) {
|
|
11
11
|
Error.captureStackTrace(this, this.constructor);
|
|
12
12
|
}
|
|
13
|
-
this.name =
|
|
13
|
+
this.name = "BrevoError";
|
|
14
14
|
this.statusCode = statusCode;
|
|
15
15
|
this.body = body;
|
|
16
16
|
this.rawResponse = rawResponse;
|
|
@@ -18,6 +18,10 @@ class BrevoError extends Error {
|
|
|
18
18
|
this.cause = cause;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
get requestId() {
|
|
22
|
+
var _a, _b, _c;
|
|
23
|
+
return (_c = (_b = (_a = this.rawResponse) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b.get("x-request-id")) !== null && _c !== void 0 ? _c : undefined;
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
exports.BrevoError = BrevoError;
|
|
23
27
|
function buildMessage({ message, statusCode, body, }) {
|
|
@@ -1,18 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
|
+
})();
|
|
3
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
37
|
exports.BrevoTimeoutError = void 0;
|
|
5
|
-
|
|
38
|
+
const errors = __importStar(require("./index.js"));
|
|
39
|
+
class BrevoTimeoutError extends errors.BrevoError {
|
|
6
40
|
constructor(message, opts) {
|
|
7
|
-
super(
|
|
41
|
+
super({
|
|
42
|
+
message: message,
|
|
43
|
+
cause: opts === null || opts === void 0 ? void 0 : opts.cause,
|
|
44
|
+
});
|
|
8
45
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
9
46
|
if (Error.captureStackTrace) {
|
|
10
47
|
Error.captureStackTrace(this, this.constructor);
|
|
11
48
|
}
|
|
12
|
-
this.name =
|
|
13
|
-
if ((opts === null || opts === void 0 ? void 0 : opts.cause) != null) {
|
|
14
|
-
this.cause = opts.cause;
|
|
15
|
-
}
|
|
49
|
+
this.name = "BrevoTimeoutError";
|
|
16
50
|
}
|
|
17
51
|
}
|
|
18
52
|
exports.BrevoTimeoutError = BrevoTimeoutError;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "6.0.
|
|
1
|
+
export declare const SDK_VERSION = "6.0.2";
|
package/dist/cjs/version.js
CHANGED
|
@@ -16,6 +16,11 @@ export type BaseClientOptions = {
|
|
|
16
16
|
fetch?: typeof fetch;
|
|
17
17
|
/** Configure logging for the client. */
|
|
18
18
|
logging?: core.logging.LogConfig | core.logging.Logger;
|
|
19
|
+
/** Default options for SSE stream reconnection behavior. Has no effect on non-resumable endpoints. */
|
|
20
|
+
stream?: {
|
|
21
|
+
reconnectionEnabled?: boolean;
|
|
22
|
+
maxReconnectionAttempts?: number;
|
|
23
|
+
};
|
|
19
24
|
/** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */
|
|
20
25
|
auth?: AuthOption;
|
|
21
26
|
} & HeaderAuthProvider.AuthOptions;
|
|
@@ -30,6 +35,11 @@ export interface BaseRequestOptions {
|
|
|
30
35
|
queryParams?: Record<string, unknown>;
|
|
31
36
|
/** Additional headers to include in the request. */
|
|
32
37
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
38
|
+
/** Options for SSE stream reconnection behavior. Has no effect on non-resumable endpoints. */
|
|
39
|
+
stream?: {
|
|
40
|
+
reconnectionEnabled?: boolean;
|
|
41
|
+
maxReconnectionAttempts?: number;
|
|
42
|
+
};
|
|
33
43
|
}
|
|
34
44
|
export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
|
|
35
45
|
logging: core.logging.Logger;
|
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@getbrevo/brevo",
|
|
9
|
-
"X-Fern-SDK-Version": "6.0.
|
|
10
|
-
"User-Agent": "@getbrevo/brevo/6.0.
|
|
9
|
+
"X-Fern-SDK-Version": "6.0.2",
|
|
10
|
+
"User-Agent": "@getbrevo/brevo/6.0.2",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AccountClient } from "./api/resources/account/client/Client.mjs";
|
|
2
2
|
import { BalanceClient } from "./api/resources/balance/client/Client.mjs";
|
|
3
3
|
import { CompaniesClient } from "./api/resources/companies/client/Client.mjs";
|
|
4
|
+
import { ConsentGroupsClient } from "./api/resources/consentGroups/client/Client.mjs";
|
|
4
5
|
import { ContactsClient } from "./api/resources/contacts/client/Client.mjs";
|
|
5
6
|
import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
|
|
6
7
|
import { CouponsClient } from "./api/resources/coupons/client/Client.mjs";
|
|
@@ -28,6 +29,7 @@ import { TransactionalEmailsClient } from "./api/resources/transactionalEmails/c
|
|
|
28
29
|
import { TransactionalSmsClient } from "./api/resources/transactionalSms/client/Client.mjs";
|
|
29
30
|
import { TransactionalWhatsAppClient } from "./api/resources/transactionalWhatsApp/client/Client.mjs";
|
|
30
31
|
import { UserClient } from "./api/resources/user/client/Client.mjs";
|
|
32
|
+
import { WalletClient } from "./api/resources/wallet/client/Client.mjs";
|
|
31
33
|
import { WebhooksClient } from "./api/resources/webhooks/client/Client.mjs";
|
|
32
34
|
import { WhatsAppCampaignsClient } from "./api/resources/whatsAppCampaigns/client/Client.mjs";
|
|
33
35
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
@@ -50,6 +52,7 @@ export declare class BrevoClient {
|
|
|
50
52
|
protected _externalFeeds: ExternalFeedsClient | undefined;
|
|
51
53
|
protected _customObjects: CustomObjectsClient | undefined;
|
|
52
54
|
protected _contacts: ContactsClient | undefined;
|
|
55
|
+
protected _consentGroups: ConsentGroupsClient | undefined;
|
|
53
56
|
protected _conversations: ConversationsClient | undefined;
|
|
54
57
|
protected _ecommerce: EcommerceClient | undefined;
|
|
55
58
|
protected _coupons: CouponsClient | undefined;
|
|
@@ -60,6 +63,7 @@ export declare class BrevoClient {
|
|
|
60
63
|
protected _program: ProgramClient | undefined;
|
|
61
64
|
protected _reward: RewardClient | undefined;
|
|
62
65
|
protected _tier: TierClient | undefined;
|
|
66
|
+
protected _wallet: WalletClient | undefined;
|
|
63
67
|
protected _emailCampaigns: EmailCampaignsClient | undefined;
|
|
64
68
|
protected _smsCampaigns: SmsCampaignsClient | undefined;
|
|
65
69
|
protected _whatsAppCampaigns: WhatsAppCampaignsClient | undefined;
|
|
@@ -83,6 +87,7 @@ export declare class BrevoClient {
|
|
|
83
87
|
get externalFeeds(): ExternalFeedsClient;
|
|
84
88
|
get customObjects(): CustomObjectsClient;
|
|
85
89
|
get contacts(): ContactsClient;
|
|
90
|
+
get consentGroups(): ConsentGroupsClient;
|
|
86
91
|
get conversations(): ConversationsClient;
|
|
87
92
|
get ecommerce(): EcommerceClient;
|
|
88
93
|
get coupons(): CouponsClient;
|
|
@@ -93,6 +98,7 @@ export declare class BrevoClient {
|
|
|
93
98
|
get program(): ProgramClient;
|
|
94
99
|
get reward(): RewardClient;
|
|
95
100
|
get tier(): TierClient;
|
|
101
|
+
get wallet(): WalletClient;
|
|
96
102
|
get emailCampaigns(): EmailCampaignsClient;
|
|
97
103
|
get smsCampaigns(): SmsCampaignsClient;
|
|
98
104
|
get whatsAppCampaigns(): WhatsAppCampaignsClient;
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
import { AccountClient } from "./api/resources/account/client/Client.mjs";
|
|
12
12
|
import { BalanceClient } from "./api/resources/balance/client/Client.mjs";
|
|
13
13
|
import { CompaniesClient } from "./api/resources/companies/client/Client.mjs";
|
|
14
|
+
import { ConsentGroupsClient } from "./api/resources/consentGroups/client/Client.mjs";
|
|
14
15
|
import { ContactsClient } from "./api/resources/contacts/client/Client.mjs";
|
|
15
16
|
import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
|
|
16
17
|
import { CouponsClient } from "./api/resources/coupons/client/Client.mjs";
|
|
@@ -38,6 +39,7 @@ import { TransactionalEmailsClient } from "./api/resources/transactionalEmails/c
|
|
|
38
39
|
import { TransactionalSmsClient } from "./api/resources/transactionalSms/client/Client.mjs";
|
|
39
40
|
import { TransactionalWhatsAppClient } from "./api/resources/transactionalWhatsApp/client/Client.mjs";
|
|
40
41
|
import { UserClient } from "./api/resources/user/client/Client.mjs";
|
|
42
|
+
import { WalletClient } from "./api/resources/wallet/client/Client.mjs";
|
|
41
43
|
import { WebhooksClient } from "./api/resources/webhooks/client/Client.mjs";
|
|
42
44
|
import { WhatsAppCampaignsClient } from "./api/resources/whatsAppCampaigns/client/Client.mjs";
|
|
43
45
|
import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
@@ -86,6 +88,10 @@ export class BrevoClient {
|
|
|
86
88
|
var _a;
|
|
87
89
|
return ((_a = this._contacts) !== null && _a !== void 0 ? _a : (this._contacts = new ContactsClient(this._options)));
|
|
88
90
|
}
|
|
91
|
+
get consentGroups() {
|
|
92
|
+
var _a;
|
|
93
|
+
return ((_a = this._consentGroups) !== null && _a !== void 0 ? _a : (this._consentGroups = new ConsentGroupsClient(this._options)));
|
|
94
|
+
}
|
|
89
95
|
get conversations() {
|
|
90
96
|
var _a;
|
|
91
97
|
return ((_a = this._conversations) !== null && _a !== void 0 ? _a : (this._conversations = new ConversationsClient(this._options)));
|
|
@@ -126,6 +132,10 @@ export class BrevoClient {
|
|
|
126
132
|
var _a;
|
|
127
133
|
return ((_a = this._tier) !== null && _a !== void 0 ? _a : (this._tier = new TierClient(this._options)));
|
|
128
134
|
}
|
|
135
|
+
get wallet() {
|
|
136
|
+
var _a;
|
|
137
|
+
return ((_a = this._wallet) !== null && _a !== void 0 ? _a : (this._wallet = new WalletClient(this._options)));
|
|
138
|
+
}
|
|
129
139
|
get emailCampaigns() {
|
|
130
140
|
var _a;
|
|
131
141
|
return ((_a = this._emailCampaigns) !== null && _a !== void 0 ? _a : (this._emailCampaigns = new EmailCampaignsClient(this._options)));
|
|
@@ -47,7 +47,7 @@ export declare class BalanceClient {
|
|
|
47
47
|
* pid: "pid"
|
|
48
48
|
* })
|
|
49
49
|
*/
|
|
50
|
-
getBalanceDefinitionList(request: Brevo.GetBalanceDefinitionListRequest, requestOptions?: BalanceClient.RequestOptions): core.HttpResponsePromise<Brevo.GetBalanceDefinitionListResponse>;
|
|
50
|
+
getBalanceDefinitionList(request: Brevo.GetBalanceDefinitionListRequest, requestOptions?: BalanceClient.RequestOptions): core.HttpResponsePromise<Brevo.GetBalanceDefinitionListResponse | undefined>;
|
|
51
51
|
private __getBalanceDefinitionList;
|
|
52
52
|
/**
|
|
53
53
|
* Creates balance definition and returns information
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as Brevo from "../../../index.mjs";
|
|
5
|
+
export declare namespace ConsentGroupsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class ConsentGroupsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ConsentGroupsClient.Options>;
|
|
12
|
+
constructor(options: ConsentGroupsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Returns a paginated list of consent groups for the account.
|
|
15
|
+
*
|
|
16
|
+
* <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>
|
|
17
|
+
*
|
|
18
|
+
* @param {Brevo.GetConsentGroupsRequest} request
|
|
19
|
+
* @param {ConsentGroupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
20
|
+
*
|
|
21
|
+
* @throws {@link Brevo.BadRequestError}
|
|
22
|
+
* @throws {@link Brevo.ForbiddenError}
|
|
23
|
+
* @throws {@link Brevo.TooManyRequestsError}
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* await client.consentGroups.getConsentGroups()
|
|
27
|
+
*/
|
|
28
|
+
getConsentGroups(request?: Brevo.GetConsentGroupsRequest, requestOptions?: ConsentGroupsClient.RequestOptions): core.HttpResponsePromise<Brevo.ConsentGroupsListResponse>;
|
|
29
|
+
private __getConsentGroups;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new consent group for the account.
|
|
32
|
+
*
|
|
33
|
+
* <Note>This endpoint is only available when the Consent Groups feature is enabled for your account.</Note>
|
|
34
|
+
*
|
|
35
|
+
* @param {Brevo.CreateConsentGroupRequest} request
|
|
36
|
+
* @param {ConsentGroupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
|
+
*
|
|
38
|
+
* @throws {@link Brevo.BadRequestError}
|
|
39
|
+
* @throws {@link Brevo.ForbiddenError}
|
|
40
|
+
* @throws {@link Brevo.ConflictError}
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* await client.consentGroups.createConsentGroup({
|
|
44
|
+
* name: "Newsletter EU",
|
|
45
|
+
* signupMode: "manual"
|
|
46
|
+
* })
|
|
47
|
+
*/
|
|
48
|
+
createConsentGroup(request: Brevo.CreateConsentGroupRequest, requestOptions?: ConsentGroupsClient.RequestOptions): core.HttpResponsePromise<Brevo.ConsentGroup>;
|
|
49
|
+
private __createConsentGroup;
|
|
50
|
+
/**
|
|
51
|
+
* Returns a single consent group by ID for the account.
|
|
52
|
+
*
|
|
53
|
+
* <Note>This endpoint is only available when the Consent Groups feature is enabled for your account.</Note>
|
|
54
|
+
*
|
|
55
|
+
* @param {Brevo.GetConsentGroupRequest} request
|
|
56
|
+
* @param {ConsentGroupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
+
*
|
|
58
|
+
* @throws {@link Brevo.BadRequestError}
|
|
59
|
+
* @throws {@link Brevo.ForbiddenError}
|
|
60
|
+
* @throws {@link Brevo.NotFoundError}
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* await client.consentGroups.getConsentGroup({
|
|
64
|
+
* id: 1000000
|
|
65
|
+
* })
|
|
66
|
+
*/
|
|
67
|
+
getConsentGroup(request: Brevo.GetConsentGroupRequest, requestOptions?: ConsentGroupsClient.RequestOptions): core.HttpResponsePromise<Brevo.ConsentGroup>;
|
|
68
|
+
private __getConsentGroup;
|
|
69
|
+
/**
|
|
70
|
+
* Updates name, description, or signupMode of a consent group. At least one field must be provided.
|
|
71
|
+
*
|
|
72
|
+
* <Note>This endpoint is only available when the Consent Groups feature is enabled for your account.</Note>
|
|
73
|
+
*
|
|
74
|
+
* @param {Brevo.UpdateConsentGroupRequest} request
|
|
75
|
+
* @param {ConsentGroupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
76
|
+
*
|
|
77
|
+
* @throws {@link Brevo.BadRequestError}
|
|
78
|
+
* @throws {@link Brevo.ForbiddenError}
|
|
79
|
+
* @throws {@link Brevo.NotFoundError}
|
|
80
|
+
* @throws {@link Brevo.ConflictError}
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* await client.consentGroups.updateConsentGroup({
|
|
84
|
+
* id: 1000000
|
|
85
|
+
* })
|
|
86
|
+
*/
|
|
87
|
+
updateConsentGroup(request: Brevo.UpdateConsentGroupRequest, requestOptions?: ConsentGroupsClient.RequestOptions): core.HttpResponsePromise<Brevo.ConsentGroup>;
|
|
88
|
+
private __updateConsentGroup;
|
|
89
|
+
/**
|
|
90
|
+
* Deletes a consent group by ID and removes it from all associated contacts.
|
|
91
|
+
*
|
|
92
|
+
* <Note>This endpoint is only available when the Consent Groups feature is enabled for your account.</Note>
|
|
93
|
+
*
|
|
94
|
+
* @param {Brevo.DeleteConsentGroupRequest} request
|
|
95
|
+
* @param {ConsentGroupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
96
|
+
*
|
|
97
|
+
* @throws {@link Brevo.BadRequestError}
|
|
98
|
+
* @throws {@link Brevo.ForbiddenError}
|
|
99
|
+
* @throws {@link Brevo.NotFoundError}
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* await client.consentGroups.deleteConsentGroup({
|
|
103
|
+
* id: 1000000
|
|
104
|
+
* })
|
|
105
|
+
*/
|
|
106
|
+
deleteConsentGroup(request: Brevo.DeleteConsentGroupRequest, requestOptions?: ConsentGroupsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
107
|
+
private __deleteConsentGroup;
|
|
108
|
+
}
|