@wix/auto_sdk_email-subscriptions_email-subscriptions 1.0.5 → 1.0.6
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 +71 -1
- package/build/cjs/index.js +482 -15
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +491 -1
- package/build/cjs/index.typings.js +408 -15
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +209 -1
- package/build/cjs/meta.js +334 -15
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +71 -0
- package/build/es/index.mjs +453 -0
- package/build/es/index.mjs.map +1 -0
- package/build/{internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.d.ts → es/index.typings.d.mts} +61 -91
- package/build/es/index.typings.mjs +380 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +209 -0
- package/build/es/meta.mjs +306 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +82 -1
- package/build/internal/cjs/index.js +482 -15
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +502 -1
- package/build/internal/cjs/index.typings.js +408 -15
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +209 -1
- package/build/internal/cjs/meta.js +334 -15
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +82 -0
- package/build/internal/es/index.mjs +453 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/{src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.d.ts → index.typings.d.mts} +62 -81
- package/build/internal/es/index.typings.mjs +380 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +209 -0
- package/build/internal/es/meta.mjs +306 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/package.json +12 -10
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.d.ts +0 -12
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js +0 -20
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js.map +0 -1
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.d.ts +0 -41
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js +0 -239
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js.map +0 -1
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.d.ts +0 -19
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js +0 -123
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js.map +0 -1
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.d.ts +0 -64
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js +0 -54
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js.map +0 -1
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.d.ts +0 -360
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js +0 -36
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js.map +0 -1
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.d.ts +0 -506
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js +0 -283
- package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.d.ts +0 -12
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js +0 -14
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js.map +0 -1
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.d.ts +0 -41
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js +0 -231
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js.map +0 -1
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.d.ts +0 -19
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js +0 -92
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js.map +0 -1
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.d.ts +0 -64
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js +0 -43
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js.map +0 -1
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.d.ts +0 -360
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js +0 -33
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js.map +0 -1
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.d.ts +0 -506
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js +0 -252
- package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js.map +0 -1
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.d.ts +0 -14
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js +0 -20
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js.map +0 -1
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.d.ts +0 -41
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js +0 -239
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js.map +0 -1
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.d.ts +0 -19
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js +0 -123
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js.map +0 -1
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.d.ts +0 -73
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js +0 -54
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js.map +0 -1
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.d.ts +0 -360
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js +0 -36
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js.map +0 -1
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js +0 -283
- package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.d.ts +0 -14
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js +0 -14
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js.map +0 -1
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.d.ts +0 -41
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js +0 -231
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js.map +0 -1
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.d.ts +0 -19
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js +0 -92
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js.map +0 -1
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.d.ts +0 -73
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js +0 -43
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js.map +0 -1
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.d.ts +0 -360
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js +0 -33
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js.map +0 -1
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js +0 -252
- package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js.map +0 -1
package/build/cjs/index.d.ts
CHANGED
@@ -1 +1,71 @@
|
|
1
|
-
|
1
|
+
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
2
|
+
import { QueryEmailSubscriptionsOptions, QueryEmailSubscriptionsResponse, UpsertEmailSubscriptionOptions, UpsertEmailSubscriptionResponse, EmailSubscription, BulkUpsertEmailSubscriptionResponse, GenerateUnsubscribeLinkOptions, GenerateUnsubscribeLinkResponse, EmailsubscriptionEmailSubscriptionChangedEnvelope } from './index.typings.js';
|
3
|
+
export { ActionEvent, BaseEventMetadata, BulkUpsertEmailSubscriptionRequest, BulkUpsertEmailSubscriptionResult, ConfirmUnsubscribeActionRequest, DomainEvent, DomainEventBodyOneOf, EmailSubscriptionChanged, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, Error, GenerateUnsubscribeLinkRequest, GetEmailSubscriptionRequest, GetEmailSubscriptionResponse, HeadersEntry, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, Metadata, Paging, PagingMetadata, QueryEmailSubscriptionsRequest, RawHttpResponse, RenderUnsubscribePageRequest, RestoreInfo, Status, StatusWithLiterals, SubscriptionEnumStatus, SubscriptionEnumStatusWithLiterals, UpdateEmailSubscriptionRequest, UpdateEmailSubscriptionResponse, UpsertEmailSubscriptionRequest, V1ConfirmUnsubscribeActionRequest, V1RenderUnsubscribePageRequest, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
|
4
|
+
|
5
|
+
declare function queryEmailSubscriptions$1(httpClient: HttpClient): QueryEmailSubscriptionsSignature;
|
6
|
+
interface QueryEmailSubscriptionsSignature {
|
7
|
+
/**
|
8
|
+
* Retrieves email subscriptions,
|
9
|
+
* given the provided paging, filtering, and sorting.
|
10
|
+
*
|
11
|
+
* Currently, querying is supported on the `email` field
|
12
|
+
* with the `$in` array filter.
|
13
|
+
* For example, to query for emails `"me@my.com"` and `"you@your.org"`,
|
14
|
+
* the filter should be formed like this:
|
15
|
+
*
|
16
|
+
* ```json
|
17
|
+
* { "filter": {
|
18
|
+
* "email": {
|
19
|
+
* "$in": ["me@my.com", "you@your.org"]
|
20
|
+
* }
|
21
|
+
* }
|
22
|
+
* }
|
23
|
+
* ```
|
24
|
+
*
|
25
|
+
* To learn how to query email subscriptions, see
|
26
|
+
* [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
27
|
+
* @param - Filter options.
|
28
|
+
* Currently, querying is supported on the `email` field
|
29
|
+
* with the `$in` array filter.
|
30
|
+
*/
|
31
|
+
(filter: Record<string, any>, options?: QueryEmailSubscriptionsOptions): Promise<NonNullablePaths<QueryEmailSubscriptionsResponse, `subscriptions` | `subscriptions.${number}.email` | `subscriptions.${number}.subscriptionStatus` | `subscriptions.${number}.deliverabilityStatus`, 4>>;
|
32
|
+
}
|
33
|
+
declare function upsertEmailSubscription$1(httpClient: HttpClient): UpsertEmailSubscriptionSignature;
|
34
|
+
interface UpsertEmailSubscriptionSignature {
|
35
|
+
/**
|
36
|
+
* Updates or creates an email subscription for the requested email.
|
37
|
+
*
|
38
|
+
* An email subscription is returned in the response
|
39
|
+
* whether it was updated or created.
|
40
|
+
*/
|
41
|
+
(options?: NonNullablePaths<UpsertEmailSubscriptionOptions, `subscription.email`, 3>): Promise<NonNullablePaths<UpsertEmailSubscriptionResponse, `subscription.email` | `subscription.subscriptionStatus` | `subscription.deliverabilityStatus`, 3>>;
|
42
|
+
}
|
43
|
+
declare function bulkUpsertEmailSubscription$1(httpClient: HttpClient): BulkUpsertEmailSubscriptionSignature;
|
44
|
+
interface BulkUpsertEmailSubscriptionSignature {
|
45
|
+
/**
|
46
|
+
* Updates or creates multiple email subscriptions.
|
47
|
+
* @param - List of email subscriptions to update or create.
|
48
|
+
*/
|
49
|
+
(subscriptions: EmailSubscription[]): Promise<NonNullablePaths<BulkUpsertEmailSubscriptionResponse, `results` | `results.${number}.originalIndex` | `results.${number}.emailSubscription.email` | `results.${number}.emailSubscription.subscriptionStatus` | `results.${number}.emailSubscription.deliverabilityStatus` | `results.${number}.error.errorCode` | `results.${number}.error.message` | `metadata.totalSuccess` | `metadata.totalFailure`, 5>>;
|
50
|
+
}
|
51
|
+
declare function generateUnsubscribeLink$1(httpClient: HttpClient): GenerateUnsubscribeLinkSignature;
|
52
|
+
interface GenerateUnsubscribeLinkSignature {
|
53
|
+
/**
|
54
|
+
* Creates an unsubscribe link to be shared with the relevant recipient.
|
55
|
+
*
|
56
|
+
* If someone clicks the **Unsubscribe** button on the confirmation page,
|
57
|
+
* the recipient's `subscriptionStatus` is changed to `UNSUBSCRIBED`.
|
58
|
+
* @param - Email address the unsubscribe link is for.
|
59
|
+
*/
|
60
|
+
(emailAddress: string, options?: GenerateUnsubscribeLinkOptions): Promise<NonNullablePaths<GenerateUnsubscribeLinkResponse, `link`, 2>>;
|
61
|
+
}
|
62
|
+
declare const onEmailsubscriptionEmailSubscriptionChanged$1: EventDefinition<EmailsubscriptionEmailSubscriptionChangedEnvelope, "com.wixpress.emailsubscriptions.v1.EmailSubscriptionChanged">;
|
63
|
+
|
64
|
+
declare const queryEmailSubscriptions: MaybeContext<BuildRESTFunction<typeof queryEmailSubscriptions$1> & typeof queryEmailSubscriptions$1>;
|
65
|
+
declare const upsertEmailSubscription: MaybeContext<BuildRESTFunction<typeof upsertEmailSubscription$1> & typeof upsertEmailSubscription$1>;
|
66
|
+
declare const bulkUpsertEmailSubscription: MaybeContext<BuildRESTFunction<typeof bulkUpsertEmailSubscription$1> & typeof bulkUpsertEmailSubscription$1>;
|
67
|
+
declare const generateUnsubscribeLink: MaybeContext<BuildRESTFunction<typeof generateUnsubscribeLink$1> & typeof generateUnsubscribeLink$1>;
|
68
|
+
/** */
|
69
|
+
declare const onEmailsubscriptionEmailSubscriptionChanged: BuildEventDefinition<typeof onEmailsubscriptionEmailSubscriptionChanged$1> & typeof onEmailsubscriptionEmailSubscriptionChanged$1;
|
70
|
+
|
71
|
+
export { BulkUpsertEmailSubscriptionResponse, EmailSubscription, EmailsubscriptionEmailSubscriptionChangedEnvelope, GenerateUnsubscribeLinkOptions, GenerateUnsubscribeLinkResponse, QueryEmailSubscriptionsOptions, QueryEmailSubscriptionsResponse, UpsertEmailSubscriptionOptions, UpsertEmailSubscriptionResponse, bulkUpsertEmailSubscription, generateUnsubscribeLink, onEmailsubscriptionEmailSubscriptionChanged, queryEmailSubscriptions, upsertEmailSubscription };
|
package/build/cjs/index.js
CHANGED
@@ -1,18 +1,485 @@
|
|
1
1
|
"use strict";
|
2
|
-
var
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
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 });
|
15
9
|
};
|
16
|
-
|
17
|
-
|
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
|
+
Status: () => Status,
|
24
|
+
SubscriptionEnumStatus: () => SubscriptionEnumStatus,
|
25
|
+
WebhookIdentityType: () => WebhookIdentityType,
|
26
|
+
bulkUpsertEmailSubscription: () => bulkUpsertEmailSubscription4,
|
27
|
+
generateUnsubscribeLink: () => generateUnsubscribeLink4,
|
28
|
+
getEmailSubscription: () => getEmailSubscription4,
|
29
|
+
onEmailsubscriptionEmailSubscriptionChanged: () => onEmailsubscriptionEmailSubscriptionChanged2,
|
30
|
+
queryEmailSubscriptions: () => queryEmailSubscriptions4,
|
31
|
+
upsertEmailSubscription: () => upsertEmailSubscription4
|
32
|
+
});
|
33
|
+
module.exports = __toCommonJS(index_exports);
|
34
|
+
|
35
|
+
// src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.ts
|
36
|
+
var import_rename_all_nested_keys2 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
37
|
+
var import_timestamp3 = require("@wix/sdk-runtime/transformations/timestamp");
|
38
|
+
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
39
|
+
var import_sdk_types = require("@wix/sdk-types");
|
40
|
+
|
41
|
+
// src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.ts
|
42
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
43
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
44
|
+
|
45
|
+
// src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.ts
|
46
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
47
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
48
|
+
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
49
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
50
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
51
|
+
function resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl(opts) {
|
52
|
+
const domainToMappings = {
|
53
|
+
"editor._base_domain_": [
|
54
|
+
{
|
55
|
+
srcPath: "/_api/email-marketing/v1/email-subscriptions",
|
56
|
+
destPath: "/v1/email-subscriptions"
|
57
|
+
}
|
58
|
+
],
|
59
|
+
"blocks._base_domain_": [
|
60
|
+
{
|
61
|
+
srcPath: "/_api/email-marketing/v1/email-subscriptions",
|
62
|
+
destPath: "/v1/email-subscriptions"
|
63
|
+
}
|
64
|
+
],
|
65
|
+
"create.editorx": [
|
66
|
+
{
|
67
|
+
srcPath: "/_api/email-marketing/v1/email-subscriptions",
|
68
|
+
destPath: "/v1/email-subscriptions"
|
69
|
+
}
|
70
|
+
],
|
71
|
+
"manage._base_domain_": [
|
72
|
+
{
|
73
|
+
srcPath: "/_api/email-marketing/v1/email-subscriptions",
|
74
|
+
destPath: "/v1/email-subscriptions"
|
75
|
+
}
|
76
|
+
],
|
77
|
+
"www._base_domain_": [
|
78
|
+
{
|
79
|
+
srcPath: "/_api/email-marketing/v1/email-subscriptions",
|
80
|
+
destPath: "/v1/email-subscriptions"
|
81
|
+
}
|
82
|
+
],
|
83
|
+
"www.wixapis.com": [
|
84
|
+
{
|
85
|
+
srcPath: "/email-marketing/v1/email-subscriptions",
|
86
|
+
destPath: "/v1/email-subscriptions"
|
87
|
+
},
|
88
|
+
{
|
89
|
+
srcPath: "/email-marketing/v1/email-subscriptions/unsubscribe-link",
|
90
|
+
destPath: "/v1/email-subscriptions/unsubscribe-link"
|
91
|
+
}
|
92
|
+
]
|
93
|
+
};
|
94
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
95
|
+
}
|
96
|
+
var PACKAGE_NAME = "@wix/auto_sdk_email-subscriptions_email-subscriptions";
|
97
|
+
function getEmailSubscription(payload) {
|
98
|
+
function __getEmailSubscription({ host }) {
|
99
|
+
const metadata = {
|
100
|
+
entityFqdn: "wix.emailsubscriptions.v1.emailsubscription",
|
101
|
+
method: "GET",
|
102
|
+
methodFqn: "com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.GetEmailSubscription",
|
103
|
+
packageName: PACKAGE_NAME,
|
104
|
+
url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({
|
105
|
+
protoPath: "/v1/email-subscriptions/{id}",
|
106
|
+
data: payload,
|
107
|
+
host
|
108
|
+
}),
|
109
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
110
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
111
|
+
{
|
112
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
113
|
+
paths: [
|
114
|
+
{ path: "emailSubscription.createdDate" },
|
115
|
+
{ path: "emailSubscription.updatedDate" }
|
116
|
+
]
|
117
|
+
}
|
118
|
+
])
|
119
|
+
};
|
120
|
+
return metadata;
|
121
|
+
}
|
122
|
+
return __getEmailSubscription;
|
123
|
+
}
|
124
|
+
function queryEmailSubscriptions(payload) {
|
125
|
+
function __queryEmailSubscriptions({ host }) {
|
126
|
+
const metadata = {
|
127
|
+
entityFqdn: "wix.emailsubscriptions.v1.emailsubscription",
|
128
|
+
method: "POST",
|
129
|
+
methodFqn: "com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.QueryEmailSubscriptions",
|
130
|
+
packageName: PACKAGE_NAME,
|
131
|
+
url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({
|
132
|
+
protoPath: "/v1/email-subscriptions/query",
|
133
|
+
data: payload,
|
134
|
+
host
|
135
|
+
}),
|
136
|
+
data: payload,
|
137
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
138
|
+
{
|
139
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
140
|
+
paths: [
|
141
|
+
{ path: "subscriptions.createdDate" },
|
142
|
+
{ path: "subscriptions.updatedDate" }
|
143
|
+
]
|
144
|
+
}
|
145
|
+
])
|
146
|
+
};
|
147
|
+
return metadata;
|
148
|
+
}
|
149
|
+
return __queryEmailSubscriptions;
|
150
|
+
}
|
151
|
+
function upsertEmailSubscription(payload) {
|
152
|
+
function __upsertEmailSubscription({ host }) {
|
153
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
154
|
+
{
|
155
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
156
|
+
paths: [
|
157
|
+
{ path: "subscription.createdDate" },
|
158
|
+
{ path: "subscription.updatedDate" }
|
159
|
+
]
|
160
|
+
}
|
161
|
+
]);
|
162
|
+
const metadata = {
|
163
|
+
entityFqdn: "wix.emailsubscriptions.v1.emailsubscription",
|
164
|
+
method: "POST",
|
165
|
+
methodFqn: "com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.UpsertEmailSubscription",
|
166
|
+
packageName: PACKAGE_NAME,
|
167
|
+
url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({
|
168
|
+
protoPath: "/v1/email-subscriptions",
|
169
|
+
data: serializedData,
|
170
|
+
host
|
171
|
+
}),
|
172
|
+
data: serializedData,
|
173
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
174
|
+
{
|
175
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
176
|
+
paths: [
|
177
|
+
{ path: "subscription.createdDate" },
|
178
|
+
{ path: "subscription.updatedDate" }
|
179
|
+
]
|
180
|
+
}
|
181
|
+
])
|
182
|
+
};
|
183
|
+
return metadata;
|
184
|
+
}
|
185
|
+
return __upsertEmailSubscription;
|
186
|
+
}
|
187
|
+
function bulkUpsertEmailSubscription(payload) {
|
188
|
+
function __bulkUpsertEmailSubscription({ host }) {
|
189
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
190
|
+
{
|
191
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
192
|
+
paths: [
|
193
|
+
{ path: "subscriptions.createdDate" },
|
194
|
+
{ path: "subscriptions.updatedDate" }
|
195
|
+
]
|
196
|
+
}
|
197
|
+
]);
|
198
|
+
const metadata = {
|
199
|
+
entityFqdn: "wix.emailsubscriptions.v1.emailsubscription",
|
200
|
+
method: "POST",
|
201
|
+
methodFqn: "com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.BulkUpsertEmailSubscription",
|
202
|
+
packageName: PACKAGE_NAME,
|
203
|
+
url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({
|
204
|
+
protoPath: "/v1/email-subscriptions/bulk",
|
205
|
+
data: serializedData,
|
206
|
+
host
|
207
|
+
}),
|
208
|
+
data: serializedData,
|
209
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
210
|
+
{
|
211
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
212
|
+
paths: [
|
213
|
+
{ path: "results.emailSubscription.createdDate" },
|
214
|
+
{ path: "results.emailSubscription.updatedDate" }
|
215
|
+
]
|
216
|
+
}
|
217
|
+
])
|
218
|
+
};
|
219
|
+
return metadata;
|
220
|
+
}
|
221
|
+
return __bulkUpsertEmailSubscription;
|
222
|
+
}
|
223
|
+
function generateUnsubscribeLink(payload) {
|
224
|
+
function __generateUnsubscribeLink({ host }) {
|
225
|
+
const metadata = {
|
226
|
+
entityFqdn: "wix.emailsubscriptions.v1.emailsubscription",
|
227
|
+
method: "POST",
|
228
|
+
methodFqn: "com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.GenerateUnsubscribeLink",
|
229
|
+
packageName: PACKAGE_NAME,
|
230
|
+
url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({
|
231
|
+
protoPath: "/v1/email-subscriptions/unsubscribe-link",
|
232
|
+
data: payload,
|
233
|
+
host
|
234
|
+
}),
|
235
|
+
data: payload
|
236
|
+
};
|
237
|
+
return metadata;
|
238
|
+
}
|
239
|
+
return __generateUnsubscribeLink;
|
240
|
+
}
|
241
|
+
|
242
|
+
// src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.ts
|
243
|
+
var SubscriptionEnumStatus = /* @__PURE__ */ ((SubscriptionEnumStatus2) => {
|
244
|
+
SubscriptionEnumStatus2["UNKNOWN"] = "UNKNOWN";
|
245
|
+
SubscriptionEnumStatus2["NOT_SET"] = "NOT_SET";
|
246
|
+
SubscriptionEnumStatus2["PENDING"] = "PENDING";
|
247
|
+
SubscriptionEnumStatus2["SUBSCRIBED"] = "SUBSCRIBED";
|
248
|
+
SubscriptionEnumStatus2["UNSUBSCRIBED"] = "UNSUBSCRIBED";
|
249
|
+
return SubscriptionEnumStatus2;
|
250
|
+
})(SubscriptionEnumStatus || {});
|
251
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
252
|
+
Status2["NOT_SET"] = "NOT_SET";
|
253
|
+
Status2["VALID"] = "VALID";
|
254
|
+
Status2["BOUNCED"] = "BOUNCED";
|
255
|
+
Status2["SPAM_COMPLAINT"] = "SPAM_COMPLAINT";
|
256
|
+
Status2["INACTIVE"] = "INACTIVE";
|
257
|
+
return Status2;
|
258
|
+
})(Status || {});
|
259
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
260
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
261
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
262
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
263
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
264
|
+
WebhookIdentityType2["APP"] = "APP";
|
265
|
+
return WebhookIdentityType2;
|
266
|
+
})(WebhookIdentityType || {});
|
267
|
+
async function getEmailSubscription2(_id) {
|
268
|
+
const { httpClient, sideEffects } = arguments[1];
|
269
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
270
|
+
const reqOpts = getEmailSubscription(
|
271
|
+
payload
|
272
|
+
);
|
273
|
+
sideEffects?.onSiteCall?.();
|
274
|
+
try {
|
275
|
+
const result = await httpClient.request(reqOpts);
|
276
|
+
sideEffects?.onSuccess?.(result);
|
277
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.emailSubscription;
|
278
|
+
} catch (err) {
|
279
|
+
const transformedError = (0, import_transform_error.transformError)(
|
280
|
+
err,
|
281
|
+
{
|
282
|
+
spreadPathsToArguments: {},
|
283
|
+
explicitPathsToArguments: { id: "$[0]" },
|
284
|
+
singleArgumentUnchanged: false
|
285
|
+
},
|
286
|
+
["_id"]
|
287
|
+
);
|
288
|
+
sideEffects?.onError?.(err);
|
289
|
+
throw transformedError;
|
290
|
+
}
|
291
|
+
}
|
292
|
+
async function queryEmailSubscriptions2(filter, options) {
|
293
|
+
const { httpClient, sideEffects } = arguments[2];
|
294
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
295
|
+
filter,
|
296
|
+
paging: options?.paging
|
297
|
+
});
|
298
|
+
const reqOpts = queryEmailSubscriptions(
|
299
|
+
payload
|
300
|
+
);
|
301
|
+
sideEffects?.onSiteCall?.();
|
302
|
+
try {
|
303
|
+
const result = await httpClient.request(reqOpts);
|
304
|
+
sideEffects?.onSuccess?.(result);
|
305
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
306
|
+
} catch (err) {
|
307
|
+
const transformedError = (0, import_transform_error.transformError)(
|
308
|
+
err,
|
309
|
+
{
|
310
|
+
spreadPathsToArguments: {},
|
311
|
+
explicitPathsToArguments: { filter: "$[0]", paging: "$[1].paging" },
|
312
|
+
singleArgumentUnchanged: false
|
313
|
+
},
|
314
|
+
["filter", "options"]
|
315
|
+
);
|
316
|
+
sideEffects?.onError?.(err);
|
317
|
+
throw transformedError;
|
318
|
+
}
|
319
|
+
}
|
320
|
+
async function upsertEmailSubscription2(options) {
|
321
|
+
const { httpClient, sideEffects } = arguments[1];
|
322
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
323
|
+
subscription: options?.subscription
|
324
|
+
});
|
325
|
+
const reqOpts = upsertEmailSubscription(
|
326
|
+
payload
|
327
|
+
);
|
328
|
+
sideEffects?.onSiteCall?.();
|
329
|
+
try {
|
330
|
+
const result = await httpClient.request(reqOpts);
|
331
|
+
sideEffects?.onSuccess?.(result);
|
332
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
333
|
+
} catch (err) {
|
334
|
+
const transformedError = (0, import_transform_error.transformError)(
|
335
|
+
err,
|
336
|
+
{
|
337
|
+
spreadPathsToArguments: {},
|
338
|
+
explicitPathsToArguments: { subscription: "$[0].subscription" },
|
339
|
+
singleArgumentUnchanged: false
|
340
|
+
},
|
341
|
+
["options"]
|
342
|
+
);
|
343
|
+
sideEffects?.onError?.(err);
|
344
|
+
throw transformedError;
|
345
|
+
}
|
346
|
+
}
|
347
|
+
async function bulkUpsertEmailSubscription2(subscriptions) {
|
348
|
+
const { httpClient, sideEffects } = arguments[1];
|
349
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
350
|
+
subscriptions
|
351
|
+
});
|
352
|
+
const reqOpts = bulkUpsertEmailSubscription(
|
353
|
+
payload
|
354
|
+
);
|
355
|
+
sideEffects?.onSiteCall?.();
|
356
|
+
try {
|
357
|
+
const result = await httpClient.request(reqOpts);
|
358
|
+
sideEffects?.onSuccess?.(result);
|
359
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
360
|
+
} catch (err) {
|
361
|
+
const transformedError = (0, import_transform_error.transformError)(
|
362
|
+
err,
|
363
|
+
{
|
364
|
+
spreadPathsToArguments: {},
|
365
|
+
explicitPathsToArguments: { subscriptions: "$[0]" },
|
366
|
+
singleArgumentUnchanged: false
|
367
|
+
},
|
368
|
+
["subscriptions"]
|
369
|
+
);
|
370
|
+
sideEffects?.onError?.(err);
|
371
|
+
throw transformedError;
|
372
|
+
}
|
373
|
+
}
|
374
|
+
async function generateUnsubscribeLink2(emailAddress, options) {
|
375
|
+
const { httpClient, sideEffects } = arguments[2];
|
376
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
377
|
+
emailAddress,
|
378
|
+
metadata: options?.metadata,
|
379
|
+
language: options?.language
|
380
|
+
});
|
381
|
+
const reqOpts = generateUnsubscribeLink(
|
382
|
+
payload
|
383
|
+
);
|
384
|
+
sideEffects?.onSiteCall?.();
|
385
|
+
try {
|
386
|
+
const result = await httpClient.request(reqOpts);
|
387
|
+
sideEffects?.onSuccess?.(result);
|
388
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
389
|
+
} catch (err) {
|
390
|
+
const transformedError = (0, import_transform_error.transformError)(
|
391
|
+
err,
|
392
|
+
{
|
393
|
+
spreadPathsToArguments: {},
|
394
|
+
explicitPathsToArguments: {
|
395
|
+
emailAddress: "$[0]",
|
396
|
+
metadata: "$[1].metadata",
|
397
|
+
language: "$[1].language"
|
398
|
+
},
|
399
|
+
singleArgumentUnchanged: false
|
400
|
+
},
|
401
|
+
["emailAddress", "options"]
|
402
|
+
);
|
403
|
+
sideEffects?.onError?.(err);
|
404
|
+
throw transformedError;
|
405
|
+
}
|
406
|
+
}
|
407
|
+
|
408
|
+
// src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.ts
|
409
|
+
function getEmailSubscription3(httpClient) {
|
410
|
+
return (_id) => getEmailSubscription2(
|
411
|
+
_id,
|
412
|
+
// @ts-ignore
|
413
|
+
{ httpClient }
|
414
|
+
);
|
415
|
+
}
|
416
|
+
function queryEmailSubscriptions3(httpClient) {
|
417
|
+
return (filter, options) => queryEmailSubscriptions2(
|
418
|
+
filter,
|
419
|
+
options,
|
420
|
+
// @ts-ignore
|
421
|
+
{ httpClient }
|
422
|
+
);
|
423
|
+
}
|
424
|
+
function upsertEmailSubscription3(httpClient) {
|
425
|
+
return (options) => upsertEmailSubscription2(
|
426
|
+
options,
|
427
|
+
// @ts-ignore
|
428
|
+
{ httpClient }
|
429
|
+
);
|
430
|
+
}
|
431
|
+
function bulkUpsertEmailSubscription3(httpClient) {
|
432
|
+
return (subscriptions) => bulkUpsertEmailSubscription2(
|
433
|
+
subscriptions,
|
434
|
+
// @ts-ignore
|
435
|
+
{ httpClient }
|
436
|
+
);
|
437
|
+
}
|
438
|
+
function generateUnsubscribeLink3(httpClient) {
|
439
|
+
return (emailAddress, options) => generateUnsubscribeLink2(
|
440
|
+
emailAddress,
|
441
|
+
options,
|
442
|
+
// @ts-ignore
|
443
|
+
{ httpClient }
|
444
|
+
);
|
445
|
+
}
|
446
|
+
var onEmailsubscriptionEmailSubscriptionChanged = (0, import_sdk_types.EventDefinition)(
|
447
|
+
"com.wixpress.emailsubscriptions.v1.EmailSubscriptionChanged",
|
448
|
+
false,
|
449
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
450
|
+
(0, import_transform_paths2.transformPaths)(event, [
|
451
|
+
{
|
452
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
453
|
+
paths: [
|
454
|
+
{ path: "data.subscription.createdDate" },
|
455
|
+
{ path: "data.subscription.updatedDate" }
|
456
|
+
]
|
457
|
+
}
|
458
|
+
])
|
459
|
+
)
|
460
|
+
)();
|
461
|
+
|
462
|
+
// src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.ts
|
463
|
+
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
464
|
+
var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
|
465
|
+
var getEmailSubscription4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getEmailSubscription3);
|
466
|
+
var queryEmailSubscriptions4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryEmailSubscriptions3);
|
467
|
+
var upsertEmailSubscription4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(upsertEmailSubscription3);
|
468
|
+
var bulkUpsertEmailSubscription4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkUpsertEmailSubscription3);
|
469
|
+
var generateUnsubscribeLink4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(generateUnsubscribeLink3);
|
470
|
+
var onEmailsubscriptionEmailSubscriptionChanged2 = (0, import_event_definition_modules.createEventModule)(
|
471
|
+
onEmailsubscriptionEmailSubscriptionChanged
|
472
|
+
);
|
473
|
+
// Annotate the CommonJS export names for ESM import in node:
|
474
|
+
0 && (module.exports = {
|
475
|
+
Status,
|
476
|
+
SubscriptionEnumStatus,
|
477
|
+
WebhookIdentityType,
|
478
|
+
bulkUpsertEmailSubscription,
|
479
|
+
generateUnsubscribeLink,
|
480
|
+
getEmailSubscription,
|
481
|
+
onEmailsubscriptionEmailSubscriptionChanged,
|
482
|
+
queryEmailSubscriptions,
|
483
|
+
upsertEmailSubscription
|
484
|
+
});
|
18
485
|
//# sourceMappingURL=index.js.map
|