@getbrevo/brevo 5.0.1 → 5.0.4
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.js +2 -2
- package/dist/cjs/Client.d.ts +12 -0
- package/dist/cjs/Client.js +67 -0
- package/dist/cjs/api/resources/balance/client/Client.js +15 -6
- package/dist/cjs/api/resources/balance/client/requests/GetContactBalancesRequest.d.ts +2 -0
- package/dist/cjs/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.d.ts +2 -0
- package/dist/cjs/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.d.ts +5 -1
- package/dist/cjs/api/resources/balance/client/requests/GetSubscriptionBalancesRequest.d.ts +2 -0
- package/dist/cjs/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.d.ts +10 -1
- package/dist/cjs/api/resources/balance/client/requests/UpdateBalanceDefinitionRequest.d.ts +10 -1
- package/dist/cjs/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.d.ts +8 -0
- package/dist/cjs/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.js +11 -0
- package/dist/cjs/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.d.ts +5 -0
- package/dist/cjs/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.js +8 -0
- package/dist/cjs/api/resources/balance/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/balance/types/index.js +2 -0
- package/dist/cjs/api/resources/contacts/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/contacts/client/Client.js +5 -2
- package/dist/cjs/api/resources/contacts/client/requests/CreateContactRequest.d.ts +1 -1
- package/dist/cjs/api/resources/contacts/client/requests/UpdateContactRequest.d.ts +1 -1
- package/dist/cjs/api/resources/ecommerce/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/ecommerce/client/Client.js +8 -2
- package/dist/cjs/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.d.ts +5 -1
- package/dist/cjs/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.d.ts +5 -1
- package/dist/cjs/api/resources/event/client/Client.d.ts +20 -1
- package/dist/cjs/api/resources/event/client/Client.js +69 -1
- package/dist/cjs/api/resources/event/client/requests/CreateEventRequest.d.ts +2 -2
- package/dist/cjs/api/resources/event/client/requests/GetEventsRequest.d.ts +20 -0
- package/dist/cjs/api/resources/event/client/requests/GetEventsRequest.js +3 -0
- package/dist/cjs/api/resources/event/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/event/types/CreateBatchEventsRequestItem.d.ts +2 -2
- package/dist/cjs/api/resources/process/types/GetProcessResponse.d.ts +3 -2
- package/dist/cjs/api/resources/process/types/GetProcessResponse.js +1 -0
- package/dist/cjs/api/resources/process/types/GetProcessesResponse.d.ts +3 -2
- package/dist/cjs/api/resources/process/types/GetProcessesResponse.js +1 -0
- package/dist/cjs/api/resources/program/client/Client.js +2 -1
- package/dist/cjs/api/resources/program/client/requests/GetParameterSubscriptionInfoRequest.d.ts +2 -0
- package/dist/cjs/api/resources/tier/client/requests/CreateTierGroupRequest.d.ts +11 -0
- package/dist/cjs/api/resources/tier/client/requests/UpdateTierGroupRequest.d.ts +11 -0
- package/dist/cjs/api/types/BatchAcceptedResponse.d.ts +9 -0
- package/dist/cjs/api/types/BatchAcceptedResponse.js +3 -0
- package/dist/cjs/api/types/GetEventsList.d.ts +32 -0
- package/dist/cjs/api/types/GetEventsList.js +3 -0
- package/dist/cjs/api/types/GetProductDetails.d.ts +4 -0
- package/dist/cjs/api/types/InternalServerErrorBody.d.ts +48 -0
- package/dist/cjs/api/types/InternalServerErrorBody.js +46 -0
- package/dist/cjs/api/types/index.d.ts +3 -0
- package/dist/cjs/api/types/index.js +3 -0
- package/dist/cjs/core/auth/BasicAuth.d.ts +2 -2
- package/dist/cjs/core/auth/BasicAuth.js +7 -1
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +1 -1
- package/dist/cjs/core/fetcher/Fetcher.d.ts +2 -0
- package/dist/cjs/core/fetcher/Fetcher.js +4 -0
- package/dist/cjs/core/fetcher/index.d.ts +2 -0
- package/dist/cjs/core/fetcher/index.js +3 -1
- package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
- package/dist/cjs/core/fetcher/makePassthroughRequest.js +135 -0
- package/dist/cjs/core/file/file.js +3 -2
- package/dist/cjs/errors/BrevoError.d.ts +3 -1
- package/dist/cjs/errors/BrevoError.js +4 -1
- package/dist/cjs/errors/BrevoTimeoutError.d.ts +4 -1
- package/dist/cjs/errors/BrevoTimeoutError.js +4 -1
- package/dist/cjs/errors/handleNonStatusCodeError.js +4 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +12 -0
- package/dist/esm/Client.mjs +34 -0
- package/dist/esm/api/resources/balance/client/Client.mjs +15 -6
- package/dist/esm/api/resources/balance/client/requests/GetContactBalancesRequest.d.mts +2 -0
- package/dist/esm/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.d.mts +2 -0
- package/dist/esm/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.d.mts +5 -1
- package/dist/esm/api/resources/balance/client/requests/GetSubscriptionBalancesRequest.d.mts +2 -0
- package/dist/esm/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.d.mts +10 -1
- package/dist/esm/api/resources/balance/client/requests/UpdateBalanceDefinitionRequest.d.mts +10 -1
- package/dist/esm/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.d.mts +8 -0
- package/dist/esm/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.mjs +8 -0
- package/dist/esm/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.d.mts +5 -0
- package/dist/esm/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.mjs +5 -0
- package/dist/esm/api/resources/balance/types/index.d.mts +2 -0
- package/dist/esm/api/resources/balance/types/index.mjs +2 -0
- package/dist/esm/api/resources/contacts/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/contacts/client/Client.mjs +5 -2
- package/dist/esm/api/resources/contacts/client/requests/CreateContactRequest.d.mts +1 -1
- package/dist/esm/api/resources/contacts/client/requests/UpdateContactRequest.d.mts +1 -1
- package/dist/esm/api/resources/ecommerce/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/ecommerce/client/Client.mjs +8 -2
- package/dist/esm/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.d.mts +5 -1
- package/dist/esm/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.d.mts +5 -1
- package/dist/esm/api/resources/event/client/Client.d.mts +20 -1
- package/dist/esm/api/resources/event/client/Client.mjs +69 -1
- package/dist/esm/api/resources/event/client/requests/CreateEventRequest.d.mts +2 -2
- package/dist/esm/api/resources/event/client/requests/GetEventsRequest.d.mts +20 -0
- package/dist/esm/api/resources/event/client/requests/GetEventsRequest.mjs +2 -0
- package/dist/esm/api/resources/event/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/event/types/CreateBatchEventsRequestItem.d.mts +2 -2
- package/dist/esm/api/resources/process/types/GetProcessResponse.d.mts +3 -2
- package/dist/esm/api/resources/process/types/GetProcessResponse.mjs +1 -0
- package/dist/esm/api/resources/process/types/GetProcessesResponse.d.mts +3 -2
- package/dist/esm/api/resources/process/types/GetProcessesResponse.mjs +1 -0
- package/dist/esm/api/resources/program/client/Client.mjs +2 -1
- package/dist/esm/api/resources/program/client/requests/GetParameterSubscriptionInfoRequest.d.mts +2 -0
- package/dist/esm/api/resources/tier/client/requests/CreateTierGroupRequest.d.mts +11 -0
- package/dist/esm/api/resources/tier/client/requests/UpdateTierGroupRequest.d.mts +11 -0
- package/dist/esm/api/types/BatchAcceptedResponse.d.mts +9 -0
- package/dist/esm/api/types/BatchAcceptedResponse.mjs +2 -0
- package/dist/esm/api/types/GetEventsList.d.mts +32 -0
- package/dist/esm/api/types/GetEventsList.mjs +2 -0
- package/dist/esm/api/types/GetProductDetails.d.mts +4 -0
- package/dist/esm/api/types/InternalServerErrorBody.d.mts +48 -0
- package/dist/esm/api/types/InternalServerErrorBody.mjs +43 -0
- package/dist/esm/api/types/index.d.mts +3 -0
- package/dist/esm/api/types/index.mjs +3 -0
- package/dist/esm/core/auth/BasicAuth.d.mts +2 -2
- package/dist/esm/core/auth/BasicAuth.mjs +7 -1
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +1 -1
- package/dist/esm/core/fetcher/Fetcher.d.mts +2 -0
- package/dist/esm/core/fetcher/Fetcher.mjs +4 -0
- package/dist/esm/core/fetcher/index.d.mts +2 -0
- package/dist/esm/core/fetcher/index.mjs +1 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.mjs +132 -0
- package/dist/esm/core/file/file.mjs +3 -2
- package/dist/esm/errors/BrevoError.d.mts +3 -1
- package/dist/esm/errors/BrevoError.mjs +4 -1
- package/dist/esm/errors/BrevoTimeoutError.d.mts +4 -1
- package/dist/esm/errors/BrevoTimeoutError.mjs +4 -1
- package/dist/esm/errors/handleNonStatusCodeError.mjs +4 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +7 -7
- package/reference.md +72 -5
|
@@ -21,10 +21,10 @@ export interface CreateEventRequest {
|
|
|
21
21
|
}
|
|
22
22
|
export declare namespace CreateEventRequest {
|
|
23
23
|
namespace ContactProperties {
|
|
24
|
-
type Value = string | number;
|
|
24
|
+
type Value = string | number | boolean;
|
|
25
25
|
}
|
|
26
26
|
namespace EventProperties {
|
|
27
|
-
type Value = string | number | Record<string, unknown> | unknown[];
|
|
27
|
+
type Value = string | number | boolean | Record<string, unknown> | unknown[];
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Identifies the contact associated with the event. At least one identifier is required.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {}
|
|
4
|
+
*/
|
|
5
|
+
export interface GetEventsRequest {
|
|
6
|
+
/** Filter by contact ID (repeatable) */
|
|
7
|
+
contact_id?: number | number[];
|
|
8
|
+
/** Filter by event name (repeatable) */
|
|
9
|
+
event_name?: string | string[];
|
|
10
|
+
/** Filter by object type (repeatable) */
|
|
11
|
+
object_type?: string | string[];
|
|
12
|
+
/** Mandatory if endDate is used. Start of date range (YYYY-MM-DD or RFC3339). Defaults to 6 months ago when omitted alongside endDate. Must be ≤ endDate. */
|
|
13
|
+
startDate?: string;
|
|
14
|
+
/** Mandatory if startDate is used. End of date range (YYYY-MM-DD or RFC3339). Must be ≥ startDate. */
|
|
15
|
+
endDate?: string;
|
|
16
|
+
/** Max events to return. Default 100, min 1, max 10000. */
|
|
17
|
+
limit?: number;
|
|
18
|
+
/** Events to skip for pagination. Default 0, min 0. */
|
|
19
|
+
offset?: number;
|
|
20
|
+
}
|
|
@@ -14,10 +14,10 @@ export interface CreateBatchEventsRequestItem {
|
|
|
14
14
|
}
|
|
15
15
|
export declare namespace CreateBatchEventsRequestItem {
|
|
16
16
|
namespace ContactProperties {
|
|
17
|
-
type Value = string | number;
|
|
17
|
+
type Value = string | number | boolean;
|
|
18
18
|
}
|
|
19
19
|
namespace EventProperties {
|
|
20
|
-
type Value = string | number | Record<string, unknown> | unknown[];
|
|
20
|
+
type Value = string | number | boolean | Record<string, unknown> | unknown[];
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Identifies the contact associated with the event. At least one identifier is required.
|
|
@@ -31,6 +31,7 @@ export declare namespace GetProcessResponse {
|
|
|
31
31
|
/** Current status of the process */
|
|
32
32
|
const Status: {
|
|
33
33
|
readonly Queued: "queued";
|
|
34
|
+
readonly InProcess: "in_process";
|
|
34
35
|
readonly Processing: "processing";
|
|
35
36
|
readonly Completed: "completed";
|
|
36
37
|
readonly Failed: "failed";
|
|
@@ -57,8 +58,8 @@ export declare namespace GetProcessResponse {
|
|
|
57
58
|
duplicate_contact_id?: (number | null) | undefined;
|
|
58
59
|
/** Number of duplicate external IDs */
|
|
59
60
|
duplicate_ext_id?: (number | null) | undefined;
|
|
60
|
-
/**
|
|
61
|
-
duplicate_email_id?: (
|
|
61
|
+
/** URL to CSV file containing duplicate email IDs, or null if none */
|
|
62
|
+
duplicate_email_id?: (string | null) | undefined;
|
|
62
63
|
/** Number of duplicate phone numbers */
|
|
63
64
|
duplicate_phone_id?: (number | null) | undefined;
|
|
64
65
|
/** Number of duplicate WhatsApp numbers */
|
|
@@ -40,6 +40,7 @@ export declare namespace GetProcessesResponse {
|
|
|
40
40
|
/** Current status of the process */
|
|
41
41
|
const Status: {
|
|
42
42
|
readonly Queued: "queued";
|
|
43
|
+
readonly InProcess: "in_process";
|
|
43
44
|
readonly Processing: "processing";
|
|
44
45
|
readonly Completed: "completed";
|
|
45
46
|
readonly Failed: "failed";
|
|
@@ -66,8 +67,8 @@ export declare namespace GetProcessesResponse {
|
|
|
66
67
|
duplicate_contact_id?: (number | null) | undefined;
|
|
67
68
|
/** Number of duplicate external IDs */
|
|
68
69
|
duplicate_ext_id?: (number | null) | undefined;
|
|
69
|
-
/**
|
|
70
|
-
duplicate_email_id?: (
|
|
70
|
+
/** URL to CSV file containing duplicate email IDs, or null if none */
|
|
71
|
+
duplicate_email_id?: (string | null) | undefined;
|
|
71
72
|
/** Number of duplicate phone numbers */
|
|
72
73
|
duplicate_phone_id?: (number | null) | undefined;
|
|
73
74
|
/** Number of duplicate WhatsApp numbers */
|
|
@@ -489,11 +489,12 @@ class ProgramClient {
|
|
|
489
489
|
__getParameterSubscriptionInfo(request, requestOptions) {
|
|
490
490
|
return __awaiter(this, void 0, void 0, function* () {
|
|
491
491
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
492
|
-
const { pid, contactId, params, loyaltySubscriptionId } = request;
|
|
492
|
+
const { pid, contactId, params, loyaltySubscriptionId, includeInternal } = request;
|
|
493
493
|
const _queryParams = {
|
|
494
494
|
contactId,
|
|
495
495
|
params,
|
|
496
496
|
loyaltySubscriptionId,
|
|
497
|
+
includeInternal,
|
|
497
498
|
};
|
|
498
499
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
499
500
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
@@ -12,6 +12,8 @@ export interface CreateTierGroupRequest {
|
|
|
12
12
|
downgradeStrategy?: CreateTierGroupRequest.DowngradeStrategy;
|
|
13
13
|
/** Name of the tier group */
|
|
14
14
|
name: string;
|
|
15
|
+
/** Additional metadata for the tier group. */
|
|
16
|
+
meta?: CreateTierGroupRequest.Meta;
|
|
15
17
|
/** Order of the tiers in the group in ascending order */
|
|
16
18
|
tierOrder?: string[];
|
|
17
19
|
/** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */
|
|
@@ -25,6 +27,15 @@ export declare namespace CreateTierGroupRequest {
|
|
|
25
27
|
readonly TierAnniversary: "tier_anniversary";
|
|
26
28
|
};
|
|
27
29
|
type DowngradeStrategy = (typeof DowngradeStrategy)[keyof typeof DowngradeStrategy];
|
|
30
|
+
/**
|
|
31
|
+
* Additional metadata for the tier group.
|
|
32
|
+
*/
|
|
33
|
+
interface Meta {
|
|
34
|
+
/** Indicates whether the tier group is internal. */
|
|
35
|
+
isInternal?: boolean | undefined;
|
|
36
|
+
/** Accepts any additional properties */
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
}
|
|
28
39
|
/** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */
|
|
29
40
|
const UpgradeStrategy: {
|
|
30
41
|
readonly RealTime: "real_time";
|
|
@@ -18,6 +18,8 @@ export interface UpdateTierGroupRequest {
|
|
|
18
18
|
downgradeStrategy: UpdateTierGroupRequest.DowngradeStrategy;
|
|
19
19
|
/** Name of the tier group */
|
|
20
20
|
name: string;
|
|
21
|
+
/** Additional metadata for the tier group. */
|
|
22
|
+
meta?: UpdateTierGroupRequest.Meta;
|
|
21
23
|
/** Order of the tiers in the group in ascending order */
|
|
22
24
|
tierOrder: string[];
|
|
23
25
|
/** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */
|
|
@@ -31,6 +33,15 @@ export declare namespace UpdateTierGroupRequest {
|
|
|
31
33
|
readonly TierAnniversary: "tier_anniversary";
|
|
32
34
|
};
|
|
33
35
|
type DowngradeStrategy = (typeof DowngradeStrategy)[keyof typeof DowngradeStrategy];
|
|
36
|
+
/**
|
|
37
|
+
* Additional metadata for the tier group.
|
|
38
|
+
*/
|
|
39
|
+
interface Meta {
|
|
40
|
+
/** Indicates whether the tier group is internal. */
|
|
41
|
+
isInternal?: boolean | undefined;
|
|
42
|
+
/** Accepts any additional properties */
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
}
|
|
34
45
|
/** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */
|
|
35
46
|
const UpgradeStrategy: {
|
|
36
47
|
readonly RealTime: "real_time";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response returned when all events in the batch are accepted for async processing
|
|
3
|
+
*/
|
|
4
|
+
export interface BatchAcceptedResponse {
|
|
5
|
+
/** Confirmation message indicating the batch was accepted */
|
|
6
|
+
message: string;
|
|
7
|
+
/** Number of events queued for processing */
|
|
8
|
+
count: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response containing a list of events and the total count for pagination
|
|
3
|
+
*/
|
|
4
|
+
export interface GetEventsList {
|
|
5
|
+
/** List of matching events ordered by event_date descending */
|
|
6
|
+
events?: GetEventsList.Events.Item[] | undefined;
|
|
7
|
+
/** Total count of events matching the filters (use for pagination) */
|
|
8
|
+
count: number;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace GetEventsList {
|
|
11
|
+
type Events = Events.Item[];
|
|
12
|
+
namespace Events {
|
|
13
|
+
interface Item {
|
|
14
|
+
/** Contact ID associated with the event */
|
|
15
|
+
contact_id?: number | undefined;
|
|
16
|
+
/** Date and time of the event */
|
|
17
|
+
event_date?: string | undefined;
|
|
18
|
+
/** Name of the event */
|
|
19
|
+
event_name?: string | undefined;
|
|
20
|
+
/** Filter ID of the event */
|
|
21
|
+
event_filter_id?: string | undefined;
|
|
22
|
+
/** Source of the event */
|
|
23
|
+
source?: string | undefined;
|
|
24
|
+
/** Object type associated with the event */
|
|
25
|
+
object_type?: string | undefined;
|
|
26
|
+
/** Event-level custom properties */
|
|
27
|
+
event_properties?: Record<string, unknown> | undefined;
|
|
28
|
+
/** Contact-level properties at time of event */
|
|
29
|
+
contact_properties?: Record<string, unknown> | undefined;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export interface GetProductDetails {
|
|
2
|
+
/** Brand of the product */
|
|
3
|
+
brand?: string | undefined;
|
|
2
4
|
/** Category ID-s of the product */
|
|
3
5
|
categories?: string[] | undefined;
|
|
4
6
|
/** Creation UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) */
|
|
5
7
|
createdAt: string;
|
|
8
|
+
/** Description of the product */
|
|
9
|
+
description?: string | undefined;
|
|
6
10
|
/** Product ID for which you requested the details */
|
|
7
11
|
id: string;
|
|
8
12
|
/** Absolute URL to the cover image of the product */
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface InternalServerErrorBody {
|
|
2
|
+
/** Error code displayed in case of a failure */
|
|
3
|
+
code: InternalServerErrorBody.Code;
|
|
4
|
+
/** Readable message associated to the failure */
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace InternalServerErrorBody {
|
|
8
|
+
/** Error code displayed in case of a failure */
|
|
9
|
+
const Code: {
|
|
10
|
+
readonly InvalidParameter: "invalid_parameter";
|
|
11
|
+
readonly MissingParameter: "missing_parameter";
|
|
12
|
+
readonly OutOfRange: "out_of_range";
|
|
13
|
+
readonly CampaignProcessing: "campaign_processing";
|
|
14
|
+
readonly CampaignSent: "campaign_sent";
|
|
15
|
+
readonly DocumentNotFound: "document_not_found";
|
|
16
|
+
readonly NotEnoughCredits: "not_enough_credits";
|
|
17
|
+
readonly PermissionDenied: "permission_denied";
|
|
18
|
+
readonly DuplicateParameter: "duplicate_parameter";
|
|
19
|
+
readonly DuplicateRequest: "duplicate_request";
|
|
20
|
+
readonly MethodNotAllowed: "method_not_allowed";
|
|
21
|
+
readonly Unauthorized: "unauthorized";
|
|
22
|
+
readonly AccountUnderValidation: "account_under_validation";
|
|
23
|
+
readonly NotAcceptable: "not_acceptable";
|
|
24
|
+
readonly BadRequest: "bad_request";
|
|
25
|
+
readonly UnprocessableEntity: "unprocessable_entity";
|
|
26
|
+
readonly DomainDoesNotExist: "Domain does not exist";
|
|
27
|
+
readonly ContactEmailNotFound: "Contact email not found";
|
|
28
|
+
readonly AttributeNotFound: "Attribute not found";
|
|
29
|
+
readonly CategoryIdNotFound: "Category id not found";
|
|
30
|
+
readonly InvalidParametersPassed: "Invalid parameters passed";
|
|
31
|
+
readonly RecordSForIdentifierNotFound: "Record(s) for identifier not found";
|
|
32
|
+
readonly ReturnedWhenQueryParamsAreInvalid: "Returned when query params are invalid";
|
|
33
|
+
readonly ReturnedWhenInvalidDataPosted: "Returned when invalid data posted";
|
|
34
|
+
readonly FeedNotFound: "Feed not found";
|
|
35
|
+
readonly CampaignIdNotFound: "Campaign ID not found";
|
|
36
|
+
readonly ApiKeyNotFound: "api-key not found";
|
|
37
|
+
readonly DmarcPolicyRequiresDomainAuthentication: "DMARC policy requires domain authentication";
|
|
38
|
+
readonly DnsRecordsNotProperlyConfigured: "DNS records not properly configured";
|
|
39
|
+
readonly InvalidOtpCodeProvided: "Invalid OTP code provided";
|
|
40
|
+
readonly OtpCodeHasExpired: "OTP code has expired";
|
|
41
|
+
readonly DomainAlreadyExistsInYourAccount: "Domain already exists in your account";
|
|
42
|
+
readonly TheSumOfAllIpWeightsMustEqual100: "The sum of all IP weights must equal 100";
|
|
43
|
+
readonly AuthenticationFailed: "Authentication failed";
|
|
44
|
+
readonly InsufficientCredits: "Insufficient credits";
|
|
45
|
+
readonly RequestAlreadyProcessed: "Request already processed";
|
|
46
|
+
};
|
|
47
|
+
type Code = (typeof Code)[keyof typeof Code];
|
|
48
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.InternalServerErrorBody = void 0;
|
|
5
|
+
var InternalServerErrorBody;
|
|
6
|
+
(function (InternalServerErrorBody) {
|
|
7
|
+
/** Error code displayed in case of a failure */
|
|
8
|
+
InternalServerErrorBody.Code = {
|
|
9
|
+
InvalidParameter: "invalid_parameter",
|
|
10
|
+
MissingParameter: "missing_parameter",
|
|
11
|
+
OutOfRange: "out_of_range",
|
|
12
|
+
CampaignProcessing: "campaign_processing",
|
|
13
|
+
CampaignSent: "campaign_sent",
|
|
14
|
+
DocumentNotFound: "document_not_found",
|
|
15
|
+
NotEnoughCredits: "not_enough_credits",
|
|
16
|
+
PermissionDenied: "permission_denied",
|
|
17
|
+
DuplicateParameter: "duplicate_parameter",
|
|
18
|
+
DuplicateRequest: "duplicate_request",
|
|
19
|
+
MethodNotAllowed: "method_not_allowed",
|
|
20
|
+
Unauthorized: "unauthorized",
|
|
21
|
+
AccountUnderValidation: "account_under_validation",
|
|
22
|
+
NotAcceptable: "not_acceptable",
|
|
23
|
+
BadRequest: "bad_request",
|
|
24
|
+
UnprocessableEntity: "unprocessable_entity",
|
|
25
|
+
DomainDoesNotExist: "Domain does not exist",
|
|
26
|
+
ContactEmailNotFound: "Contact email not found",
|
|
27
|
+
AttributeNotFound: "Attribute not found",
|
|
28
|
+
CategoryIdNotFound: "Category id not found",
|
|
29
|
+
InvalidParametersPassed: "Invalid parameters passed",
|
|
30
|
+
RecordSForIdentifierNotFound: "Record(s) for identifier not found",
|
|
31
|
+
ReturnedWhenQueryParamsAreInvalid: "Returned when query params are invalid",
|
|
32
|
+
ReturnedWhenInvalidDataPosted: "Returned when invalid data posted",
|
|
33
|
+
FeedNotFound: "Feed not found",
|
|
34
|
+
CampaignIdNotFound: "Campaign ID not found",
|
|
35
|
+
ApiKeyNotFound: "api-key not found",
|
|
36
|
+
DmarcPolicyRequiresDomainAuthentication: "DMARC policy requires domain authentication",
|
|
37
|
+
DnsRecordsNotProperlyConfigured: "DNS records not properly configured",
|
|
38
|
+
InvalidOtpCodeProvided: "Invalid OTP code provided",
|
|
39
|
+
OtpCodeHasExpired: "OTP code has expired",
|
|
40
|
+
DomainAlreadyExistsInYourAccount: "Domain already exists in your account",
|
|
41
|
+
TheSumOfAllIpWeightsMustEqual100: "The sum of all IP weights must equal 100",
|
|
42
|
+
AuthenticationFailed: "Authentication failed",
|
|
43
|
+
InsufficientCredits: "Insufficient credits",
|
|
44
|
+
RequestAlreadyProcessed: "Request already processed",
|
|
45
|
+
};
|
|
46
|
+
})(InternalServerErrorBody || (exports.InternalServerErrorBody = InternalServerErrorBody = {}));
|
|
@@ -4,6 +4,7 @@ export * from "./AbTestVersionStats.js";
|
|
|
4
4
|
export * from "./BadRequestErrorBody.js";
|
|
5
5
|
export * from "./BalanceDefinition.js";
|
|
6
6
|
export * from "./BalanceLimit.js";
|
|
7
|
+
export * from "./BatchAcceptedResponse.js";
|
|
7
8
|
export * from "./BatchEventsResponse.js";
|
|
8
9
|
export * from "./Cart.js";
|
|
9
10
|
export * from "./Company.js";
|
|
@@ -23,6 +24,7 @@ export * from "./GetContactDetails.js";
|
|
|
23
24
|
export * from "./GetContacts.js";
|
|
24
25
|
export * from "./GetCouponCollection.js";
|
|
25
26
|
export * from "./GetDeviceBrowserStats.js";
|
|
27
|
+
export * from "./GetEventsList.js";
|
|
26
28
|
export * from "./GetExtendedCampaignOverview.js";
|
|
27
29
|
export * from "./GetExtendedCampaignStats.js";
|
|
28
30
|
export * from "./GetFolder.js";
|
|
@@ -33,6 +35,7 @@ export * from "./GetSmsCampaignStats.js";
|
|
|
33
35
|
export * from "./GetSmtpTemplateOverview.js";
|
|
34
36
|
export * from "./GetSsoToken.js";
|
|
35
37
|
export * from "./GetWebhook.js";
|
|
38
|
+
export * from "./InternalServerErrorBody.js";
|
|
36
39
|
export * from "./Inviteuser.js";
|
|
37
40
|
export * from "./LoyaltyProgram.js";
|
|
38
41
|
export * from "./NodeResponse.js";
|
|
@@ -20,6 +20,7 @@ __exportStar(require("./AbTestVersionStats.js"), exports);
|
|
|
20
20
|
__exportStar(require("./BadRequestErrorBody.js"), exports);
|
|
21
21
|
__exportStar(require("./BalanceDefinition.js"), exports);
|
|
22
22
|
__exportStar(require("./BalanceLimit.js"), exports);
|
|
23
|
+
__exportStar(require("./BatchAcceptedResponse.js"), exports);
|
|
23
24
|
__exportStar(require("./BatchEventsResponse.js"), exports);
|
|
24
25
|
__exportStar(require("./Cart.js"), exports);
|
|
25
26
|
__exportStar(require("./Company.js"), exports);
|
|
@@ -39,6 +40,7 @@ __exportStar(require("./GetContactDetails.js"), exports);
|
|
|
39
40
|
__exportStar(require("./GetContacts.js"), exports);
|
|
40
41
|
__exportStar(require("./GetCouponCollection.js"), exports);
|
|
41
42
|
__exportStar(require("./GetDeviceBrowserStats.js"), exports);
|
|
43
|
+
__exportStar(require("./GetEventsList.js"), exports);
|
|
42
44
|
__exportStar(require("./GetExtendedCampaignOverview.js"), exports);
|
|
43
45
|
__exportStar(require("./GetExtendedCampaignStats.js"), exports);
|
|
44
46
|
__exportStar(require("./GetFolder.js"), exports);
|
|
@@ -49,6 +51,7 @@ __exportStar(require("./GetSmsCampaignStats.js"), exports);
|
|
|
49
51
|
__exportStar(require("./GetSmtpTemplateOverview.js"), exports);
|
|
50
52
|
__exportStar(require("./GetSsoToken.js"), exports);
|
|
51
53
|
__exportStar(require("./GetWebhook.js"), exports);
|
|
54
|
+
__exportStar(require("./InternalServerErrorBody.js"), exports);
|
|
52
55
|
__exportStar(require("./Inviteuser.js"), exports);
|
|
53
56
|
__exportStar(require("./LoyaltyProgram.js"), exports);
|
|
54
57
|
__exportStar(require("./NodeResponse.js"), exports);
|
|
@@ -5,10 +5,16 @@ const base64_js_1 = require("../base64.js");
|
|
|
5
5
|
const BASIC_AUTH_HEADER_PREFIX = /^Basic /i;
|
|
6
6
|
exports.BasicAuth = {
|
|
7
7
|
toAuthorizationHeader: (basicAuth) => {
|
|
8
|
+
var _a, _b;
|
|
8
9
|
if (basicAuth == null) {
|
|
9
10
|
return undefined;
|
|
10
11
|
}
|
|
11
|
-
const
|
|
12
|
+
const username = (_a = basicAuth.username) !== null && _a !== void 0 ? _a : "";
|
|
13
|
+
const password = (_b = basicAuth.password) !== null && _b !== void 0 ? _b : "";
|
|
14
|
+
if (username === "" && password === "") {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
const token = (0, base64_js_1.base64Encode)(`${username}:${password}`);
|
|
12
18
|
return `Basic ${token}`;
|
|
13
19
|
},
|
|
14
20
|
fromAuthorizationHeader: (header) => {
|
|
@@ -14,6 +14,6 @@ export type BinaryResponse = {
|
|
|
14
14
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes)
|
|
15
15
|
* Some versions of the Fetch API may not support this method.
|
|
16
16
|
*/
|
|
17
|
-
bytes?():
|
|
17
|
+
bytes?(): Promise<Uint8Array>;
|
|
18
18
|
};
|
|
19
19
|
export declare function getBinaryResponse(response: Response): BinaryResponse;
|
|
@@ -38,10 +38,12 @@ export declare namespace Fetcher {
|
|
|
38
38
|
}
|
|
39
39
|
interface TimeoutError {
|
|
40
40
|
reason: "timeout";
|
|
41
|
+
cause?: unknown;
|
|
41
42
|
}
|
|
42
43
|
interface UnknownError {
|
|
43
44
|
reason: "unknown";
|
|
44
45
|
errorMessage: string;
|
|
46
|
+
cause?: unknown;
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
export declare function fetcherImpl<R = unknown>(args: Fetcher.Args): Promise<APIResponse<R, Fetcher.Error>>;
|
|
@@ -261,6 +261,7 @@ function fetcherImpl(args) {
|
|
|
261
261
|
error: {
|
|
262
262
|
reason: "unknown",
|
|
263
263
|
errorMessage: "The user aborted a request",
|
|
264
|
+
cause: error,
|
|
264
265
|
},
|
|
265
266
|
rawResponse: RawResponse_js_1.abortRawResponse,
|
|
266
267
|
};
|
|
@@ -278,6 +279,7 @@ function fetcherImpl(args) {
|
|
|
278
279
|
ok: false,
|
|
279
280
|
error: {
|
|
280
281
|
reason: "timeout",
|
|
282
|
+
cause: error,
|
|
281
283
|
},
|
|
282
284
|
rawResponse: RawResponse_js_1.abortRawResponse,
|
|
283
285
|
};
|
|
@@ -296,6 +298,7 @@ function fetcherImpl(args) {
|
|
|
296
298
|
error: {
|
|
297
299
|
reason: "unknown",
|
|
298
300
|
errorMessage: error.message,
|
|
301
|
+
cause: error,
|
|
299
302
|
},
|
|
300
303
|
rawResponse: RawResponse_js_1.unknownRawResponse,
|
|
301
304
|
};
|
|
@@ -313,6 +316,7 @@ function fetcherImpl(args) {
|
|
|
313
316
|
error: {
|
|
314
317
|
reason: "unknown",
|
|
315
318
|
errorMessage: (0, json_js_1.toJson)(error),
|
|
319
|
+
cause: error,
|
|
316
320
|
},
|
|
317
321
|
rawResponse: RawResponse_js_1.unknownRawResponse,
|
|
318
322
|
};
|
|
@@ -6,6 +6,8 @@ export type { Fetcher, FetchFunction } from "./Fetcher.js";
|
|
|
6
6
|
export { fetcher } from "./Fetcher.js";
|
|
7
7
|
export { getHeader } from "./getHeader.js";
|
|
8
8
|
export { HttpResponsePromise } from "./HttpResponsePromise.js";
|
|
9
|
+
export type { PassthroughRequest } from "./makePassthroughRequest.js";
|
|
10
|
+
export { makePassthroughRequest } from "./makePassthroughRequest.js";
|
|
9
11
|
export type { RawResponse, WithRawResponse } from "./RawResponse.js";
|
|
10
12
|
export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.js";
|
|
11
13
|
export { Supplier } from "./Supplier.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Supplier = exports.unknownRawResponse = exports.toRawResponse = exports.abortRawResponse = exports.HttpResponsePromise = exports.getHeader = exports.fetcher = exports.EndpointSupplier = void 0;
|
|
3
|
+
exports.Supplier = exports.unknownRawResponse = exports.toRawResponse = exports.abortRawResponse = exports.makePassthroughRequest = exports.HttpResponsePromise = exports.getHeader = exports.fetcher = exports.EndpointSupplier = void 0;
|
|
4
4
|
var EndpointSupplier_js_1 = require("./EndpointSupplier.js");
|
|
5
5
|
Object.defineProperty(exports, "EndpointSupplier", { enumerable: true, get: function () { return EndpointSupplier_js_1.EndpointSupplier; } });
|
|
6
6
|
var Fetcher_js_1 = require("./Fetcher.js");
|
|
@@ -9,6 +9,8 @@ var getHeader_js_1 = require("./getHeader.js");
|
|
|
9
9
|
Object.defineProperty(exports, "getHeader", { enumerable: true, get: function () { return getHeader_js_1.getHeader; } });
|
|
10
10
|
var HttpResponsePromise_js_1 = require("./HttpResponsePromise.js");
|
|
11
11
|
Object.defineProperty(exports, "HttpResponsePromise", { enumerable: true, get: function () { return HttpResponsePromise_js_1.HttpResponsePromise; } });
|
|
12
|
+
var makePassthroughRequest_js_1 = require("./makePassthroughRequest.js");
|
|
13
|
+
Object.defineProperty(exports, "makePassthroughRequest", { enumerable: true, get: function () { return makePassthroughRequest_js_1.makePassthroughRequest; } });
|
|
12
14
|
var RawResponse_js_1 = require("./RawResponse.js");
|
|
13
15
|
Object.defineProperty(exports, "abortRawResponse", { enumerable: true, get: function () { return RawResponse_js_1.abortRawResponse; } });
|
|
14
16
|
Object.defineProperty(exports, "toRawResponse", { enumerable: true, get: function () { return RawResponse_js_1.toRawResponse; } });
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type LogConfig, type Logger } from "../logging/logger.js";
|
|
2
|
+
import { Supplier } from "./Supplier.js";
|
|
3
|
+
export declare namespace PassthroughRequest {
|
|
4
|
+
/**
|
|
5
|
+
* Per-request options that can override the SDK client defaults.
|
|
6
|
+
*/
|
|
7
|
+
interface RequestOptions {
|
|
8
|
+
/** Override the default timeout for this request (in seconds). */
|
|
9
|
+
timeoutInSeconds?: number;
|
|
10
|
+
/** Override the default number of retries for this request. */
|
|
11
|
+
maxRetries?: number;
|
|
12
|
+
/** Additional headers to include in this request. */
|
|
13
|
+
headers?: Record<string, string>;
|
|
14
|
+
/** Abort signal for this request. */
|
|
15
|
+
abortSignal?: AbortSignal;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* SDK client configuration used by the passthrough fetch method.
|
|
19
|
+
*/
|
|
20
|
+
interface ClientOptions {
|
|
21
|
+
/** The base URL or environment for the client. */
|
|
22
|
+
environment?: Supplier<string>;
|
|
23
|
+
/** Override the base URL. */
|
|
24
|
+
baseUrl?: Supplier<string>;
|
|
25
|
+
/** Default headers to include in requests. */
|
|
26
|
+
headers?: Record<string, unknown>;
|
|
27
|
+
/** Default maximum time to wait for a response in seconds. */
|
|
28
|
+
timeoutInSeconds?: number;
|
|
29
|
+
/** Default number of times to retry the request. Defaults to 2. */
|
|
30
|
+
maxRetries?: number;
|
|
31
|
+
/** A custom fetch function. */
|
|
32
|
+
fetch?: typeof fetch;
|
|
33
|
+
/** Logging configuration. */
|
|
34
|
+
logging?: LogConfig | Logger;
|
|
35
|
+
/** A function that returns auth headers. */
|
|
36
|
+
getAuthHeaders?: () => Promise<Record<string, string>>;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Makes a passthrough HTTP request using the SDK's configuration (auth, retry, logging, etc.)
|
|
41
|
+
* while mimicking the standard `fetch` API.
|
|
42
|
+
*
|
|
43
|
+
* @param input - The URL, path, or Request object. If a relative path, it will be resolved against the configured base URL.
|
|
44
|
+
* @param init - Standard RequestInit options (method, headers, body, signal, etc.)
|
|
45
|
+
* @param clientOptions - SDK client options (auth, default headers, logging, etc.)
|
|
46
|
+
* @param requestOptions - Per-request overrides (timeout, retries, extra headers, abort signal).
|
|
47
|
+
* @returns A standard Response object.
|
|
48
|
+
*/
|
|
49
|
+
export declare function makePassthroughRequest(input: Request | string | URL, init: RequestInit | undefined, clientOptions: PassthroughRequest.ClientOptions, requestOptions?: PassthroughRequest.RequestOptions): Promise<Response>;
|