@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
|
@@ -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";
|
package/dist/esm/api/resources/transactionalEmails/types/GetTransacBlockedContactsResponse.d.mts
CHANGED
|
@@ -14,7 +14,7 @@ export declare namespace GetTransacBlockedContactsResponse {
|
|
|
14
14
|
/** Reason for blocking / unsubscribing */
|
|
15
15
|
reason: Item.Reason;
|
|
16
16
|
/** Sender email address of the blocked or unsubscribed contact */
|
|
17
|
-
senderEmail: string;
|
|
17
|
+
senderEmail: string | null;
|
|
18
18
|
}
|
|
19
19
|
namespace Item {
|
|
20
20
|
/**
|
|
@@ -0,0 +1,34 @@
|
|
|
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 WalletClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class WalletClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<WalletClient.Options>;
|
|
12
|
+
constructor(options: WalletClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Generate a wallet installation URL for a specific contact. The returned URL points to the pass installation page and encodes the pass, contact and organization identifiers as an encrypted token, so it can be shared with the contact (email, SMS, QR code, ...) to add the pass to their Apple Wallet or Google Wallet.
|
|
15
|
+
*
|
|
16
|
+
* @param {Brevo.GetWalletPassInstallUrlRequest} request
|
|
17
|
+
* @param {WalletClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link Brevo.BadRequestError}
|
|
20
|
+
* @throws {@link Brevo.UnauthorizedError}
|
|
21
|
+
* @throws {@link Brevo.ForbiddenError}
|
|
22
|
+
* @throws {@link Brevo.NotFoundError}
|
|
23
|
+
* @throws {@link Brevo.UnprocessableEntityError}
|
|
24
|
+
* @throws {@link Brevo.InternalServerError}
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* await client.wallet.getWalletPassInstallUrl({
|
|
28
|
+
* passId: "passId",
|
|
29
|
+
* contactId: 1000000
|
|
30
|
+
* })
|
|
31
|
+
*/
|
|
32
|
+
getWalletPassInstallUrl(request: Brevo.GetWalletPassInstallUrlRequest, requestOptions?: WalletClient.RequestOptions): core.HttpResponsePromise<Brevo.WalletPassInstallUrl>;
|
|
33
|
+
private __getWalletPassInstallUrl;
|
|
34
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
+
import * as Brevo from "../../../index.mjs";
|
|
18
|
+
export class WalletClient {
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Generate a wallet installation URL for a specific contact. The returned URL points to the pass installation page and encodes the pass, contact and organization identifiers as an encrypted token, so it can be shared with the contact (email, SMS, QR code, ...) to add the pass to their Apple Wallet or Google Wallet.
|
|
24
|
+
*
|
|
25
|
+
* @param {Brevo.GetWalletPassInstallUrlRequest} request
|
|
26
|
+
* @param {WalletClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link Brevo.BadRequestError}
|
|
29
|
+
* @throws {@link Brevo.UnauthorizedError}
|
|
30
|
+
* @throws {@link Brevo.ForbiddenError}
|
|
31
|
+
* @throws {@link Brevo.NotFoundError}
|
|
32
|
+
* @throws {@link Brevo.UnprocessableEntityError}
|
|
33
|
+
* @throws {@link Brevo.InternalServerError}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* await client.wallet.getWalletPassInstallUrl({
|
|
37
|
+
* passId: "passId",
|
|
38
|
+
* contactId: 1000000
|
|
39
|
+
* })
|
|
40
|
+
*/
|
|
41
|
+
getWalletPassInstallUrl(request, requestOptions) {
|
|
42
|
+
return core.HttpResponsePromise.fromPromise(this.__getWalletPassInstallUrl(request, requestOptions));
|
|
43
|
+
}
|
|
44
|
+
__getWalletPassInstallUrl(request, requestOptions) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
47
|
+
const { passId, contactId } = request;
|
|
48
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
49
|
+
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);
|
|
50
|
+
const _response = yield core.fetcher({
|
|
51
|
+
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, `wallet/passes/${core.url.encodePathParam(passId)}/installUrl/${core.url.encodePathParam(contactId)}`),
|
|
52
|
+
method: "GET",
|
|
53
|
+
headers: _headers,
|
|
54
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
55
|
+
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,
|
|
56
|
+
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,
|
|
57
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
58
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
59
|
+
logging: this._options.logging,
|
|
60
|
+
});
|
|
61
|
+
if (_response.ok) {
|
|
62
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
63
|
+
}
|
|
64
|
+
if (_response.error.reason === "status-code") {
|
|
65
|
+
switch (_response.error.statusCode) {
|
|
66
|
+
case 400:
|
|
67
|
+
throw new Brevo.BadRequestError(_response.error.body, _response.rawResponse);
|
|
68
|
+
case 401:
|
|
69
|
+
throw new Brevo.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
70
|
+
case 403:
|
|
71
|
+
throw new Brevo.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
72
|
+
case 404:
|
|
73
|
+
throw new Brevo.NotFoundError(_response.error.body, _response.rawResponse);
|
|
74
|
+
case 422:
|
|
75
|
+
throw new Brevo.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
76
|
+
case 500:
|
|
77
|
+
throw new Brevo.InternalServerError(_response.error.body, _response.rawResponse);
|
|
78
|
+
default:
|
|
79
|
+
throw new errors.BrevoError({
|
|
80
|
+
statusCode: _response.error.statusCode,
|
|
81
|
+
body: _response.error.body,
|
|
82
|
+
rawResponse: _response.rawResponse,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/wallet/passes/{passId}/installUrl/{contactId}");
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* passId: "passId",
|
|
5
|
+
* contactId: 1000000
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface GetWalletPassInstallUrlRequest {
|
|
9
|
+
/** Pass ID. The unique identifier of the wallet pass for which to generate an installation URL. */
|
|
10
|
+
passId: string;
|
|
11
|
+
/** The Brevo contact ID the installation URL is generated for. */
|
|
12
|
+
contactId: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { GetWalletPassInstallUrlRequest } from "./GetWalletPassInstallUrlRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A consent group representing a category of contact opt-in/opt-out preferences.
|
|
3
|
+
*/
|
|
4
|
+
export interface ConsentGroup {
|
|
5
|
+
/** Unique identifier for the consent group */
|
|
6
|
+
id: number;
|
|
7
|
+
/** Display name of the consent group */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Optional description of the consent group */
|
|
10
|
+
description?: string | undefined;
|
|
11
|
+
/** Controls how contacts are added to the group. `manual` — contacts are added explicitly via the API. `automatic` — contacts are added automatically at signup. */
|
|
12
|
+
signupMode: ConsentGroup.SignupMode;
|
|
13
|
+
/** Number of contacts currently in this consent group */
|
|
14
|
+
contactsCount: number;
|
|
15
|
+
/** Whether this is a system-created default consent group */
|
|
16
|
+
isDefault: boolean;
|
|
17
|
+
/** UTC date-time when the consent group was created (YYYY-MM-DDTHH:mm:ss.SSSZ) */
|
|
18
|
+
createdAt: string;
|
|
19
|
+
/** UTC date-time when the consent group was last updated (YYYY-MM-DDTHH:mm:ss.SSSZ) */
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
}
|
|
22
|
+
export declare namespace ConsentGroup {
|
|
23
|
+
/** Controls how contacts are added to the group. `manual` — contacts are added explicitly via the API. `automatic` — contacts are added automatically at signup. */
|
|
24
|
+
const SignupMode: {
|
|
25
|
+
readonly Manual: "manual";
|
|
26
|
+
readonly Automatic: "automatic";
|
|
27
|
+
};
|
|
28
|
+
type SignupMode = (typeof SignupMode)[keyof typeof SignupMode];
|
|
29
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var ConsentGroup;
|
|
3
|
+
(function (ConsentGroup) {
|
|
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
|
+
ConsentGroup.SignupMode = {
|
|
6
|
+
Manual: "manual",
|
|
7
|
+
Automatic: "automatic",
|
|
8
|
+
};
|
|
9
|
+
})(ConsentGroup || (ConsentGroup = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A contact's membership status in a single consent group.
|
|
3
|
+
*/
|
|
4
|
+
export interface ConsentGroupItem {
|
|
5
|
+
/** ID of the consent group */
|
|
6
|
+
id: number;
|
|
7
|
+
/** The contact's subscription status within this consent group */
|
|
8
|
+
status: ConsentGroupItem.Status;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace ConsentGroupItem {
|
|
11
|
+
/** The contact's subscription status within this consent group */
|
|
12
|
+
const Status: {
|
|
13
|
+
readonly Subscribed: "subscribed";
|
|
14
|
+
readonly Unsubscribed: "unsubscribed";
|
|
15
|
+
};
|
|
16
|
+
type Status = (typeof Status)[keyof typeof Status];
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var ConsentGroupItem;
|
|
3
|
+
(function (ConsentGroupItem) {
|
|
4
|
+
/** The contact's subscription status within this consent group */
|
|
5
|
+
ConsentGroupItem.Status = {
|
|
6
|
+
Subscribed: "subscribed",
|
|
7
|
+
Unsubscribed: "unsubscribed",
|
|
8
|
+
};
|
|
9
|
+
})(ConsentGroupItem || (ConsentGroupItem = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as Brevo from "../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Paginated list of consent groups.
|
|
4
|
+
*/
|
|
5
|
+
export interface ConsentGroupsListResponse {
|
|
6
|
+
/** List of consent groups matching the filter */
|
|
7
|
+
consentGroups: Brevo.ConsentGroup[];
|
|
8
|
+
/** Total number of consent groups matching the filter */
|
|
9
|
+
total: number;
|
|
10
|
+
/** Maximum number of results returned */
|
|
11
|
+
limit: number;
|
|
12
|
+
/** Number of results skipped */
|
|
13
|
+
offset: number;
|
|
14
|
+
}
|
|
@@ -2,17 +2,17 @@ export interface GetCampaignStats {
|
|
|
2
2
|
/** Numbers of times your email has been opened automatically through Apple MPP. */
|
|
3
3
|
appleMppOpens: number | null;
|
|
4
4
|
/** Number of total clicks for the campaign */
|
|
5
|
-
clickers: number;
|
|
5
|
+
clickers: number | null;
|
|
6
6
|
/** Number of complaints (Spam reports) for the campaign */
|
|
7
|
-
complaints: number;
|
|
7
|
+
complaints: number | null;
|
|
8
8
|
/** Number of deferred emails for the campaign */
|
|
9
9
|
deferred?: number | undefined;
|
|
10
10
|
/** Number of delivered emails for the campaign */
|
|
11
|
-
delivered: number;
|
|
11
|
+
delivered: number | null;
|
|
12
12
|
/** Rate of recipients without any privacy protection option enabled in their email client, applied to all delivered emails */
|
|
13
13
|
estimatedViews?: number | undefined;
|
|
14
14
|
/** Number of hard bounces for the campaign */
|
|
15
|
-
hardBounces: number;
|
|
15
|
+
hardBounces: number | null;
|
|
16
16
|
/** List Id of email campaign (only in case of get email campaign(s)(not for global stats)) */
|
|
17
17
|
listId?: number | undefined;
|
|
18
18
|
/** Percentage of recipients who open the email out of your total number of recipients. Depending on your Campaign settings, they may include Apple MPP opens. */
|
|
@@ -20,19 +20,19 @@ export interface GetCampaignStats {
|
|
|
20
20
|
/** Total number of non-delivered campaigns for a particular campaign id. */
|
|
21
21
|
returnBounce?: number | undefined;
|
|
22
22
|
/** Number of sent emails for the campaign */
|
|
23
|
-
sent: number;
|
|
23
|
+
sent: number | null;
|
|
24
24
|
/** Number of softbounce for the campaign */
|
|
25
|
-
softBounces: number;
|
|
25
|
+
softBounces: number | null;
|
|
26
26
|
/** Recipients without any privacy protection option enabled in their email email client */
|
|
27
|
-
trackableViews: number;
|
|
27
|
+
trackableViews: number | null;
|
|
28
28
|
/** Rate of recipients without any privacy protection option enabled in their email client */
|
|
29
29
|
trackableViewsRate?: number | undefined;
|
|
30
30
|
/** Number of unique clicks for the campaign */
|
|
31
|
-
uniqueClicks: number;
|
|
31
|
+
uniqueClicks: number | null;
|
|
32
32
|
/** Number of unique openings for the campaign */
|
|
33
|
-
uniqueViews: number;
|
|
33
|
+
uniqueViews: number | null;
|
|
34
34
|
/** Number of unsubscription for the campaign */
|
|
35
|
-
unsubscriptions: number;
|
|
35
|
+
unsubscriptions: number | null;
|
|
36
36
|
/** Number of openings for the campaign */
|
|
37
|
-
viewed: number;
|
|
37
|
+
viewed: number | null;
|
|
38
38
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as Brevo from "../index.mjs";
|
|
1
2
|
export interface GetContactDetails {
|
|
2
3
|
/** Set of attributes of the contact */
|
|
3
4
|
attributes: GetContactDetails.Attributes;
|
|
@@ -17,6 +18,8 @@ export interface GetContactDetails {
|
|
|
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
|
}
|
|
21
24
|
export declare namespace GetContactDetails {
|
|
22
25
|
/**
|
|
@@ -9,6 +9,9 @@ export * from "./BatchEventsResponse.mjs";
|
|
|
9
9
|
export * from "./Cart.mjs";
|
|
10
10
|
export * from "./Company.mjs";
|
|
11
11
|
export * from "./Configuration.mjs";
|
|
12
|
+
export * from "./ConsentGroup.mjs";
|
|
13
|
+
export * from "./ConsentGroupItem.mjs";
|
|
14
|
+
export * from "./ConsentGroupsListResponse.mjs";
|
|
12
15
|
export * from "./ContactErrorModel.mjs";
|
|
13
16
|
export * from "./ConversationsMessage.mjs";
|
|
14
17
|
export * from "./ConversionSourceMetrics.mjs";
|
|
@@ -62,4 +65,5 @@ export * from "./UnauthorizedErrorBody.mjs";
|
|
|
62
65
|
export * from "./UpdateCampaignStatus.mjs";
|
|
63
66
|
export * from "./ValueResponse.mjs";
|
|
64
67
|
export * from "./VariablesItems.mjs";
|
|
68
|
+
export * from "./WalletPassInstallUrl.mjs";
|
|
65
69
|
export * from "./WhatsappCampStats.mjs";
|
|
@@ -9,6 +9,9 @@ export * from "./BatchEventsResponse.mjs";
|
|
|
9
9
|
export * from "./Cart.mjs";
|
|
10
10
|
export * from "./Company.mjs";
|
|
11
11
|
export * from "./Configuration.mjs";
|
|
12
|
+
export * from "./ConsentGroup.mjs";
|
|
13
|
+
export * from "./ConsentGroupItem.mjs";
|
|
14
|
+
export * from "./ConsentGroupsListResponse.mjs";
|
|
12
15
|
export * from "./ContactErrorModel.mjs";
|
|
13
16
|
export * from "./ConversationsMessage.mjs";
|
|
14
17
|
export * from "./ConversionSourceMetrics.mjs";
|
|
@@ -62,4 +65,5 @@ export * from "./UnauthorizedErrorBody.mjs";
|
|
|
62
65
|
export * from "./UpdateCampaignStatus.mjs";
|
|
63
66
|
export * from "./ValueResponse.mjs";
|
|
64
67
|
export * from "./VariablesItems.mjs";
|
|
68
|
+
export * from "./WalletPassInstallUrl.mjs";
|
|
65
69
|
export * from "./WhatsappCampStats.mjs";
|
|
@@ -9,6 +9,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { fromJson } from "../json.mjs";
|
|
11
11
|
import { getBinaryResponse } from "./BinaryResponse.mjs";
|
|
12
|
+
// Pins the upstream Response so undici's FinalizationRegistry can't GC it and cancel the body stream.
|
|
13
|
+
function retainResponse(target, response) {
|
|
14
|
+
Object.defineProperty(target, "__fern_response_ref", {
|
|
15
|
+
value: response,
|
|
16
|
+
enumerable: false,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: false,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
12
21
|
export function getResponseBody(response, responseType) {
|
|
13
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
23
|
switch (responseType) {
|
|
@@ -28,6 +37,7 @@ export function getResponseBody(response, responseType) {
|
|
|
28
37
|
},
|
|
29
38
|
};
|
|
30
39
|
}
|
|
40
|
+
retainResponse(response.body, response);
|
|
31
41
|
return response.body;
|
|
32
42
|
case "streaming":
|
|
33
43
|
if (response.body == null) {
|
|
@@ -39,6 +49,7 @@ export function getResponseBody(response, responseType) {
|
|
|
39
49
|
},
|
|
40
50
|
};
|
|
41
51
|
}
|
|
52
|
+
retainResponse(response.body, response);
|
|
42
53
|
return response.body;
|
|
43
54
|
case "text":
|
|
44
55
|
return yield response.text();
|
|
@@ -10,11 +10,19 @@ export function anySignal(...args) {
|
|
|
10
10
|
for (const signal of signals) {
|
|
11
11
|
if (signal.aborted) {
|
|
12
12
|
controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason);
|
|
13
|
-
|
|
13
|
+
return controller.signal;
|
|
14
14
|
}
|
|
15
15
|
signal.addEventListener("abort", () => controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason), {
|
|
16
16
|
signal: controller.signal,
|
|
17
17
|
});
|
|
18
|
+
// Re-check after adding listener: the signal may have aborted
|
|
19
|
+
// between the initial `signal.aborted` check and the `addEventListener`
|
|
20
|
+
// call above. If it did, the abort event was already dispatched and
|
|
21
|
+
// the listener will never fire — we must manually abort.
|
|
22
|
+
if (signal.aborted) {
|
|
23
|
+
controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason);
|
|
24
|
+
return controller.signal;
|
|
25
|
+
}
|
|
18
26
|
}
|
|
19
27
|
return controller.signal;
|
|
20
28
|
}
|
package/dist/esm/core/url/qs.mjs
CHANGED
|
@@ -16,7 +16,7 @@ function stringifyObject(obj, prefix = "", options) {
|
|
|
16
16
|
const parts = [];
|
|
17
17
|
for (const [key, value] of Object.entries(obj)) {
|
|
18
18
|
const fullKey = prefix ? `${prefix}[${key}]` : key;
|
|
19
|
-
if (value
|
|
19
|
+
if (value == null) {
|
|
20
20
|
continue;
|
|
21
21
|
}
|
|
22
22
|
if (Array.isArray(value)) {
|
|
@@ -36,7 +36,7 @@ function stringifyObject(obj, prefix = "", options) {
|
|
|
36
36
|
else {
|
|
37
37
|
for (let i = 0; i < value.length; i++) {
|
|
38
38
|
const item = value[i];
|
|
39
|
-
if (item
|
|
39
|
+
if (item == null) {
|
|
40
40
|
continue;
|
|
41
41
|
}
|
|
42
42
|
if (typeof item === "object" && !Array.isArray(item) && item !== null) {
|
|
@@ -7,7 +7,7 @@ export class BrevoError extends Error {
|
|
|
7
7
|
if (Error.captureStackTrace) {
|
|
8
8
|
Error.captureStackTrace(this, this.constructor);
|
|
9
9
|
}
|
|
10
|
-
this.name =
|
|
10
|
+
this.name = "BrevoError";
|
|
11
11
|
this.statusCode = statusCode;
|
|
12
12
|
this.body = body;
|
|
13
13
|
this.rawResponse = rawResponse;
|
|
@@ -15,6 +15,10 @@ export class BrevoError extends Error {
|
|
|
15
15
|
this.cause = cause;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
+
get requestId() {
|
|
19
|
+
var _a, _b, _c;
|
|
20
|
+
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;
|
|
21
|
+
}
|
|
18
22
|
}
|
|
19
23
|
function buildMessage({ message, statusCode, body, }) {
|
|
20
24
|
const lines = [];
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
2
|
+
import * as errors from "./index.mjs";
|
|
3
|
+
export class BrevoTimeoutError extends errors.BrevoError {
|
|
3
4
|
constructor(message, opts) {
|
|
4
|
-
super(
|
|
5
|
+
super({
|
|
6
|
+
message: message,
|
|
7
|
+
cause: opts === null || opts === void 0 ? void 0 : opts.cause,
|
|
8
|
+
});
|
|
5
9
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
6
10
|
if (Error.captureStackTrace) {
|
|
7
11
|
Error.captureStackTrace(this, this.constructor);
|
|
8
12
|
}
|
|
9
|
-
this.name =
|
|
10
|
-
if ((opts === null || opts === void 0 ? void 0 : opts.cause) != null) {
|
|
11
|
-
this.cause = opts.cause;
|
|
12
|
-
}
|
|
13
|
+
this.name = "BrevoTimeoutError";
|
|
13
14
|
}
|
|
14
15
|
}
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "6.0.
|
|
1
|
+
export declare const SDK_VERSION = "6.0.2";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "6.0.
|
|
1
|
+
export const SDK_VERSION = "6.0.2";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getbrevo/brevo",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -132,6 +132,17 @@
|
|
|
132
132
|
},
|
|
133
133
|
"default": "./dist/cjs/api/resources/contacts/exports.js"
|
|
134
134
|
},
|
|
135
|
+
"./consentGroups": {
|
|
136
|
+
"import": {
|
|
137
|
+
"types": "./dist/esm/api/resources/consentGroups/exports.d.mts",
|
|
138
|
+
"default": "./dist/esm/api/resources/consentGroups/exports.mjs"
|
|
139
|
+
},
|
|
140
|
+
"require": {
|
|
141
|
+
"types": "./dist/cjs/api/resources/consentGroups/exports.d.ts",
|
|
142
|
+
"default": "./dist/cjs/api/resources/consentGroups/exports.js"
|
|
143
|
+
},
|
|
144
|
+
"default": "./dist/cjs/api/resources/consentGroups/exports.js"
|
|
145
|
+
},
|
|
135
146
|
"./conversations": {
|
|
136
147
|
"import": {
|
|
137
148
|
"types": "./dist/esm/api/resources/conversations/exports.d.mts",
|
|
@@ -242,6 +253,17 @@
|
|
|
242
253
|
},
|
|
243
254
|
"default": "./dist/cjs/api/resources/tier/exports.js"
|
|
244
255
|
},
|
|
256
|
+
"./wallet": {
|
|
257
|
+
"import": {
|
|
258
|
+
"types": "./dist/esm/api/resources/wallet/exports.d.mts",
|
|
259
|
+
"default": "./dist/esm/api/resources/wallet/exports.mjs"
|
|
260
|
+
},
|
|
261
|
+
"require": {
|
|
262
|
+
"types": "./dist/cjs/api/resources/wallet/exports.d.ts",
|
|
263
|
+
"default": "./dist/cjs/api/resources/wallet/exports.js"
|
|
264
|
+
},
|
|
265
|
+
"default": "./dist/cjs/api/resources/wallet/exports.js"
|
|
266
|
+
},
|
|
245
267
|
"./emailCampaigns": {
|
|
246
268
|
"import": {
|
|
247
269
|
"types": "./dist/esm/api/resources/emailCampaigns/exports.d.mts",
|