@wix/auto_sdk_email-transmissions_email-transmissions 1.0.0
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/build/cjs/index.d.ts +46 -0
- package/build/cjs/index.js +488 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +744 -0
- package/build/cjs/index.typings.js +434 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +551 -0
- package/build/cjs/meta.js +343 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/schemas.d.ts +423 -0
- package/build/cjs/schemas.js +748 -0
- package/build/cjs/schemas.js.map +1 -0
- package/build/es/index.d.mts +46 -0
- package/build/es/index.mjs +454 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +744 -0
- package/build/es/index.typings.mjs +399 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +551 -0
- package/build/es/meta.mjs +307 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/schemas.d.mts +423 -0
- package/build/es/schemas.mjs +704 -0
- package/build/es/schemas.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +46 -0
- package/build/internal/cjs/index.js +488 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +744 -0
- package/build/internal/cjs/index.typings.js +434 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +551 -0
- package/build/internal/cjs/meta.js +343 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/schemas.d.ts +423 -0
- package/build/internal/cjs/schemas.js +748 -0
- package/build/internal/cjs/schemas.js.map +1 -0
- package/build/internal/es/index.d.mts +46 -0
- package/build/internal/es/index.mjs +454 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/index.typings.d.mts +744 -0
- package/build/internal/es/index.typings.mjs +399 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +551 -0
- package/build/internal/es/meta.mjs +307 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/build/internal/es/schemas.d.mts +423 -0
- package/build/internal/es/schemas.mjs +704 -0
- package/build/internal/es/schemas.mjs.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +61 -0
- package/schemas/package.json +3 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { EmailTransmission, SendEmailTransmissionOptions, SendEmailTransmissionResponse, SendEmailTransmissionApplicationErrors, SendEmailTransmissionValidationErrors, DeleteEmailTransmissionApplicationErrors, EmailTransmissionsQueryBuilder, EmailTransmissionQuery, typedQueryEmailTransmissions } from './index.typings.js';
|
|
3
|
+
export { AccountInfo, AccountSuspendedErrorDetails, ActionEvent, CommonQueryWithEntityContext, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteEmailTransmissionRequest, DeleteEmailTransmissionResponse, DomainEvent, DomainEventBodyOneOf, EmailTransmissionQuerySpec, EmailTransmissionStatusOptionsOneOf, EmailTransmissionTypeOptionsOneOf, EmailTransmissionsQueryResult, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, FailureReason, FailureReasonWithLiterals, GetEmailTransmissionRequest, GetEmailTransmissionResponse, IdentificationData, IdentificationDataIdOneOf, MarketingOptions, MessageEnvelope, OutOfQuotaErrorDetails, QueryEmailTransmissionsRequest, QueryEmailTransmissionsResponse, Recipient, RecipientValueOneOf, RejectedOptions, RejectionReason, RejectionReasonWithLiterals, RestoreInfo, SendEmailTransmissionRequest, SortOrder, SortOrderWithLiterals, Sorting, Status, StatusWithLiterals, Type, TypeWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.js';
|
|
4
|
+
|
|
5
|
+
declare function sendEmailTransmission$1(httpClient: HttpClient): SendEmailTransmissionSignature;
|
|
6
|
+
interface SendEmailTransmissionSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Create and send new email transmission.
|
|
9
|
+
* @param - EmailTransmission to be created.
|
|
10
|
+
*/
|
|
11
|
+
(emailTransmission: NonNullablePaths<EmailTransmission, `emailHtmlContent` | `toRecipients` | `type`, 2>, options?: SendEmailTransmissionOptions): Promise<NonNullablePaths<SendEmailTransmissionResponse, `emailTransmission.rejectedOptions.rejectionReasons` | `emailTransmission._id` | `emailTransmission.emailHtmlContent` | `emailTransmission.replyTo.contactId` | `emailTransmission.replyTo.userId` | `emailTransmission.replyTo.emailAddress` | `emailTransmission.replyTo.failureReason` | `emailTransmission.toRecipients` | `emailTransmission.type` | `emailTransmission.status`, 4> & {
|
|
12
|
+
__applicationErrorsType?: SendEmailTransmissionApplicationErrors;
|
|
13
|
+
__validationErrorsType?: SendEmailTransmissionValidationErrors;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
declare function getEmailTransmission$1(httpClient: HttpClient): GetEmailTransmissionSignature;
|
|
17
|
+
interface GetEmailTransmissionSignature {
|
|
18
|
+
/**
|
|
19
|
+
* Get email transmission by ID.
|
|
20
|
+
* @param - ID of the EmailTransmission to retrieve.
|
|
21
|
+
* @returns The requested EmailTransmission.
|
|
22
|
+
*/
|
|
23
|
+
(emailTransmissionId: string): Promise<NonNullablePaths<EmailTransmission, `rejectedOptions.rejectionReasons` | `_id` | `emailHtmlContent` | `replyTo.contactId` | `replyTo.userId` | `replyTo.emailAddress` | `replyTo.failureReason` | `toRecipients` | `type` | `status`, 3>>;
|
|
24
|
+
}
|
|
25
|
+
declare function deleteEmailTransmission$1(httpClient: HttpClient): DeleteEmailTransmissionSignature;
|
|
26
|
+
interface DeleteEmailTransmissionSignature {
|
|
27
|
+
/**
|
|
28
|
+
* Delete email transmission by ID.
|
|
29
|
+
* Note that this operation is only allowed for PROCESSED or REJECTED email transmissions. Deleting an ACCEPTED or IN_PROGRESS email transmission will result in an error.
|
|
30
|
+
* @param - Id of the EmailTransmission to delete.
|
|
31
|
+
*/
|
|
32
|
+
(emailTransmissionId: string): Promise<void & {
|
|
33
|
+
__applicationErrorsType?: DeleteEmailTransmissionApplicationErrors;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare function customQueryEmailTransmissions(httpClient: HttpClient): {
|
|
38
|
+
(): EmailTransmissionsQueryBuilder;
|
|
39
|
+
(query: EmailTransmissionQuery): ReturnType<typeof typedQueryEmailTransmissions>;
|
|
40
|
+
};
|
|
41
|
+
declare const sendEmailTransmission: MaybeContext<BuildRESTFunction<typeof sendEmailTransmission$1> & typeof sendEmailTransmission$1>;
|
|
42
|
+
declare const getEmailTransmission: MaybeContext<BuildRESTFunction<typeof getEmailTransmission$1> & typeof getEmailTransmission$1>;
|
|
43
|
+
declare const deleteEmailTransmission: MaybeContext<BuildRESTFunction<typeof deleteEmailTransmission$1> & typeof deleteEmailTransmission$1>;
|
|
44
|
+
declare const queryEmailTransmissions: MaybeContext<BuildRESTFunction<typeof customQueryEmailTransmissions> & typeof customQueryEmailTransmissions>;
|
|
45
|
+
|
|
46
|
+
export { DeleteEmailTransmissionApplicationErrors, EmailTransmission, EmailTransmissionQuery, EmailTransmissionsQueryBuilder, SendEmailTransmissionApplicationErrors, SendEmailTransmissionOptions, SendEmailTransmissionResponse, SendEmailTransmissionValidationErrors, deleteEmailTransmission, getEmailTransmission, queryEmailTransmissions, sendEmailTransmission };
|
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
FailureReason: () => FailureReason,
|
|
24
|
+
RejectionReason: () => RejectionReason,
|
|
25
|
+
SortOrder: () => SortOrder,
|
|
26
|
+
Status: () => Status,
|
|
27
|
+
Type: () => Type,
|
|
28
|
+
WebhookIdentityType: () => WebhookIdentityType,
|
|
29
|
+
deleteEmailTransmission: () => deleteEmailTransmission4,
|
|
30
|
+
getEmailTransmission: () => getEmailTransmission4,
|
|
31
|
+
queryEmailTransmissions: () => queryEmailTransmissions4,
|
|
32
|
+
sendEmailTransmission: () => sendEmailTransmission4,
|
|
33
|
+
utils: () => utils
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
|
|
37
|
+
// src/emails-transmissions-v1-email-transmission-email-transmissions.universal.ts
|
|
38
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
39
|
+
var import_query_builder = require("@wix/sdk-runtime/query-builder");
|
|
40
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
41
|
+
|
|
42
|
+
// src/emails-transmissions-v1-email-transmission-email-transmissions.http.ts
|
|
43
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
44
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
45
|
+
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
46
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
47
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
48
|
+
function resolveWixEmailsTransmissionsV1EmailTransmissionServiceUrl(opts) {
|
|
49
|
+
const domainToMappings = {
|
|
50
|
+
"www.wixapis.com": [
|
|
51
|
+
{
|
|
52
|
+
srcPath: "/email-transmissions/v1",
|
|
53
|
+
destPath: "/v1"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
srcPath: "/emails/transmissions/v1/email-transmissions",
|
|
57
|
+
destPath: "/v1/email-transmissions"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"manage._base_domain_": [
|
|
61
|
+
{
|
|
62
|
+
srcPath: "/email-transmissions/v1",
|
|
63
|
+
destPath: "/v1"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"*.dev.wix-code.com": [
|
|
67
|
+
{
|
|
68
|
+
srcPath: "/emails/transmissions/v1/email-transmissions",
|
|
69
|
+
destPath: "/v1/email-transmissions"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
_: [
|
|
73
|
+
{
|
|
74
|
+
srcPath: "/emails/transmissions/v1/email-transmissions",
|
|
75
|
+
destPath: "/v1/email-transmissions"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"api._api_base_domain_": [
|
|
79
|
+
{
|
|
80
|
+
srcPath: "/transmissions",
|
|
81
|
+
destPath: ""
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
};
|
|
85
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
86
|
+
}
|
|
87
|
+
var PACKAGE_NAME = "@wix/auto_sdk_email-transmissions_email-transmissions";
|
|
88
|
+
function sendEmailTransmission(payload) {
|
|
89
|
+
function __sendEmailTransmission({ host }) {
|
|
90
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
91
|
+
{
|
|
92
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
93
|
+
paths: [
|
|
94
|
+
{ path: "emailTransmission.createdDate" },
|
|
95
|
+
{ path: "emailTransmission.updatedDate" }
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
]);
|
|
99
|
+
const metadata = {
|
|
100
|
+
entityFqdn: "wix.emails.transmissions.v1.email_transmission",
|
|
101
|
+
method: "POST",
|
|
102
|
+
methodFqn: "wix.emails.transmissions.v1.EmailTransmissionService.SendEmailTransmission",
|
|
103
|
+
packageName: PACKAGE_NAME,
|
|
104
|
+
migrationOptions: {
|
|
105
|
+
optInTransformResponse: true
|
|
106
|
+
},
|
|
107
|
+
url: resolveWixEmailsTransmissionsV1EmailTransmissionServiceUrl({
|
|
108
|
+
protoPath: "/v1/email-transmissions/send",
|
|
109
|
+
data: serializedData,
|
|
110
|
+
host
|
|
111
|
+
}),
|
|
112
|
+
data: serializedData,
|
|
113
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
114
|
+
{
|
|
115
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
116
|
+
paths: [
|
|
117
|
+
{ path: "emailTransmission.createdDate" },
|
|
118
|
+
{ path: "emailTransmission.updatedDate" }
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
])
|
|
122
|
+
};
|
|
123
|
+
return metadata;
|
|
124
|
+
}
|
|
125
|
+
return __sendEmailTransmission;
|
|
126
|
+
}
|
|
127
|
+
function getEmailTransmission(payload) {
|
|
128
|
+
function __getEmailTransmission({ host }) {
|
|
129
|
+
const metadata = {
|
|
130
|
+
entityFqdn: "wix.emails.transmissions.v1.email_transmission",
|
|
131
|
+
method: "GET",
|
|
132
|
+
methodFqn: "wix.emails.transmissions.v1.EmailTransmissionService.GetEmailTransmission",
|
|
133
|
+
packageName: PACKAGE_NAME,
|
|
134
|
+
migrationOptions: {
|
|
135
|
+
optInTransformResponse: true
|
|
136
|
+
},
|
|
137
|
+
url: resolveWixEmailsTransmissionsV1EmailTransmissionServiceUrl({
|
|
138
|
+
protoPath: "/v1/email-transmissions/{emailTransmissionId}",
|
|
139
|
+
data: payload,
|
|
140
|
+
host
|
|
141
|
+
}),
|
|
142
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
143
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
144
|
+
{
|
|
145
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
146
|
+
paths: [
|
|
147
|
+
{ path: "emailTransmission.createdDate" },
|
|
148
|
+
{ path: "emailTransmission.updatedDate" }
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
])
|
|
152
|
+
};
|
|
153
|
+
return metadata;
|
|
154
|
+
}
|
|
155
|
+
return __getEmailTransmission;
|
|
156
|
+
}
|
|
157
|
+
function queryEmailTransmissions(payload) {
|
|
158
|
+
function __queryEmailTransmissions({ host }) {
|
|
159
|
+
const metadata = {
|
|
160
|
+
entityFqdn: "wix.emails.transmissions.v1.email_transmission",
|
|
161
|
+
method: "POST",
|
|
162
|
+
methodFqn: "wix.emails.transmissions.v1.EmailTransmissionService.QueryEmailTransmissions",
|
|
163
|
+
packageName: PACKAGE_NAME,
|
|
164
|
+
migrationOptions: {
|
|
165
|
+
optInTransformResponse: true
|
|
166
|
+
},
|
|
167
|
+
url: resolveWixEmailsTransmissionsV1EmailTransmissionServiceUrl({
|
|
168
|
+
protoPath: "/v1/email-transmissions/query",
|
|
169
|
+
data: payload,
|
|
170
|
+
host
|
|
171
|
+
}),
|
|
172
|
+
data: payload,
|
|
173
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
174
|
+
{
|
|
175
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
176
|
+
paths: [
|
|
177
|
+
{ path: "emailTransmissions.createdDate" },
|
|
178
|
+
{ path: "emailTransmissions.updatedDate" }
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
])
|
|
182
|
+
};
|
|
183
|
+
return metadata;
|
|
184
|
+
}
|
|
185
|
+
return __queryEmailTransmissions;
|
|
186
|
+
}
|
|
187
|
+
function deleteEmailTransmission(payload) {
|
|
188
|
+
function __deleteEmailTransmission({ host }) {
|
|
189
|
+
const metadata = {
|
|
190
|
+
entityFqdn: "wix.emails.transmissions.v1.email_transmission",
|
|
191
|
+
method: "DELETE",
|
|
192
|
+
methodFqn: "wix.emails.transmissions.v1.EmailTransmissionService.DeleteEmailTransmission",
|
|
193
|
+
packageName: PACKAGE_NAME,
|
|
194
|
+
migrationOptions: {
|
|
195
|
+
optInTransformResponse: true
|
|
196
|
+
},
|
|
197
|
+
url: resolveWixEmailsTransmissionsV1EmailTransmissionServiceUrl({
|
|
198
|
+
protoPath: "/v1/email-transmissions/{emailTransmissionId}",
|
|
199
|
+
data: payload,
|
|
200
|
+
host
|
|
201
|
+
}),
|
|
202
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
203
|
+
};
|
|
204
|
+
return metadata;
|
|
205
|
+
}
|
|
206
|
+
return __deleteEmailTransmission;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// src/emails-transmissions-v1-email-transmission-email-transmissions.universal.ts
|
|
210
|
+
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
211
|
+
var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
|
|
212
|
+
var FailureReason = /* @__PURE__ */ ((FailureReason2) => {
|
|
213
|
+
FailureReason2["NONE"] = "NONE";
|
|
214
|
+
FailureReason2["RECIPIENT_NOT_FOUND"] = "RECIPIENT_NOT_FOUND";
|
|
215
|
+
FailureReason2["EMAIL_ADDRESS_MISSING"] = "EMAIL_ADDRESS_MISSING";
|
|
216
|
+
FailureReason2["EMAIL_ADDRESS_INVALID"] = "EMAIL_ADDRESS_INVALID";
|
|
217
|
+
FailureReason2["EMAIL_ADDRESS_BOUNCED"] = "EMAIL_ADDRESS_BOUNCED";
|
|
218
|
+
FailureReason2["MARKETING_CONSENT_NOT_GIVEN"] = "MARKETING_CONSENT_NOT_GIVEN";
|
|
219
|
+
FailureReason2["NOT_SITE_COLLABORATOR"] = "NOT_SITE_COLLABORATOR";
|
|
220
|
+
return FailureReason2;
|
|
221
|
+
})(FailureReason || {});
|
|
222
|
+
var Type = /* @__PURE__ */ ((Type2) => {
|
|
223
|
+
Type2["TRANSACTIONAL"] = "TRANSACTIONAL";
|
|
224
|
+
Type2["MARKETING"] = "MARKETING";
|
|
225
|
+
return Type2;
|
|
226
|
+
})(Type || {});
|
|
227
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
|
228
|
+
Status2["ACCEPTED"] = "ACCEPTED";
|
|
229
|
+
Status2["IN_PROGRESS"] = "IN_PROGRESS";
|
|
230
|
+
Status2["PROCESSED"] = "PROCESSED";
|
|
231
|
+
Status2["REJECTED"] = "REJECTED";
|
|
232
|
+
return Status2;
|
|
233
|
+
})(Status || {});
|
|
234
|
+
var RejectionReason = /* @__PURE__ */ ((RejectionReason2) => {
|
|
235
|
+
RejectionReason2["BLACKLISTED_SENDER_EMAIL"] = "BLACKLISTED_SENDER_EMAIL";
|
|
236
|
+
RejectionReason2["BLACKLISTED_SENDER_NAME"] = "BLACKLISTED_SENDER_NAME";
|
|
237
|
+
RejectionReason2["BLACKLISTED_REPLY_TO_EMAIL"] = "BLACKLISTED_REPLY_TO_EMAIL";
|
|
238
|
+
RejectionReason2["BLACKLISTED_REPLY_TO_NAME"] = "BLACKLISTED_REPLY_TO_NAME";
|
|
239
|
+
RejectionReason2["BLACKLISTED_LINK"] = "BLACKLISTED_LINK";
|
|
240
|
+
RejectionReason2["BLACKLISTED_TEXT"] = "BLACKLISTED_TEXT";
|
|
241
|
+
return RejectionReason2;
|
|
242
|
+
})(RejectionReason || {});
|
|
243
|
+
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
244
|
+
SortOrder2["ASC"] = "ASC";
|
|
245
|
+
SortOrder2["DESC"] = "DESC";
|
|
246
|
+
return SortOrder2;
|
|
247
|
+
})(SortOrder || {});
|
|
248
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
249
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
250
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
251
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
252
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
253
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
254
|
+
return WebhookIdentityType2;
|
|
255
|
+
})(WebhookIdentityType || {});
|
|
256
|
+
async function sendEmailTransmission2(emailTransmission, options) {
|
|
257
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
258
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
259
|
+
emailTransmission,
|
|
260
|
+
idempotencyKey: options?.idempotencyKey
|
|
261
|
+
});
|
|
262
|
+
const reqOpts = sendEmailTransmission(
|
|
263
|
+
payload
|
|
264
|
+
);
|
|
265
|
+
sideEffects?.onSiteCall?.();
|
|
266
|
+
try {
|
|
267
|
+
const result = await httpClient.request(reqOpts);
|
|
268
|
+
sideEffects?.onSuccess?.(result);
|
|
269
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
270
|
+
} catch (err) {
|
|
271
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
272
|
+
err,
|
|
273
|
+
{
|
|
274
|
+
spreadPathsToArguments: {},
|
|
275
|
+
explicitPathsToArguments: {
|
|
276
|
+
emailTransmission: "$[0]",
|
|
277
|
+
idempotencyKey: "$[1].idempotencyKey"
|
|
278
|
+
},
|
|
279
|
+
singleArgumentUnchanged: false
|
|
280
|
+
},
|
|
281
|
+
["emailTransmission", "options"]
|
|
282
|
+
);
|
|
283
|
+
sideEffects?.onError?.(err);
|
|
284
|
+
throw transformedError;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
async function getEmailTransmission2(emailTransmissionId) {
|
|
288
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
289
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
290
|
+
emailTransmissionId
|
|
291
|
+
});
|
|
292
|
+
const reqOpts = getEmailTransmission(
|
|
293
|
+
payload
|
|
294
|
+
);
|
|
295
|
+
sideEffects?.onSiteCall?.();
|
|
296
|
+
try {
|
|
297
|
+
const result = await httpClient.request(reqOpts);
|
|
298
|
+
sideEffects?.onSuccess?.(result);
|
|
299
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.emailTransmission;
|
|
300
|
+
} catch (err) {
|
|
301
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
302
|
+
err,
|
|
303
|
+
{
|
|
304
|
+
spreadPathsToArguments: {},
|
|
305
|
+
explicitPathsToArguments: { emailTransmissionId: "$[0]" },
|
|
306
|
+
singleArgumentUnchanged: false
|
|
307
|
+
},
|
|
308
|
+
["emailTransmissionId"]
|
|
309
|
+
);
|
|
310
|
+
sideEffects?.onError?.(err);
|
|
311
|
+
throw transformedError;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function queryEmailTransmissions2() {
|
|
315
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
316
|
+
return (0, import_query_builder.queryBuilder)({
|
|
317
|
+
func: async (payload) => {
|
|
318
|
+
const reqOpts = queryEmailTransmissions(
|
|
319
|
+
payload
|
|
320
|
+
);
|
|
321
|
+
sideEffects?.onSiteCall?.();
|
|
322
|
+
try {
|
|
323
|
+
const result = await httpClient.request(reqOpts);
|
|
324
|
+
sideEffects?.onSuccess?.(result);
|
|
325
|
+
return result;
|
|
326
|
+
} catch (err) {
|
|
327
|
+
sideEffects?.onError?.(err);
|
|
328
|
+
throw err;
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
requestTransformer: (query) => {
|
|
332
|
+
const args = [query, {}];
|
|
333
|
+
return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
334
|
+
...args?.[1],
|
|
335
|
+
query: args?.[0]
|
|
336
|
+
});
|
|
337
|
+
},
|
|
338
|
+
responseTransformer: ({
|
|
339
|
+
data
|
|
340
|
+
}) => {
|
|
341
|
+
const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
342
|
+
(0, import_transform_paths2.transformPaths)(data, [])
|
|
343
|
+
);
|
|
344
|
+
return {
|
|
345
|
+
items: transformedData?.emailTransmissions,
|
|
346
|
+
pagingMetadata: transformedData?.pagingMetadata
|
|
347
|
+
};
|
|
348
|
+
},
|
|
349
|
+
errorTransformer: (err) => {
|
|
350
|
+
const transformedError = (0, import_transform_error.transformError)(err, {
|
|
351
|
+
spreadPathsToArguments: {},
|
|
352
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
353
|
+
singleArgumentUnchanged: false
|
|
354
|
+
});
|
|
355
|
+
throw transformedError;
|
|
356
|
+
},
|
|
357
|
+
pagingMethod: "CURSOR",
|
|
358
|
+
transformationPaths: {}
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
async function typedQueryEmailTransmissions(query) {
|
|
362
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
363
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
|
|
364
|
+
const reqOpts = queryEmailTransmissions(
|
|
365
|
+
payload
|
|
366
|
+
);
|
|
367
|
+
sideEffects?.onSiteCall?.();
|
|
368
|
+
try {
|
|
369
|
+
const result = await httpClient.request(reqOpts);
|
|
370
|
+
sideEffects?.onSuccess?.(result);
|
|
371
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
372
|
+
} catch (err) {
|
|
373
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
374
|
+
err,
|
|
375
|
+
{
|
|
376
|
+
spreadPathsToArguments: {},
|
|
377
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
378
|
+
singleArgumentUnchanged: false
|
|
379
|
+
},
|
|
380
|
+
["query"]
|
|
381
|
+
);
|
|
382
|
+
sideEffects?.onError?.(err);
|
|
383
|
+
throw transformedError;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
var utils = {
|
|
387
|
+
query: {
|
|
388
|
+
...(0, import_query_builder_utils.createQueryUtils)()
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
async function deleteEmailTransmission2(emailTransmissionId) {
|
|
392
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
393
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
394
|
+
emailTransmissionId
|
|
395
|
+
});
|
|
396
|
+
const reqOpts = deleteEmailTransmission(
|
|
397
|
+
payload
|
|
398
|
+
);
|
|
399
|
+
sideEffects?.onSiteCall?.();
|
|
400
|
+
try {
|
|
401
|
+
const result = await httpClient.request(reqOpts);
|
|
402
|
+
sideEffects?.onSuccess?.(result);
|
|
403
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
404
|
+
} catch (err) {
|
|
405
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
406
|
+
err,
|
|
407
|
+
{
|
|
408
|
+
spreadPathsToArguments: {},
|
|
409
|
+
explicitPathsToArguments: { emailTransmissionId: "$[0]" },
|
|
410
|
+
singleArgumentUnchanged: false
|
|
411
|
+
},
|
|
412
|
+
["emailTransmissionId"]
|
|
413
|
+
);
|
|
414
|
+
sideEffects?.onError?.(err);
|
|
415
|
+
throw transformedError;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// src/emails-transmissions-v1-email-transmission-email-transmissions.public.ts
|
|
420
|
+
function sendEmailTransmission3(httpClient) {
|
|
421
|
+
return (emailTransmission, options) => sendEmailTransmission2(
|
|
422
|
+
emailTransmission,
|
|
423
|
+
options,
|
|
424
|
+
// @ts-ignore
|
|
425
|
+
{ httpClient }
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
function getEmailTransmission3(httpClient) {
|
|
429
|
+
return (emailTransmissionId) => getEmailTransmission2(
|
|
430
|
+
emailTransmissionId,
|
|
431
|
+
// @ts-ignore
|
|
432
|
+
{ httpClient }
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
function queryEmailTransmissions3(httpClient) {
|
|
436
|
+
return () => queryEmailTransmissions2(
|
|
437
|
+
// @ts-ignore
|
|
438
|
+
{ httpClient }
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
function typedQueryEmailTransmissions2(httpClient) {
|
|
442
|
+
return (query) => typedQueryEmailTransmissions(
|
|
443
|
+
query,
|
|
444
|
+
// @ts-ignore
|
|
445
|
+
{ httpClient }
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
function deleteEmailTransmission3(httpClient) {
|
|
449
|
+
return (emailTransmissionId) => deleteEmailTransmission2(
|
|
450
|
+
emailTransmissionId,
|
|
451
|
+
// @ts-ignore
|
|
452
|
+
{ httpClient }
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// src/emails-transmissions-v1-email-transmission-email-transmissions.context.ts
|
|
457
|
+
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
458
|
+
var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
|
|
459
|
+
function customQueryEmailTransmissions(httpClient) {
|
|
460
|
+
const router = (0, import_query_method_router.createQueryOverloadRouter)({
|
|
461
|
+
builderQueryFunction: () => queryEmailTransmissions3(httpClient)(),
|
|
462
|
+
typedQueryFunction: (query) => typedQueryEmailTransmissions2(httpClient)(query),
|
|
463
|
+
hasOptionsParameter: false
|
|
464
|
+
});
|
|
465
|
+
function overloadedQuery(query) {
|
|
466
|
+
return router(...arguments);
|
|
467
|
+
}
|
|
468
|
+
return overloadedQuery;
|
|
469
|
+
}
|
|
470
|
+
var sendEmailTransmission4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(sendEmailTransmission3);
|
|
471
|
+
var getEmailTransmission4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getEmailTransmission3);
|
|
472
|
+
var deleteEmailTransmission4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteEmailTransmission3);
|
|
473
|
+
var queryEmailTransmissions4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryEmailTransmissions);
|
|
474
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
475
|
+
0 && (module.exports = {
|
|
476
|
+
FailureReason,
|
|
477
|
+
RejectionReason,
|
|
478
|
+
SortOrder,
|
|
479
|
+
Status,
|
|
480
|
+
Type,
|
|
481
|
+
WebhookIdentityType,
|
|
482
|
+
deleteEmailTransmission,
|
|
483
|
+
getEmailTransmission,
|
|
484
|
+
queryEmailTransmissions,
|
|
485
|
+
sendEmailTransmission,
|
|
486
|
+
utils
|
|
487
|
+
});
|
|
488
|
+
//# sourceMappingURL=index.js.map
|