@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.
Files changed (132) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +12 -0
  3. package/dist/cjs/Client.js +67 -0
  4. package/dist/cjs/api/resources/balance/client/Client.js +15 -6
  5. package/dist/cjs/api/resources/balance/client/requests/GetContactBalancesRequest.d.ts +2 -0
  6. package/dist/cjs/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.d.ts +2 -0
  7. package/dist/cjs/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.d.ts +5 -1
  8. package/dist/cjs/api/resources/balance/client/requests/GetSubscriptionBalancesRequest.d.ts +2 -0
  9. package/dist/cjs/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.d.ts +10 -1
  10. package/dist/cjs/api/resources/balance/client/requests/UpdateBalanceDefinitionRequest.d.ts +10 -1
  11. package/dist/cjs/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.d.ts +8 -0
  12. package/dist/cjs/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.js +11 -0
  13. package/dist/cjs/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.d.ts +5 -0
  14. package/dist/cjs/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.js +8 -0
  15. package/dist/cjs/api/resources/balance/types/index.d.ts +2 -0
  16. package/dist/cjs/api/resources/balance/types/index.js +2 -0
  17. package/dist/cjs/api/resources/contacts/client/Client.d.ts +2 -2
  18. package/dist/cjs/api/resources/contacts/client/Client.js +5 -2
  19. package/dist/cjs/api/resources/contacts/client/requests/CreateContactRequest.d.ts +1 -1
  20. package/dist/cjs/api/resources/contacts/client/requests/UpdateContactRequest.d.ts +1 -1
  21. package/dist/cjs/api/resources/ecommerce/client/Client.d.ts +2 -2
  22. package/dist/cjs/api/resources/ecommerce/client/Client.js +8 -2
  23. package/dist/cjs/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.d.ts +5 -1
  24. package/dist/cjs/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.d.ts +5 -1
  25. package/dist/cjs/api/resources/event/client/Client.d.ts +20 -1
  26. package/dist/cjs/api/resources/event/client/Client.js +69 -1
  27. package/dist/cjs/api/resources/event/client/requests/CreateEventRequest.d.ts +2 -2
  28. package/dist/cjs/api/resources/event/client/requests/GetEventsRequest.d.ts +20 -0
  29. package/dist/cjs/api/resources/event/client/requests/GetEventsRequest.js +3 -0
  30. package/dist/cjs/api/resources/event/client/requests/index.d.ts +1 -0
  31. package/dist/cjs/api/resources/event/types/CreateBatchEventsRequestItem.d.ts +2 -2
  32. package/dist/cjs/api/resources/process/types/GetProcessResponse.d.ts +3 -2
  33. package/dist/cjs/api/resources/process/types/GetProcessResponse.js +1 -0
  34. package/dist/cjs/api/resources/process/types/GetProcessesResponse.d.ts +3 -2
  35. package/dist/cjs/api/resources/process/types/GetProcessesResponse.js +1 -0
  36. package/dist/cjs/api/resources/program/client/Client.js +2 -1
  37. package/dist/cjs/api/resources/program/client/requests/GetParameterSubscriptionInfoRequest.d.ts +2 -0
  38. package/dist/cjs/api/resources/tier/client/requests/CreateTierGroupRequest.d.ts +11 -0
  39. package/dist/cjs/api/resources/tier/client/requests/UpdateTierGroupRequest.d.ts +11 -0
  40. package/dist/cjs/api/types/BatchAcceptedResponse.d.ts +9 -0
  41. package/dist/cjs/api/types/BatchAcceptedResponse.js +3 -0
  42. package/dist/cjs/api/types/GetEventsList.d.ts +32 -0
  43. package/dist/cjs/api/types/GetEventsList.js +3 -0
  44. package/dist/cjs/api/types/GetProductDetails.d.ts +4 -0
  45. package/dist/cjs/api/types/InternalServerErrorBody.d.ts +48 -0
  46. package/dist/cjs/api/types/InternalServerErrorBody.js +46 -0
  47. package/dist/cjs/api/types/index.d.ts +3 -0
  48. package/dist/cjs/api/types/index.js +3 -0
  49. package/dist/cjs/core/auth/BasicAuth.d.ts +2 -2
  50. package/dist/cjs/core/auth/BasicAuth.js +7 -1
  51. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +1 -1
  52. package/dist/cjs/core/fetcher/Fetcher.d.ts +2 -0
  53. package/dist/cjs/core/fetcher/Fetcher.js +4 -0
  54. package/dist/cjs/core/fetcher/index.d.ts +2 -0
  55. package/dist/cjs/core/fetcher/index.js +3 -1
  56. package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
  57. package/dist/cjs/core/fetcher/makePassthroughRequest.js +135 -0
  58. package/dist/cjs/core/file/file.js +3 -2
  59. package/dist/cjs/errors/BrevoError.d.ts +3 -1
  60. package/dist/cjs/errors/BrevoError.js +4 -1
  61. package/dist/cjs/errors/BrevoTimeoutError.d.ts +4 -1
  62. package/dist/cjs/errors/BrevoTimeoutError.js +4 -1
  63. package/dist/cjs/errors/handleNonStatusCodeError.js +4 -1
  64. package/dist/cjs/version.d.ts +1 -1
  65. package/dist/cjs/version.js +1 -1
  66. package/dist/esm/BaseClient.mjs +2 -2
  67. package/dist/esm/Client.d.mts +12 -0
  68. package/dist/esm/Client.mjs +34 -0
  69. package/dist/esm/api/resources/balance/client/Client.mjs +15 -6
  70. package/dist/esm/api/resources/balance/client/requests/GetContactBalancesRequest.d.mts +2 -0
  71. package/dist/esm/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.d.mts +2 -0
  72. package/dist/esm/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.d.mts +5 -1
  73. package/dist/esm/api/resources/balance/client/requests/GetSubscriptionBalancesRequest.d.mts +2 -0
  74. package/dist/esm/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.d.mts +10 -1
  75. package/dist/esm/api/resources/balance/client/requests/UpdateBalanceDefinitionRequest.d.mts +10 -1
  76. package/dist/esm/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.d.mts +8 -0
  77. package/dist/esm/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.mjs +8 -0
  78. package/dist/esm/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.d.mts +5 -0
  79. package/dist/esm/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.mjs +5 -0
  80. package/dist/esm/api/resources/balance/types/index.d.mts +2 -0
  81. package/dist/esm/api/resources/balance/types/index.mjs +2 -0
  82. package/dist/esm/api/resources/contacts/client/Client.d.mts +2 -2
  83. package/dist/esm/api/resources/contacts/client/Client.mjs +5 -2
  84. package/dist/esm/api/resources/contacts/client/requests/CreateContactRequest.d.mts +1 -1
  85. package/dist/esm/api/resources/contacts/client/requests/UpdateContactRequest.d.mts +1 -1
  86. package/dist/esm/api/resources/ecommerce/client/Client.d.mts +2 -2
  87. package/dist/esm/api/resources/ecommerce/client/Client.mjs +8 -2
  88. package/dist/esm/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.d.mts +5 -1
  89. package/dist/esm/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.d.mts +5 -1
  90. package/dist/esm/api/resources/event/client/Client.d.mts +20 -1
  91. package/dist/esm/api/resources/event/client/Client.mjs +69 -1
  92. package/dist/esm/api/resources/event/client/requests/CreateEventRequest.d.mts +2 -2
  93. package/dist/esm/api/resources/event/client/requests/GetEventsRequest.d.mts +20 -0
  94. package/dist/esm/api/resources/event/client/requests/GetEventsRequest.mjs +2 -0
  95. package/dist/esm/api/resources/event/client/requests/index.d.mts +1 -0
  96. package/dist/esm/api/resources/event/types/CreateBatchEventsRequestItem.d.mts +2 -2
  97. package/dist/esm/api/resources/process/types/GetProcessResponse.d.mts +3 -2
  98. package/dist/esm/api/resources/process/types/GetProcessResponse.mjs +1 -0
  99. package/dist/esm/api/resources/process/types/GetProcessesResponse.d.mts +3 -2
  100. package/dist/esm/api/resources/process/types/GetProcessesResponse.mjs +1 -0
  101. package/dist/esm/api/resources/program/client/Client.mjs +2 -1
  102. package/dist/esm/api/resources/program/client/requests/GetParameterSubscriptionInfoRequest.d.mts +2 -0
  103. package/dist/esm/api/resources/tier/client/requests/CreateTierGroupRequest.d.mts +11 -0
  104. package/dist/esm/api/resources/tier/client/requests/UpdateTierGroupRequest.d.mts +11 -0
  105. package/dist/esm/api/types/BatchAcceptedResponse.d.mts +9 -0
  106. package/dist/esm/api/types/BatchAcceptedResponse.mjs +2 -0
  107. package/dist/esm/api/types/GetEventsList.d.mts +32 -0
  108. package/dist/esm/api/types/GetEventsList.mjs +2 -0
  109. package/dist/esm/api/types/GetProductDetails.d.mts +4 -0
  110. package/dist/esm/api/types/InternalServerErrorBody.d.mts +48 -0
  111. package/dist/esm/api/types/InternalServerErrorBody.mjs +43 -0
  112. package/dist/esm/api/types/index.d.mts +3 -0
  113. package/dist/esm/api/types/index.mjs +3 -0
  114. package/dist/esm/core/auth/BasicAuth.d.mts +2 -2
  115. package/dist/esm/core/auth/BasicAuth.mjs +7 -1
  116. package/dist/esm/core/fetcher/BinaryResponse.d.mts +1 -1
  117. package/dist/esm/core/fetcher/Fetcher.d.mts +2 -0
  118. package/dist/esm/core/fetcher/Fetcher.mjs +4 -0
  119. package/dist/esm/core/fetcher/index.d.mts +2 -0
  120. package/dist/esm/core/fetcher/index.mjs +1 -0
  121. package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
  122. package/dist/esm/core/fetcher/makePassthroughRequest.mjs +132 -0
  123. package/dist/esm/core/file/file.mjs +3 -2
  124. package/dist/esm/errors/BrevoError.d.mts +3 -1
  125. package/dist/esm/errors/BrevoError.mjs +4 -1
  126. package/dist/esm/errors/BrevoTimeoutError.d.mts +4 -1
  127. package/dist/esm/errors/BrevoTimeoutError.mjs +4 -1
  128. package/dist/esm/errors/handleNonStatusCodeError.mjs +4 -1
  129. package/dist/esm/version.d.mts +1 -1
  130. package/dist/esm/version.mjs +1 -1
  131. package/package.json +7 -7
  132. package/reference.md +72 -5
@@ -32,7 +32,7 @@ export declare class EcommerceClient {
32
32
  * id: "CAT123"
33
33
  * })
34
34
  */
35
- createUpdateCategory(request: Brevo.CreateUpdateCategoryRequest, requestOptions?: EcommerceClient.RequestOptions): core.HttpResponsePromise<Brevo.CreateUpdateCategoryResponse>;
35
+ createUpdateCategory(request: Brevo.CreateUpdateCategoryRequest, requestOptions?: EcommerceClient.RequestOptions): core.HttpResponsePromise<Brevo.CreateUpdateCategoryResponse | undefined>;
36
36
  private __createUpdateCategory;
37
37
  /**
38
38
  * @param {Brevo.CreateUpdateBatchCategoryRequest} request
@@ -230,7 +230,7 @@ export declare class EcommerceClient {
230
230
  * name: "Iphone 11"
231
231
  * })
232
232
  */
233
- createUpdateProduct(request: Brevo.CreateUpdateProductRequest, requestOptions?: EcommerceClient.RequestOptions): core.HttpResponsePromise<Brevo.CreateUpdateProductResponse>;
233
+ createUpdateProduct(request: Brevo.CreateUpdateProductRequest, requestOptions?: EcommerceClient.RequestOptions): core.HttpResponsePromise<Brevo.CreateUpdateProductResponse | undefined>;
234
234
  private __createUpdateProduct;
235
235
  /**
236
236
  * @param {Brevo.CreateUpdateBatchProductsRequest} request
@@ -121,7 +121,10 @@ export class EcommerceClient {
121
121
  logging: this._options.logging,
122
122
  });
123
123
  if (_response.ok) {
124
- return { data: _response.body, rawResponse: _response.rawResponse };
124
+ return {
125
+ data: _response.body,
126
+ rawResponse: _response.rawResponse,
127
+ };
125
128
  }
126
129
  if (_response.error.reason === "status-code") {
127
130
  switch (_response.error.statusCode) {
@@ -859,7 +862,10 @@ export class EcommerceClient {
859
862
  logging: this._options.logging,
860
863
  });
861
864
  if (_response.ok) {
862
- return { data: _response.body, rawResponse: _response.rawResponse };
865
+ return {
866
+ data: _response.body,
867
+ rawResponse: _response.rawResponse,
868
+ };
863
869
  }
864
870
  if (_response.error.reason === "status-code") {
865
871
  switch (_response.error.statusCode) {
@@ -17,17 +17,21 @@ export declare namespace CreateUpdateBatchProductsRequest {
17
17
  type Products = Products.Item[];
18
18
  namespace Products {
19
19
  interface Item {
20
+ /** Brand of the product */
21
+ brand?: string | undefined;
20
22
  /** Category ID-s of the product */
21
23
  categories?: string[] | undefined;
22
24
  /** UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database */
23
25
  deletedAt?: string | undefined;
26
+ /** Description of the product */
27
+ description?: string | undefined;
24
28
  /** Product ID for which you requested the details */
25
29
  id: string;
26
30
  /** Absolute URL to the cover image of the product */
27
31
  imageUrl?: string | undefined;
28
32
  /** product deleted from the shop's database */
29
33
  isDeleted?: boolean | undefined;
30
- /** Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 20. */
34
+ /** Meta data of product such as description, vendor, producer, stock level. The total characters of cumulative metaInfo shall not exceed **20000 characters**. */
31
35
  metaInfo?: Record<string, Item.MetaInfo.Value> | undefined;
32
36
  /** Mandatory in case of creation**. Name of the product for which you requested the details */
33
37
  name: string;
@@ -6,17 +6,21 @@
6
6
  * }
7
7
  */
8
8
  export interface CreateUpdateProductRequest {
9
+ /** Brand of the product */
10
+ brand?: string;
9
11
  /** Category ID-s of the product */
10
12
  categories?: string[];
11
13
  /** UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database */
12
14
  deletedAt?: string;
15
+ /** Description of the product */
16
+ description?: string;
13
17
  /** Product ID for which you requested the details */
14
18
  id: string;
15
19
  /** Absolute URL to the cover image of the product */
16
20
  imageUrl?: string;
17
21
  /** product deleted from the shop's database */
18
22
  isDeleted?: boolean;
19
- /** Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 20. */
23
+ /** Meta data of product such as description, vendor, producer, stock level. The total characters of cumulative metaInfo shall not exceed **20000 characters**. */
20
24
  metaInfo?: Record<string, CreateUpdateProductRequest.MetaInfo.Value>;
21
25
  /** Mandatory in case of creation**. Name of the product for which you requested the details */
22
26
  name: string;
@@ -10,6 +10,25 @@ export declare namespace EventClient {
10
10
  export declare class EventClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<EventClient.Options>;
12
12
  constructor(options: EventClient.Options);
13
+ /**
14
+ * <Note>
15
+ * This endpoint currently only supports custom events.
16
+ * </Note>
17
+ *
18
+ * Retrieve a list of events filtered by various criteria.
19
+ *
20
+ * @param {Brevo.GetEventsRequest} request
21
+ * @param {EventClient.RequestOptions} requestOptions - Request-specific configuration.
22
+ *
23
+ * @throws {@link Brevo.BadRequestError}
24
+ * @throws {@link Brevo.UnauthorizedError}
25
+ * @throws {@link Brevo.InternalServerError}
26
+ *
27
+ * @example
28
+ * await client.event.getEvents()
29
+ */
30
+ getEvents(request?: Brevo.GetEventsRequest, requestOptions?: EventClient.RequestOptions): core.HttpResponsePromise<Brevo.GetEventsList>;
31
+ private __getEvents;
13
32
  /**
14
33
  * Create an event to track a contact's interaction.
15
34
  *
@@ -42,6 +61,6 @@ export declare class EventClient {
42
61
  * identifiers: {}
43
62
  * }])
44
63
  */
45
- createBatchEvents(request: Brevo.CreateBatchEventsRequestItem[], requestOptions?: EventClient.RequestOptions): core.HttpResponsePromise<void>;
64
+ createBatchEvents(request: Brevo.CreateBatchEventsRequestItem[], requestOptions?: EventClient.RequestOptions): core.HttpResponsePromise<Brevo.BatchAcceptedResponse>;
46
65
  private __createBatchEvents;
47
66
  }
@@ -19,6 +19,74 @@ export class EventClient {
19
19
  constructor(options) {
20
20
  this._options = normalizeClientOptionsWithAuth(options);
21
21
  }
22
+ /**
23
+ * <Note>
24
+ * This endpoint currently only supports custom events.
25
+ * </Note>
26
+ *
27
+ * Retrieve a list of events filtered by various criteria.
28
+ *
29
+ * @param {Brevo.GetEventsRequest} request
30
+ * @param {EventClient.RequestOptions} requestOptions - Request-specific configuration.
31
+ *
32
+ * @throws {@link Brevo.BadRequestError}
33
+ * @throws {@link Brevo.UnauthorizedError}
34
+ * @throws {@link Brevo.InternalServerError}
35
+ *
36
+ * @example
37
+ * await client.event.getEvents()
38
+ */
39
+ getEvents(request = {}, requestOptions) {
40
+ return core.HttpResponsePromise.fromPromise(this.__getEvents(request, requestOptions));
41
+ }
42
+ __getEvents() {
43
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
44
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
45
+ const { contact_id: contactId, event_name: eventName, object_type: objectType, startDate, endDate, limit, offset, } = request;
46
+ const _queryParams = {
47
+ contact_id: contactId,
48
+ event_name: eventName,
49
+ object_type: objectType,
50
+ startDate,
51
+ endDate,
52
+ limit,
53
+ offset,
54
+ };
55
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
56
+ 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);
57
+ const _response = yield core.fetcher({
58
+ 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, "events"),
59
+ method: "GET",
60
+ headers: _headers,
61
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
62
+ 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,
63
+ 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,
64
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
65
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
66
+ logging: this._options.logging,
67
+ });
68
+ if (_response.ok) {
69
+ return { data: _response.body, rawResponse: _response.rawResponse };
70
+ }
71
+ if (_response.error.reason === "status-code") {
72
+ switch (_response.error.statusCode) {
73
+ case 400:
74
+ throw new Brevo.BadRequestError(_response.error.body, _response.rawResponse);
75
+ case 401:
76
+ throw new Brevo.UnauthorizedError(_response.error.body, _response.rawResponse);
77
+ case 500:
78
+ throw new Brevo.InternalServerError(_response.error.body, _response.rawResponse);
79
+ default:
80
+ throw new errors.BrevoError({
81
+ statusCode: _response.error.statusCode,
82
+ body: _response.error.body,
83
+ rawResponse: _response.rawResponse,
84
+ });
85
+ }
86
+ }
87
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/events");
88
+ });
89
+ }
22
90
  /**
23
91
  * Create an event to track a contact's interaction.
24
92
  *
@@ -114,7 +182,7 @@ export class EventClient {
114
182
  logging: this._options.logging,
115
183
  });
116
184
  if (_response.ok) {
117
- return { data: undefined, rawResponse: _response.rawResponse };
185
+ return { data: _response.body, rawResponse: _response.rawResponse };
118
186
  }
119
187
  if (_response.error.reason === "status-code") {
120
188
  switch (_response.error.statusCode) {
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1 +1,2 @@
1
1
  export type { CreateEventRequest } from "./CreateEventRequest.mjs";
2
+ export type { GetEventsRequest } from "./GetEventsRequest.mjs";
@@ -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
- /** Number of duplicate email IDs */
61
- duplicate_email_id?: (number | null) | undefined;
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 */
@@ -14,6 +14,7 @@ export var GetProcessResponse;
14
14
  /** Current status of the process */
15
15
  GetProcessResponse.Status = {
16
16
  Queued: "queued",
17
+ InProcess: "in_process",
17
18
  Processing: "processing",
18
19
  Completed: "completed",
19
20
  Failed: "failed",
@@ -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
- /** Number of duplicate email IDs */
70
- duplicate_email_id?: (number | null) | undefined;
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 */
@@ -18,6 +18,7 @@ export var GetProcessesResponse;
18
18
  /** Current status of the process */
19
19
  Item.Status = {
20
20
  Queued: "queued",
21
+ InProcess: "in_process",
21
22
  Processing: "processing",
22
23
  Completed: "completed",
23
24
  Failed: "failed",
@@ -453,11 +453,12 @@ export class ProgramClient {
453
453
  __getParameterSubscriptionInfo(request, requestOptions) {
454
454
  return __awaiter(this, void 0, void 0, function* () {
455
455
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
456
- const { pid, contactId, params, loyaltySubscriptionId } = request;
456
+ const { pid, contactId, params, loyaltySubscriptionId, includeInternal } = request;
457
457
  const _queryParams = {
458
458
  contactId,
459
459
  params,
460
460
  loyaltySubscriptionId,
461
+ includeInternal,
461
462
  };
462
463
  const _authRequest = yield this._options.authProvider.getAuthRequest();
463
464
  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);
@@ -13,4 +13,6 @@ export interface GetParameterSubscriptionInfoRequest {
13
13
  params?: string;
14
14
  /** The loyalty subscription ID to filter by. */
15
15
  loyaltySubscriptionId?: string;
16
+ /** Include balances tied to internal definitions. */
17
+ includeInternal?: boolean;
16
18
  }
@@ -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,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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,43 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var InternalServerErrorBody;
3
+ (function (InternalServerErrorBody) {
4
+ /** Error code displayed in case of a failure */
5
+ InternalServerErrorBody.Code = {
6
+ InvalidParameter: "invalid_parameter",
7
+ MissingParameter: "missing_parameter",
8
+ OutOfRange: "out_of_range",
9
+ CampaignProcessing: "campaign_processing",
10
+ CampaignSent: "campaign_sent",
11
+ DocumentNotFound: "document_not_found",
12
+ NotEnoughCredits: "not_enough_credits",
13
+ PermissionDenied: "permission_denied",
14
+ DuplicateParameter: "duplicate_parameter",
15
+ DuplicateRequest: "duplicate_request",
16
+ MethodNotAllowed: "method_not_allowed",
17
+ Unauthorized: "unauthorized",
18
+ AccountUnderValidation: "account_under_validation",
19
+ NotAcceptable: "not_acceptable",
20
+ BadRequest: "bad_request",
21
+ UnprocessableEntity: "unprocessable_entity",
22
+ DomainDoesNotExist: "Domain does not exist",
23
+ ContactEmailNotFound: "Contact email not found",
24
+ AttributeNotFound: "Attribute not found",
25
+ CategoryIdNotFound: "Category id not found",
26
+ InvalidParametersPassed: "Invalid parameters passed",
27
+ RecordSForIdentifierNotFound: "Record(s) for identifier not found",
28
+ ReturnedWhenQueryParamsAreInvalid: "Returned when query params are invalid",
29
+ ReturnedWhenInvalidDataPosted: "Returned when invalid data posted",
30
+ FeedNotFound: "Feed not found",
31
+ CampaignIdNotFound: "Campaign ID not found",
32
+ ApiKeyNotFound: "api-key not found",
33
+ DmarcPolicyRequiresDomainAuthentication: "DMARC policy requires domain authentication",
34
+ DnsRecordsNotProperlyConfigured: "DNS records not properly configured",
35
+ InvalidOtpCodeProvided: "Invalid OTP code provided",
36
+ OtpCodeHasExpired: "OTP code has expired",
37
+ DomainAlreadyExistsInYourAccount: "Domain already exists in your account",
38
+ TheSumOfAllIpWeightsMustEqual100: "The sum of all IP weights must equal 100",
39
+ AuthenticationFailed: "Authentication failed",
40
+ InsufficientCredits: "Insufficient credits",
41
+ RequestAlreadyProcessed: "Request already processed",
42
+ };
43
+ })(InternalServerErrorBody || (InternalServerErrorBody = {}));
@@ -4,6 +4,7 @@ export * from "./AbTestVersionStats.mjs";
4
4
  export * from "./BadRequestErrorBody.mjs";
5
5
  export * from "./BalanceDefinition.mjs";
6
6
  export * from "./BalanceLimit.mjs";
7
+ export * from "./BatchAcceptedResponse.mjs";
7
8
  export * from "./BatchEventsResponse.mjs";
8
9
  export * from "./Cart.mjs";
9
10
  export * from "./Company.mjs";
@@ -23,6 +24,7 @@ export * from "./GetContactDetails.mjs";
23
24
  export * from "./GetContacts.mjs";
24
25
  export * from "./GetCouponCollection.mjs";
25
26
  export * from "./GetDeviceBrowserStats.mjs";
27
+ export * from "./GetEventsList.mjs";
26
28
  export * from "./GetExtendedCampaignOverview.mjs";
27
29
  export * from "./GetExtendedCampaignStats.mjs";
28
30
  export * from "./GetFolder.mjs";
@@ -33,6 +35,7 @@ export * from "./GetSmsCampaignStats.mjs";
33
35
  export * from "./GetSmtpTemplateOverview.mjs";
34
36
  export * from "./GetSsoToken.mjs";
35
37
  export * from "./GetWebhook.mjs";
38
+ export * from "./InternalServerErrorBody.mjs";
36
39
  export * from "./Inviteuser.mjs";
37
40
  export * from "./LoyaltyProgram.mjs";
38
41
  export * from "./NodeResponse.mjs";
@@ -4,6 +4,7 @@ export * from "./AbTestVersionStats.mjs";
4
4
  export * from "./BadRequestErrorBody.mjs";
5
5
  export * from "./BalanceDefinition.mjs";
6
6
  export * from "./BalanceLimit.mjs";
7
+ export * from "./BatchAcceptedResponse.mjs";
7
8
  export * from "./BatchEventsResponse.mjs";
8
9
  export * from "./Cart.mjs";
9
10
  export * from "./Company.mjs";
@@ -23,6 +24,7 @@ export * from "./GetContactDetails.mjs";
23
24
  export * from "./GetContacts.mjs";
24
25
  export * from "./GetCouponCollection.mjs";
25
26
  export * from "./GetDeviceBrowserStats.mjs";
27
+ export * from "./GetEventsList.mjs";
26
28
  export * from "./GetExtendedCampaignOverview.mjs";
27
29
  export * from "./GetExtendedCampaignStats.mjs";
28
30
  export * from "./GetFolder.mjs";
@@ -33,6 +35,7 @@ export * from "./GetSmsCampaignStats.mjs";
33
35
  export * from "./GetSmtpTemplateOverview.mjs";
34
36
  export * from "./GetSsoToken.mjs";
35
37
  export * from "./GetWebhook.mjs";
38
+ export * from "./InternalServerErrorBody.mjs";
36
39
  export * from "./Inviteuser.mjs";
37
40
  export * from "./LoyaltyProgram.mjs";
38
41
  export * from "./NodeResponse.mjs";
@@ -1,6 +1,6 @@
1
1
  export interface BasicAuth {
2
- username: string;
3
- password: string;
2
+ username?: string;
3
+ password?: string;
4
4
  }
5
5
  export declare const BasicAuth: {
6
6
  toAuthorizationHeader: (basicAuth: BasicAuth | undefined) => string | undefined;
@@ -2,10 +2,16 @@ import { base64Decode, base64Encode } from "../base64.mjs";
2
2
  const BASIC_AUTH_HEADER_PREFIX = /^Basic /i;
3
3
  export const BasicAuth = {
4
4
  toAuthorizationHeader: (basicAuth) => {
5
+ var _a, _b;
5
6
  if (basicAuth == null) {
6
7
  return undefined;
7
8
  }
8
- const token = base64Encode(`${basicAuth.username}:${basicAuth.password}`);
9
+ const username = (_a = basicAuth.username) !== null && _a !== void 0 ? _a : "";
10
+ const password = (_b = basicAuth.password) !== null && _b !== void 0 ? _b : "";
11
+ if (username === "" && password === "") {
12
+ return undefined;
13
+ }
14
+ const token = base64Encode(`${username}:${password}`);
9
15
  return `Basic ${token}`;
10
16
  },
11
17
  fromAuthorizationHeader: (header) => {