@wix/auto_sdk_email-subscriptions_email-subscriptions 1.0.4 → 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.
Files changed (125) hide show
  1. package/build/cjs/index.d.ts +71 -1
  2. package/build/cjs/index.js +482 -15
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +491 -1
  5. package/build/cjs/index.typings.js +408 -15
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +209 -1
  8. package/build/cjs/meta.js +334 -15
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +71 -0
  11. package/build/es/index.mjs +453 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/{internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.d.ts → es/index.typings.d.mts} +74 -126
  14. package/build/es/index.typings.mjs +380 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/meta.d.mts +209 -0
  17. package/build/es/meta.mjs +306 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/internal/cjs/index.d.ts +82 -1
  20. package/build/internal/cjs/index.js +482 -15
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +502 -1
  23. package/build/internal/cjs/index.typings.js +408 -15
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +209 -1
  26. package/build/internal/cjs/meta.js +334 -15
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +82 -0
  29. package/build/internal/es/index.mjs +453 -0
  30. package/build/internal/es/index.mjs.map +1 -0
  31. package/build/internal/es/{src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.d.ts → index.typings.d.mts} +75 -116
  32. package/build/internal/es/index.typings.mjs +380 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -0
  34. package/build/internal/es/meta.d.mts +209 -0
  35. package/build/internal/es/meta.mjs +306 -0
  36. package/build/internal/es/meta.mjs.map +1 -0
  37. package/package.json +12 -10
  38. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.d.ts +0 -12
  39. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js +0 -20
  40. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js.map +0 -1
  41. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.d.ts +0 -41
  42. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js +0 -239
  43. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js.map +0 -1
  44. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.d.ts +0 -19
  45. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js +0 -123
  46. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js.map +0 -1
  47. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.d.ts +0 -64
  48. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js +0 -54
  49. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js.map +0 -1
  50. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.d.ts +0 -403
  51. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js +0 -36
  52. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js.map +0 -1
  53. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.d.ts +0 -530
  54. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js +0 -273
  55. package/build/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.d.ts +0 -12
  66. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js +0 -14
  67. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js.map +0 -1
  68. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.d.ts +0 -41
  69. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js +0 -231
  70. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js.map +0 -1
  71. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.d.ts +0 -19
  72. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js +0 -92
  73. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js.map +0 -1
  74. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.d.ts +0 -64
  75. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js +0 -43
  76. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js.map +0 -1
  77. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.d.ts +0 -403
  78. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js +0 -33
  79. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js.map +0 -1
  80. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.d.ts +0 -530
  81. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js +0 -242
  82. package/build/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js.map +0 -1
  83. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.d.ts +0 -14
  84. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js +0 -20
  85. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js.map +0 -1
  86. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.d.ts +0 -41
  87. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js +0 -239
  88. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js.map +0 -1
  89. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.d.ts +0 -19
  90. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js +0 -123
  91. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js.map +0 -1
  92. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.d.ts +0 -73
  93. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js +0 -54
  94. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js.map +0 -1
  95. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.d.ts +0 -403
  96. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js +0 -36
  97. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js.map +0 -1
  98. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js +0 -273
  99. package/build/internal/cjs/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js.map +0 -1
  100. package/build/internal/es/index.d.ts +0 -1
  101. package/build/internal/es/index.js +0 -2
  102. package/build/internal/es/index.js.map +0 -1
  103. package/build/internal/es/index.typings.d.ts +0 -1
  104. package/build/internal/es/index.typings.js +0 -2
  105. package/build/internal/es/index.typings.js.map +0 -1
  106. package/build/internal/es/meta.d.ts +0 -1
  107. package/build/internal/es/meta.js +0 -2
  108. package/build/internal/es/meta.js.map +0 -1
  109. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.d.ts +0 -14
  110. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js +0 -14
  111. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js.map +0 -1
  112. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.d.ts +0 -41
  113. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js +0 -231
  114. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js.map +0 -1
  115. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.d.ts +0 -19
  116. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js +0 -92
  117. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.js.map +0 -1
  118. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.d.ts +0 -73
  119. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js +0 -43
  120. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.public.js.map +0 -1
  121. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.d.ts +0 -403
  122. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js +0 -33
  123. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js.map +0 -1
  124. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js +0 -242
  125. package/build/internal/es/src/emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js.map +0 -1
@@ -0,0 +1,306 @@
1
+ // src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.ts
2
+ import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
3
+ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
4
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
5
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
6
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
7
+ function resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl(opts) {
8
+ const domainToMappings = {
9
+ "editor._base_domain_": [
10
+ {
11
+ srcPath: "/_api/email-marketing/v1/email-subscriptions",
12
+ destPath: "/v1/email-subscriptions"
13
+ }
14
+ ],
15
+ "blocks._base_domain_": [
16
+ {
17
+ srcPath: "/_api/email-marketing/v1/email-subscriptions",
18
+ destPath: "/v1/email-subscriptions"
19
+ }
20
+ ],
21
+ "create.editorx": [
22
+ {
23
+ srcPath: "/_api/email-marketing/v1/email-subscriptions",
24
+ destPath: "/v1/email-subscriptions"
25
+ }
26
+ ],
27
+ "manage._base_domain_": [
28
+ {
29
+ srcPath: "/_api/email-marketing/v1/email-subscriptions",
30
+ destPath: "/v1/email-subscriptions"
31
+ }
32
+ ],
33
+ "www._base_domain_": [
34
+ {
35
+ srcPath: "/_api/email-marketing/v1/email-subscriptions",
36
+ destPath: "/v1/email-subscriptions"
37
+ }
38
+ ],
39
+ "www.wixapis.com": [
40
+ {
41
+ srcPath: "/email-marketing/v1/email-subscriptions",
42
+ destPath: "/v1/email-subscriptions"
43
+ },
44
+ {
45
+ srcPath: "/email-marketing/v1/email-subscriptions/unsubscribe-link",
46
+ destPath: "/v1/email-subscriptions/unsubscribe-link"
47
+ }
48
+ ]
49
+ };
50
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
51
+ }
52
+ var PACKAGE_NAME = "@wix/auto_sdk_email-subscriptions_email-subscriptions";
53
+ function getEmailSubscription(payload) {
54
+ function __getEmailSubscription({ host }) {
55
+ const metadata = {
56
+ entityFqdn: "wix.emailsubscriptions.v1.emailsubscription",
57
+ method: "GET",
58
+ methodFqn: "com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.GetEmailSubscription",
59
+ packageName: PACKAGE_NAME,
60
+ url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({
61
+ protoPath: "/v1/email-subscriptions/{id}",
62
+ data: payload,
63
+ host
64
+ }),
65
+ params: toURLSearchParams(payload),
66
+ transformResponse: (payload2) => transformPaths(payload2, [
67
+ {
68
+ transformFn: transformRESTTimestampToSDKTimestamp,
69
+ paths: [
70
+ { path: "emailSubscription.createdDate" },
71
+ { path: "emailSubscription.updatedDate" }
72
+ ]
73
+ }
74
+ ])
75
+ };
76
+ return metadata;
77
+ }
78
+ return __getEmailSubscription;
79
+ }
80
+ function queryEmailSubscriptions(payload) {
81
+ function __queryEmailSubscriptions({ host }) {
82
+ const metadata = {
83
+ entityFqdn: "wix.emailsubscriptions.v1.emailsubscription",
84
+ method: "POST",
85
+ methodFqn: "com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.QueryEmailSubscriptions",
86
+ packageName: PACKAGE_NAME,
87
+ url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({
88
+ protoPath: "/v1/email-subscriptions/query",
89
+ data: payload,
90
+ host
91
+ }),
92
+ data: payload,
93
+ transformResponse: (payload2) => transformPaths(payload2, [
94
+ {
95
+ transformFn: transformRESTTimestampToSDKTimestamp,
96
+ paths: [
97
+ { path: "subscriptions.createdDate" },
98
+ { path: "subscriptions.updatedDate" }
99
+ ]
100
+ }
101
+ ])
102
+ };
103
+ return metadata;
104
+ }
105
+ return __queryEmailSubscriptions;
106
+ }
107
+ function upsertEmailSubscription(payload) {
108
+ function __upsertEmailSubscription({ host }) {
109
+ const serializedData = transformPaths(payload, [
110
+ {
111
+ transformFn: transformSDKTimestampToRESTTimestamp,
112
+ paths: [
113
+ { path: "subscription.createdDate" },
114
+ { path: "subscription.updatedDate" }
115
+ ]
116
+ }
117
+ ]);
118
+ const metadata = {
119
+ entityFqdn: "wix.emailsubscriptions.v1.emailsubscription",
120
+ method: "POST",
121
+ methodFqn: "com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.UpsertEmailSubscription",
122
+ packageName: PACKAGE_NAME,
123
+ url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({
124
+ protoPath: "/v1/email-subscriptions",
125
+ data: serializedData,
126
+ host
127
+ }),
128
+ data: serializedData,
129
+ transformResponse: (payload2) => transformPaths(payload2, [
130
+ {
131
+ transformFn: transformRESTTimestampToSDKTimestamp,
132
+ paths: [
133
+ { path: "subscription.createdDate" },
134
+ { path: "subscription.updatedDate" }
135
+ ]
136
+ }
137
+ ])
138
+ };
139
+ return metadata;
140
+ }
141
+ return __upsertEmailSubscription;
142
+ }
143
+ function bulkUpsertEmailSubscription(payload) {
144
+ function __bulkUpsertEmailSubscription({ host }) {
145
+ const serializedData = transformPaths(payload, [
146
+ {
147
+ transformFn: transformSDKTimestampToRESTTimestamp,
148
+ paths: [
149
+ { path: "subscriptions.createdDate" },
150
+ { path: "subscriptions.updatedDate" }
151
+ ]
152
+ }
153
+ ]);
154
+ const metadata = {
155
+ entityFqdn: "wix.emailsubscriptions.v1.emailsubscription",
156
+ method: "POST",
157
+ methodFqn: "com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.BulkUpsertEmailSubscription",
158
+ packageName: PACKAGE_NAME,
159
+ url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({
160
+ protoPath: "/v1/email-subscriptions/bulk",
161
+ data: serializedData,
162
+ host
163
+ }),
164
+ data: serializedData,
165
+ transformResponse: (payload2) => transformPaths(payload2, [
166
+ {
167
+ transformFn: transformRESTTimestampToSDKTimestamp,
168
+ paths: [
169
+ { path: "results.emailSubscription.createdDate" },
170
+ { path: "results.emailSubscription.updatedDate" }
171
+ ]
172
+ }
173
+ ])
174
+ };
175
+ return metadata;
176
+ }
177
+ return __bulkUpsertEmailSubscription;
178
+ }
179
+ function generateUnsubscribeLink(payload) {
180
+ function __generateUnsubscribeLink({ host }) {
181
+ const metadata = {
182
+ entityFqdn: "wix.emailsubscriptions.v1.emailsubscription",
183
+ method: "POST",
184
+ methodFqn: "com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.GenerateUnsubscribeLink",
185
+ packageName: PACKAGE_NAME,
186
+ url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({
187
+ protoPath: "/v1/email-subscriptions/unsubscribe-link",
188
+ data: payload,
189
+ host
190
+ }),
191
+ data: payload
192
+ };
193
+ return metadata;
194
+ }
195
+ return __generateUnsubscribeLink;
196
+ }
197
+
198
+ // src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.ts
199
+ function getEmailSubscription2() {
200
+ const payload = { id: ":id" };
201
+ const getRequestOptions = getEmailSubscription(
202
+ payload
203
+ );
204
+ const getUrl = (context) => {
205
+ const { url } = getRequestOptions(context);
206
+ return url;
207
+ };
208
+ return {
209
+ getUrl,
210
+ httpMethod: "GET",
211
+ path: "/v1/email-subscriptions/{id}",
212
+ pathParams: { id: "id" },
213
+ __requestType: null,
214
+ __originalRequestType: null,
215
+ __responseType: null,
216
+ __originalResponseType: null
217
+ };
218
+ }
219
+ function queryEmailSubscriptions2() {
220
+ const payload = {};
221
+ const getRequestOptions = queryEmailSubscriptions(
222
+ payload
223
+ );
224
+ const getUrl = (context) => {
225
+ const { url } = getRequestOptions(context);
226
+ return url;
227
+ };
228
+ return {
229
+ getUrl,
230
+ httpMethod: "POST",
231
+ path: "/v1/email-subscriptions/query",
232
+ pathParams: {},
233
+ __requestType: null,
234
+ __originalRequestType: null,
235
+ __responseType: null,
236
+ __originalResponseType: null
237
+ };
238
+ }
239
+ function upsertEmailSubscription2() {
240
+ const payload = {};
241
+ const getRequestOptions = upsertEmailSubscription(
242
+ payload
243
+ );
244
+ const getUrl = (context) => {
245
+ const { url } = getRequestOptions(context);
246
+ return url;
247
+ };
248
+ return {
249
+ getUrl,
250
+ httpMethod: "POST",
251
+ path: "/v1/email-subscriptions",
252
+ pathParams: {},
253
+ __requestType: null,
254
+ __originalRequestType: null,
255
+ __responseType: null,
256
+ __originalResponseType: null
257
+ };
258
+ }
259
+ function bulkUpsertEmailSubscription2() {
260
+ const payload = {};
261
+ const getRequestOptions = bulkUpsertEmailSubscription(
262
+ payload
263
+ );
264
+ const getUrl = (context) => {
265
+ const { url } = getRequestOptions(context);
266
+ return url;
267
+ };
268
+ return {
269
+ getUrl,
270
+ httpMethod: "POST",
271
+ path: "/v1/email-subscriptions/bulk",
272
+ pathParams: {},
273
+ __requestType: null,
274
+ __originalRequestType: null,
275
+ __responseType: null,
276
+ __originalResponseType: null
277
+ };
278
+ }
279
+ function generateUnsubscribeLink2() {
280
+ const payload = {};
281
+ const getRequestOptions = generateUnsubscribeLink(
282
+ payload
283
+ );
284
+ const getUrl = (context) => {
285
+ const { url } = getRequestOptions(context);
286
+ return url;
287
+ };
288
+ return {
289
+ getUrl,
290
+ httpMethod: "POST",
291
+ path: "/v1/email-subscriptions/unsubscribe-link",
292
+ pathParams: {},
293
+ __requestType: null,
294
+ __originalRequestType: null,
295
+ __responseType: null,
296
+ __originalResponseType: null
297
+ };
298
+ }
299
+ export {
300
+ bulkUpsertEmailSubscription2 as bulkUpsertEmailSubscription,
301
+ generateUnsubscribeLink2 as generateUnsubscribeLink,
302
+ getEmailSubscription2 as getEmailSubscription,
303
+ queryEmailSubscriptions2 as queryEmailSubscriptions,
304
+ upsertEmailSubscription2 as upsertEmailSubscription
305
+ };
306
+ //# sourceMappingURL=meta.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/emailsubscriptions-v1-emailsubscription-email-subscriptions.http.ts","../../src/emailsubscriptions-v1-emailsubscription-email-subscriptions.meta.ts"],"sourcesContent":["import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'editor._base_domain_': [\n {\n srcPath: '/_api/email-marketing/v1/email-subscriptions',\n destPath: '/v1/email-subscriptions',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/email-marketing/v1/email-subscriptions',\n destPath: '/v1/email-subscriptions',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/email-marketing/v1/email-subscriptions',\n destPath: '/v1/email-subscriptions',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/email-marketing/v1/email-subscriptions',\n destPath: '/v1/email-subscriptions',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/email-marketing/v1/email-subscriptions',\n destPath: '/v1/email-subscriptions',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/email-marketing/v1/email-subscriptions',\n destPath: '/v1/email-subscriptions',\n },\n {\n srcPath: '/email-marketing/v1/email-subscriptions/unsubscribe-link',\n destPath: '/v1/email-subscriptions/unsubscribe-link',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_email-subscriptions_email-subscriptions';\n\n/** Get Email Subscription */\nexport function getEmailSubscription(\n payload: object\n): RequestOptionsFactory<any> {\n function __getEmailSubscription({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.emailsubscriptions.v1.emailsubscription',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.GetEmailSubscription',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({\n protoPath: '/v1/email-subscriptions/{id}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'emailSubscription.createdDate' },\n { path: 'emailSubscription.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getEmailSubscription;\n}\n\n/**\n * Retrieves email subscriptions,\n * given the provided paging, filtering, and sorting.\n *\n * Currently, querying is supported on the `email` field\n * with the `$in` array filter.\n * For example, to query for emails `\"me@my.com\"` and `\"you@your.org\"`,\n * the filter should be formed like this:\n *\n * ```json\n * { \"filter\": {\n * \"email\": {\n * \"$in\": [\"me@my.com\", \"you@your.org\"]\n * }\n * }\n * }\n * ```\n *\n * To learn how to query email subscriptions, see\n * [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).\n */\nexport function queryEmailSubscriptions(\n payload: object\n): RequestOptionsFactory<any> {\n function __queryEmailSubscriptions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.emailsubscriptions.v1.emailsubscription',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.QueryEmailSubscriptions',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({\n protoPath: '/v1/email-subscriptions/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'subscriptions.createdDate' },\n { path: 'subscriptions.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryEmailSubscriptions;\n}\n\n/**\n * Updates or creates an email subscription for the requested email.\n *\n * An email subscription is returned in the response\n * whether it was updated or created.\n */\nexport function upsertEmailSubscription(\n payload: object\n): RequestOptionsFactory<any> {\n function __upsertEmailSubscription({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'subscription.createdDate' },\n { path: 'subscription.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.emailsubscriptions.v1.emailsubscription',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.UpsertEmailSubscription',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({\n protoPath: '/v1/email-subscriptions',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'subscription.createdDate' },\n { path: 'subscription.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __upsertEmailSubscription;\n}\n\n/** Updates or creates multiple email subscriptions. */\nexport function bulkUpsertEmailSubscription(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkUpsertEmailSubscription({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'subscriptions.createdDate' },\n { path: 'subscriptions.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.emailsubscriptions.v1.emailsubscription',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.BulkUpsertEmailSubscription',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({\n protoPath: '/v1/email-subscriptions/bulk',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'results.emailSubscription.createdDate' },\n { path: 'results.emailSubscription.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkUpsertEmailSubscription;\n}\n\n/**\n * Creates an unsubscribe link to be shared with the relevant recipient.\n *\n * If someone clicks the **Unsubscribe** button on the confirmation page,\n * the recipient's `subscriptionStatus` is changed to `UNSUBSCRIBED`.\n */\nexport function generateUnsubscribeLink(\n payload: object\n): RequestOptionsFactory<any> {\n function __generateUnsubscribeLink({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.emailsubscriptions.v1.emailsubscription',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.emailsubscriptions.v1.EmailSubscriptionsService.GenerateUnsubscribeLink',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressEmailsubscriptionsV1EmailSubscriptionsServiceUrl({\n protoPath: '/v1/email-subscriptions/unsubscribe-link',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __generateUnsubscribeLink;\n}\n","import * as ambassadorWixEmailsubscriptionsV1Emailsubscription from './emailsubscriptions-v1-emailsubscription-email-subscriptions.http.js';\nimport * as ambassadorWixEmailsubscriptionsV1EmailsubscriptionTypes from './emailsubscriptions-v1-emailsubscription-email-subscriptions.types.js';\nimport * as ambassadorWixEmailsubscriptionsV1EmailsubscriptionUniversalTypes from './emailsubscriptions-v1-emailsubscription-email-subscriptions.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getEmailSubscription(): __PublicMethodMetaInfo<\n 'GET',\n { id: string },\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionUniversalTypes.GetEmailSubscriptionRequest,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionTypes.GetEmailSubscriptionRequest,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionUniversalTypes.GetEmailSubscriptionResponse,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionTypes.GetEmailSubscriptionResponse\n> {\n const payload = { id: ':id' } as any;\n\n const getRequestOptions =\n ambassadorWixEmailsubscriptionsV1Emailsubscription.getEmailSubscription(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/email-subscriptions/{id}',\n pathParams: { id: 'id' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function queryEmailSubscriptions(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionUniversalTypes.QueryEmailSubscriptionsRequest,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionTypes.QueryEmailSubscriptionsRequest,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionUniversalTypes.QueryEmailSubscriptionsResponse,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionTypes.QueryEmailSubscriptionsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEmailsubscriptionsV1Emailsubscription.queryEmailSubscriptions(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/email-subscriptions/query',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function upsertEmailSubscription(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionUniversalTypes.UpsertEmailSubscriptionRequest,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionTypes.UpsertEmailSubscriptionRequest,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionUniversalTypes.UpsertEmailSubscriptionResponse,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionTypes.UpsertEmailSubscriptionResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEmailsubscriptionsV1Emailsubscription.upsertEmailSubscription(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/email-subscriptions',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function bulkUpsertEmailSubscription(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionUniversalTypes.BulkUpsertEmailSubscriptionRequest,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionTypes.BulkUpsertEmailSubscriptionRequest,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionUniversalTypes.BulkUpsertEmailSubscriptionResponse,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionTypes.BulkUpsertEmailSubscriptionResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEmailsubscriptionsV1Emailsubscription.bulkUpsertEmailSubscription(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/email-subscriptions/bulk',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function generateUnsubscribeLink(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionUniversalTypes.GenerateUnsubscribeLinkRequest,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionTypes.GenerateUnsubscribeLinkRequest,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionUniversalTypes.GenerateUnsubscribeLinkResponse,\n ambassadorWixEmailsubscriptionsV1EmailsubscriptionTypes.GenerateUnsubscribeLinkResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEmailsubscriptionsV1Emailsubscription.generateUnsubscribeLink(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/email-subscriptions/unsubscribe-link',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,mEACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,qBACd,SAC4B;AAC5B,WAAS,uBAAuB,EAAE,KAAK,GAAQ;AAC7C,UAAM,WAAW;AAAA,MACf,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AAAA,EAC1B;AACF;AAEO,SAASC,+BAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC+C;AAAA,IACjD;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,2BAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC+C;AAAA,IACjD;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["payload","getEmailSubscription","queryEmailSubscriptions","upsertEmailSubscription","bulkUpsertEmailSubscription","generateUnsubscribeLink"]}
@@ -1 +1,82 @@
1
- export * from './src/emailsubscriptions-v1-emailsubscription-email-subscriptions.context.js';
1
+ import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
+ import { EmailSubscription, QueryEmailSubscriptionsOptions, QueryEmailSubscriptionsResponse, UpsertEmailSubscriptionOptions, UpsertEmailSubscriptionResponse, 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
+ /** @internal */
6
+ declare function getEmailSubscription$1(httpClient: HttpClient): GetEmailSubscriptionSignature;
7
+ interface GetEmailSubscriptionSignature {
8
+ /**
9
+ * Get Email Subscription
10
+ * @returns Returned email subscription
11
+ */
12
+ (_id: string): Promise<NonNullablePaths<EmailSubscription, `email` | `subscriptionStatus` | `deliverabilityStatus`, 2>>;
13
+ }
14
+ declare function queryEmailSubscriptions$1(httpClient: HttpClient): QueryEmailSubscriptionsSignature;
15
+ interface QueryEmailSubscriptionsSignature {
16
+ /**
17
+ * Retrieves email subscriptions,
18
+ * given the provided paging, filtering, and sorting.
19
+ *
20
+ * Currently, querying is supported on the `email` field
21
+ * with the `$in` array filter.
22
+ * For example, to query for emails `"me@my.com"` and `"you@your.org"`,
23
+ * the filter should be formed like this:
24
+ *
25
+ * ```json
26
+ * { "filter": {
27
+ * "email": {
28
+ * "$in": ["me@my.com", "you@your.org"]
29
+ * }
30
+ * }
31
+ * }
32
+ * ```
33
+ *
34
+ * To learn how to query email subscriptions, see
35
+ * [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
36
+ * @param - Filter options.
37
+ * Currently, querying is supported on the `email` field
38
+ * with the `$in` array filter.
39
+ */
40
+ (filter: Record<string, any>, options?: QueryEmailSubscriptionsOptions): Promise<NonNullablePaths<QueryEmailSubscriptionsResponse, `subscriptions` | `subscriptions.${number}.email` | `subscriptions.${number}.subscriptionStatus` | `subscriptions.${number}.deliverabilityStatus`, 4>>;
41
+ }
42
+ declare function upsertEmailSubscription$1(httpClient: HttpClient): UpsertEmailSubscriptionSignature;
43
+ interface UpsertEmailSubscriptionSignature {
44
+ /**
45
+ * Updates or creates an email subscription for the requested email.
46
+ *
47
+ * An email subscription is returned in the response
48
+ * whether it was updated or created.
49
+ */
50
+ (options?: NonNullablePaths<UpsertEmailSubscriptionOptions, `subscription.email`, 3>): Promise<NonNullablePaths<UpsertEmailSubscriptionResponse, `subscription.email` | `subscription.subscriptionStatus` | `subscription.deliverabilityStatus`, 3>>;
51
+ }
52
+ declare function bulkUpsertEmailSubscription$1(httpClient: HttpClient): BulkUpsertEmailSubscriptionSignature;
53
+ interface BulkUpsertEmailSubscriptionSignature {
54
+ /**
55
+ * Updates or creates multiple email subscriptions.
56
+ * @param - List of email subscriptions to update or create.
57
+ */
58
+ (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>>;
59
+ }
60
+ declare function generateUnsubscribeLink$1(httpClient: HttpClient): GenerateUnsubscribeLinkSignature;
61
+ interface GenerateUnsubscribeLinkSignature {
62
+ /**
63
+ * Creates an unsubscribe link to be shared with the relevant recipient.
64
+ *
65
+ * If someone clicks the **Unsubscribe** button on the confirmation page,
66
+ * the recipient's `subscriptionStatus` is changed to `UNSUBSCRIBED`.
67
+ * @param - Email address the unsubscribe link is for.
68
+ */
69
+ (emailAddress: string, options?: GenerateUnsubscribeLinkOptions): Promise<NonNullablePaths<GenerateUnsubscribeLinkResponse, `link`, 2>>;
70
+ }
71
+ declare const onEmailsubscriptionEmailSubscriptionChanged$1: EventDefinition<EmailsubscriptionEmailSubscriptionChangedEnvelope, "com.wixpress.emailsubscriptions.v1.EmailSubscriptionChanged">;
72
+
73
+ /** @internal */
74
+ declare const getEmailSubscription: MaybeContext<BuildRESTFunction<typeof getEmailSubscription$1> & typeof getEmailSubscription$1>;
75
+ declare const queryEmailSubscriptions: MaybeContext<BuildRESTFunction<typeof queryEmailSubscriptions$1> & typeof queryEmailSubscriptions$1>;
76
+ declare const upsertEmailSubscription: MaybeContext<BuildRESTFunction<typeof upsertEmailSubscription$1> & typeof upsertEmailSubscription$1>;
77
+ declare const bulkUpsertEmailSubscription: MaybeContext<BuildRESTFunction<typeof bulkUpsertEmailSubscription$1> & typeof bulkUpsertEmailSubscription$1>;
78
+ declare const generateUnsubscribeLink: MaybeContext<BuildRESTFunction<typeof generateUnsubscribeLink$1> & typeof generateUnsubscribeLink$1>;
79
+ /** */
80
+ declare const onEmailsubscriptionEmailSubscriptionChanged: BuildEventDefinition<typeof onEmailsubscriptionEmailSubscriptionChanged$1> & typeof onEmailsubscriptionEmailSubscriptionChanged$1;
81
+
82
+ export { BulkUpsertEmailSubscriptionResponse, EmailSubscription, EmailsubscriptionEmailSubscriptionChangedEnvelope, GenerateUnsubscribeLinkOptions, GenerateUnsubscribeLinkResponse, QueryEmailSubscriptionsOptions, QueryEmailSubscriptionsResponse, UpsertEmailSubscriptionOptions, UpsertEmailSubscriptionResponse, bulkUpsertEmailSubscription, generateUnsubscribeLink, getEmailSubscription, onEmailsubscriptionEmailSubscriptionChanged, queryEmailSubscriptions, upsertEmailSubscription };