@wix/email-subscriptions 1.0.16 → 1.0.18
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 +2 -1
- package/build/cjs/index.js +2 -1
- package/build/cjs/index.js.map +1 -1
- package/build/es/index.d.ts +2 -1
- package/build/es/index.js +2 -1
- package/build/es/index.js.map +1 -1
- package/package.json +6 -6
- package/type-bundles/context.bundle.d.ts +340 -70
- package/type-bundles/index.bundle.d.ts +139 -65
- package/type-bundles/meta.bundle.d.ts +44 -52
package/build/cjs/index.d.ts
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
import * as emailSubscriptions from '@wix/email-subscriptions_email-subscriptions';
|
2
|
+
export { emailSubscriptions };
|
package/build/cjs/index.js
CHANGED
@@ -24,5 +24,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
24
24
|
};
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
26
|
exports.emailSubscriptions = void 0;
|
27
|
-
|
27
|
+
const emailSubscriptions = __importStar(require("@wix/email-subscriptions_email-subscriptions"));
|
28
|
+
exports.emailSubscriptions = emailSubscriptions;
|
28
29
|
//# sourceMappingURL=index.js.map
|
package/build/cjs/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iGAAmF;AAE1E,gDAAkB"}
|
package/build/es/index.d.ts
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
import * as emailSubscriptions from '@wix/email-subscriptions_email-subscriptions';
|
2
|
+
export { emailSubscriptions };
|
package/build/es/index.js
CHANGED
package/build/es/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,8CAA8C,CAAC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,8CAA8C,CAAC;AAEnF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wix/email-subscriptions",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.18",
|
4
4
|
"publishConfig": {
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
6
6
|
"access": "public"
|
@@ -18,18 +18,18 @@
|
|
18
18
|
"type-bundles"
|
19
19
|
],
|
20
20
|
"dependencies": {
|
21
|
-
"@wix/email-subscriptions_email-subscriptions": "1.0.
|
21
|
+
"@wix/email-subscriptions_email-subscriptions": "1.0.4"
|
22
22
|
},
|
23
23
|
"devDependencies": {
|
24
|
-
"@wix/sdk": "https://cdn.dev.wixpress.com/@wix/sdk/02e8069ab2fd783e0e6a080fc7d590e76cb26ab93c8389574286305b.tar.gz",
|
25
24
|
"glob": "^10.4.1",
|
26
25
|
"rollup": "^4.18.0",
|
27
26
|
"rollup-plugin-dts": "^6.1.1",
|
28
27
|
"typescript": "^5.3.2"
|
29
28
|
},
|
30
29
|
"scripts": {
|
31
|
-
"build": "tsc -b tsconfig.json tsconfig.esm.json && npm run build:dts-bundles",
|
32
|
-
"build:dts-bundles": "test -f config/rollup-config.js && rollup --config config/rollup-config.js || echo 'Warning: config/rollup-config.js not found!'",
|
30
|
+
"build": "tsc -b tsconfig.json tsconfig.esm.json && npm run build:dts-bundles && npm run build:validate-dts",
|
31
|
+
"build:dts-bundles": "test -f config/rollup-config.js && NODE_OPTIONS=--max-old-space-size=8192 rollup --config config/rollup-config.js || echo 'Warning: config/rollup-config.js not found!'",
|
32
|
+
"build:validate-dts": "tsc type-bundles/*.d.ts --noEmit",
|
33
33
|
"test": ":"
|
34
34
|
},
|
35
35
|
"wix": {
|
@@ -43,5 +43,5 @@
|
|
43
43
|
"fqdn": ""
|
44
44
|
}
|
45
45
|
},
|
46
|
-
"falconPackageHash": "
|
46
|
+
"falconPackageHash": "4e59f2d57dc57a586dc018ef0f3bc7772782f38dc0b32a0cd47608e6"
|
47
47
|
}
|
@@ -1,3 +1,47 @@
|
|
1
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
2
|
+
interface HttpClient {
|
3
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
4
|
+
fetchWithAuth: typeof fetch;
|
5
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
6
|
+
}
|
7
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
8
|
+
type HttpResponse<T = any> = {
|
9
|
+
data: T;
|
10
|
+
status: number;
|
11
|
+
statusText: string;
|
12
|
+
headers: any;
|
13
|
+
request?: any;
|
14
|
+
};
|
15
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
16
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
17
|
+
url: string;
|
18
|
+
data?: Data;
|
19
|
+
params?: URLSearchParams;
|
20
|
+
} & APIMetadata;
|
21
|
+
type APIMetadata = {
|
22
|
+
methodFqn?: string;
|
23
|
+
entityFqdn?: string;
|
24
|
+
packageName?: string;
|
25
|
+
};
|
26
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
27
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
28
|
+
__type: 'event-definition';
|
29
|
+
type: Type;
|
30
|
+
isDomainEvent?: boolean;
|
31
|
+
transformations?: (envelope: unknown) => Payload;
|
32
|
+
__payload: Payload;
|
33
|
+
};
|
34
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
35
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
36
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
37
|
+
|
38
|
+
declare global {
|
39
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
40
|
+
interface SymbolConstructor {
|
41
|
+
readonly observable: symbol;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
1
45
|
interface EmailSubscription {
|
2
46
|
/**
|
3
47
|
* Email subscription ID.
|
@@ -66,10 +110,59 @@ declare enum Status {
|
|
66
110
|
/** valid, but no activity reported */
|
67
111
|
INACTIVE = "INACTIVE"
|
68
112
|
}
|
113
|
+
interface V1RenderUnsubscribePageRequest {
|
114
|
+
/** Payload */
|
115
|
+
payload?: string;
|
116
|
+
/** Language */
|
117
|
+
language?: string | null;
|
118
|
+
}
|
119
|
+
interface RawHttpResponse {
|
120
|
+
body?: Uint8Array;
|
121
|
+
statusCode?: number | null;
|
122
|
+
headers?: HeadersEntry[];
|
123
|
+
}
|
124
|
+
interface HeadersEntry {
|
125
|
+
key?: string;
|
126
|
+
value?: string;
|
127
|
+
}
|
128
|
+
interface V1ConfirmUnsubscribeActionRequest {
|
129
|
+
/** Payload */
|
130
|
+
payload?: string;
|
131
|
+
}
|
132
|
+
interface Empty {
|
133
|
+
}
|
69
134
|
interface EmailSubscriptionChanged {
|
70
135
|
/** subscription */
|
71
136
|
subscription?: EmailSubscription;
|
72
137
|
}
|
138
|
+
interface GetEmailSubscriptionRequest {
|
139
|
+
_id?: string;
|
140
|
+
}
|
141
|
+
interface GetEmailSubscriptionResponse {
|
142
|
+
/** Returned email subscription */
|
143
|
+
emailSubscription?: EmailSubscription;
|
144
|
+
}
|
145
|
+
interface UpdateEmailSubscriptionRequest {
|
146
|
+
/** Email subscription to update */
|
147
|
+
subscription?: EmailSubscription;
|
148
|
+
}
|
149
|
+
interface UpdateEmailSubscriptionResponse {
|
150
|
+
/** Updated email subscription */
|
151
|
+
subscription?: EmailSubscription;
|
152
|
+
}
|
153
|
+
interface QueryEmailSubscriptionsRequest {
|
154
|
+
/**
|
155
|
+
* Filter options.
|
156
|
+
* Currently, querying is supported on the `email` field
|
157
|
+
* with the `$in` array filter.
|
158
|
+
*/
|
159
|
+
filter: Record<string, any> | null;
|
160
|
+
/**
|
161
|
+
* Pagination options. For more information, see
|
162
|
+
* [Pagination](https://dev.wix.com/api/rest/getting-started/pagination).
|
163
|
+
*/
|
164
|
+
paging?: Paging;
|
165
|
+
}
|
73
166
|
interface Paging {
|
74
167
|
/** Number of items to load. */
|
75
168
|
limit?: number | null;
|
@@ -92,10 +185,18 @@ interface PagingMetadata {
|
|
92
185
|
/** Flag that indicates the server failed to calculate the `total` field. */
|
93
186
|
tooManyToCount?: boolean | null;
|
94
187
|
}
|
188
|
+
interface UpsertEmailSubscriptionRequest {
|
189
|
+
/** Email subscription to update or create. */
|
190
|
+
subscription?: EmailSubscription;
|
191
|
+
}
|
95
192
|
interface UpsertEmailSubscriptionResponse {
|
96
193
|
/** Updated or created email subscription. */
|
97
194
|
subscription?: EmailSubscription;
|
98
195
|
}
|
196
|
+
interface BulkUpsertEmailSubscriptionRequest {
|
197
|
+
/** List of email subscriptions to update or create. */
|
198
|
+
subscriptions: EmailSubscription[];
|
199
|
+
}
|
99
200
|
interface BulkUpsertEmailSubscriptionResponse {
|
100
201
|
/** List of updated or created email subscriptions. */
|
101
202
|
results?: BulkUpsertEmailSubscriptionResult[];
|
@@ -125,10 +226,108 @@ interface Metadata {
|
|
125
226
|
/** Number of failed actions. */
|
126
227
|
totalFailure?: number;
|
127
228
|
}
|
229
|
+
interface GenerateUnsubscribeLinkRequest {
|
230
|
+
/** Email address the unsubscribe link is for. */
|
231
|
+
emailAddress: string;
|
232
|
+
/** Arbitrary parameters for closing-the-loop. */
|
233
|
+
metadata?: Record<string, string>;
|
234
|
+
/** Language for displaying unsubscribe confirmation page (optional - default EN). */
|
235
|
+
language?: string | null;
|
236
|
+
}
|
128
237
|
interface GenerateUnsubscribeLinkResponse {
|
129
238
|
/** The unsubscribe link. */
|
130
239
|
link?: string;
|
131
240
|
}
|
241
|
+
interface RenderUnsubscribePageRequest {
|
242
|
+
/** Payload */
|
243
|
+
payload?: string;
|
244
|
+
/** Language */
|
245
|
+
language?: string | null;
|
246
|
+
}
|
247
|
+
interface ConfirmUnsubscribeActionRequest {
|
248
|
+
/** Payload */
|
249
|
+
payload?: string;
|
250
|
+
}
|
251
|
+
interface DomainEvent extends DomainEventBodyOneOf {
|
252
|
+
createdEvent?: EntityCreatedEvent;
|
253
|
+
updatedEvent?: EntityUpdatedEvent;
|
254
|
+
deletedEvent?: EntityDeletedEvent;
|
255
|
+
actionEvent?: ActionEvent;
|
256
|
+
/**
|
257
|
+
* Unique event ID.
|
258
|
+
* Allows clients to ignore duplicate webhooks.
|
259
|
+
*/
|
260
|
+
_id?: string;
|
261
|
+
/**
|
262
|
+
* Assumes actions are also always typed to an entity_type
|
263
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
264
|
+
*/
|
265
|
+
entityFqdn?: string;
|
266
|
+
/**
|
267
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
268
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
269
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
270
|
+
*/
|
271
|
+
slug?: string;
|
272
|
+
/** ID of the entity associated with the event. */
|
273
|
+
entityId?: string;
|
274
|
+
/** Event timestamp. */
|
275
|
+
eventTime?: Date;
|
276
|
+
/**
|
277
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
278
|
+
* (for example, GDPR).
|
279
|
+
*/
|
280
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
281
|
+
/** If present, indicates the action that triggered the event. */
|
282
|
+
originatedFrom?: string | null;
|
283
|
+
/**
|
284
|
+
* A sequence number defining the order of updates to the underlying entity.
|
285
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
286
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
287
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
288
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
289
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
290
|
+
*/
|
291
|
+
entityEventSequence?: string | null;
|
292
|
+
}
|
293
|
+
/** @oneof */
|
294
|
+
interface DomainEventBodyOneOf {
|
295
|
+
createdEvent?: EntityCreatedEvent;
|
296
|
+
updatedEvent?: EntityUpdatedEvent;
|
297
|
+
deletedEvent?: EntityDeletedEvent;
|
298
|
+
actionEvent?: ActionEvent;
|
299
|
+
}
|
300
|
+
interface EntityCreatedEvent {
|
301
|
+
entity?: string;
|
302
|
+
}
|
303
|
+
interface RestoreInfo {
|
304
|
+
deletedDate?: Date;
|
305
|
+
}
|
306
|
+
interface EntityUpdatedEvent {
|
307
|
+
/**
|
308
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
309
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
310
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
311
|
+
*/
|
312
|
+
currentEntity?: string;
|
313
|
+
}
|
314
|
+
interface EntityDeletedEvent {
|
315
|
+
/** Entity that was deleted */
|
316
|
+
deletedEntity?: string | null;
|
317
|
+
}
|
318
|
+
interface ActionEvent {
|
319
|
+
body?: string;
|
320
|
+
}
|
321
|
+
interface MessageEnvelope {
|
322
|
+
/** App instance ID. */
|
323
|
+
instanceId?: string | null;
|
324
|
+
/** Event type. */
|
325
|
+
eventType?: string;
|
326
|
+
/** The identification type and identity data. */
|
327
|
+
identity?: IdentificationData;
|
328
|
+
/** Stringify payload. */
|
329
|
+
data?: string;
|
330
|
+
}
|
132
331
|
interface IdentificationData extends IdentificationDataIdOneOf {
|
133
332
|
/** ID of a site visitor that has not logged in to the site. */
|
134
333
|
anonymousVisitorId?: string;
|
@@ -159,37 +358,33 @@ declare enum WebhookIdentityType {
|
|
159
358
|
WIX_USER = "WIX_USER",
|
160
359
|
APP = "APP"
|
161
360
|
}
|
361
|
+
interface EmailSubscriptionNonNullableFields {
|
362
|
+
email: string;
|
363
|
+
subscriptionStatus: SubscriptionEnumStatus;
|
364
|
+
deliverabilityStatus: Status;
|
365
|
+
}
|
162
366
|
interface QueryEmailSubscriptionsResponseNonNullableFields {
|
163
|
-
subscriptions:
|
164
|
-
email: string;
|
165
|
-
subscriptionStatus: SubscriptionEnumStatus;
|
166
|
-
deliverabilityStatus: Status;
|
167
|
-
}[];
|
367
|
+
subscriptions: EmailSubscriptionNonNullableFields[];
|
168
368
|
}
|
169
369
|
interface UpsertEmailSubscriptionResponseNonNullableFields {
|
170
|
-
subscription?:
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
370
|
+
subscription?: EmailSubscriptionNonNullableFields;
|
371
|
+
}
|
372
|
+
interface ErrorNonNullableFields {
|
373
|
+
errorCode: string;
|
374
|
+
message: string;
|
375
|
+
}
|
376
|
+
interface BulkUpsertEmailSubscriptionResultNonNullableFields {
|
377
|
+
originalIndex: number;
|
378
|
+
emailSubscription?: EmailSubscriptionNonNullableFields;
|
379
|
+
error?: ErrorNonNullableFields;
|
380
|
+
}
|
381
|
+
interface MetadataNonNullableFields {
|
382
|
+
totalSuccess: number;
|
383
|
+
totalFailure: number;
|
175
384
|
}
|
176
385
|
interface BulkUpsertEmailSubscriptionResponseNonNullableFields {
|
177
|
-
results:
|
178
|
-
|
179
|
-
emailSubscription?: {
|
180
|
-
email: string;
|
181
|
-
subscriptionStatus: SubscriptionEnumStatus;
|
182
|
-
deliverabilityStatus: Status;
|
183
|
-
};
|
184
|
-
error?: {
|
185
|
-
errorCode: string;
|
186
|
-
message: string;
|
187
|
-
};
|
188
|
-
}[];
|
189
|
-
metadata?: {
|
190
|
-
totalSuccess: number;
|
191
|
-
totalFailure: number;
|
192
|
-
};
|
386
|
+
results: BulkUpsertEmailSubscriptionResultNonNullableFields[];
|
387
|
+
metadata?: MetadataNonNullableFields;
|
193
388
|
}
|
194
389
|
interface GenerateUnsubscribeLinkResponseNonNullableFields {
|
195
390
|
link: string;
|
@@ -224,60 +419,135 @@ interface GenerateUnsubscribeLinkOptions {
|
|
224
419
|
language?: string | null;
|
225
420
|
}
|
226
421
|
|
227
|
-
|
228
|
-
interface
|
229
|
-
|
422
|
+
declare function queryEmailSubscriptions$1(httpClient: HttpClient): QueryEmailSubscriptionsSignature;
|
423
|
+
interface QueryEmailSubscriptionsSignature {
|
424
|
+
/**
|
425
|
+
* Retrieves email subscriptions,
|
426
|
+
* given the provided paging, filtering, and sorting.
|
427
|
+
*
|
428
|
+
* Currently, querying is supported on the `email` field
|
429
|
+
* with the `$in` array filter.
|
430
|
+
* For example, to query for emails "me@my.com" and "you@your.org",
|
431
|
+
* the filter should be formed like this:
|
432
|
+
*
|
433
|
+
* ```json
|
434
|
+
* { "filter": {
|
435
|
+
* "email": {
|
436
|
+
* "$in": ["me@my.com", "you@your.org"]
|
437
|
+
* }
|
438
|
+
* }
|
439
|
+
* }
|
440
|
+
* ```
|
441
|
+
*
|
442
|
+
* To learn how to query email subscriptions, see
|
443
|
+
* [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
444
|
+
* @param - Filter options.
|
445
|
+
* Currently, querying is supported on the `email` field
|
446
|
+
* with the `$in` array filter.
|
447
|
+
*/
|
448
|
+
(filter: Record<string, any> | null, options?: QueryEmailSubscriptionsOptions | undefined): Promise<QueryEmailSubscriptionsResponse & QueryEmailSubscriptionsResponseNonNullableFields>;
|
449
|
+
}
|
450
|
+
declare function upsertEmailSubscription$1(httpClient: HttpClient): UpsertEmailSubscriptionSignature;
|
451
|
+
interface UpsertEmailSubscriptionSignature {
|
452
|
+
/**
|
453
|
+
* Updates or creates an email subscription for the requested email.
|
454
|
+
*
|
455
|
+
* An email subscription is always returned in the response,
|
456
|
+
* regardless of whether it was updated or created.
|
457
|
+
*/
|
458
|
+
(options?: UpsertEmailSubscriptionOptions | undefined): Promise<UpsertEmailSubscriptionResponse & UpsertEmailSubscriptionResponseNonNullableFields>;
|
459
|
+
}
|
460
|
+
declare function bulkUpsertEmailSubscription$1(httpClient: HttpClient): BulkUpsertEmailSubscriptionSignature;
|
461
|
+
interface BulkUpsertEmailSubscriptionSignature {
|
462
|
+
/**
|
463
|
+
* Updates or creates multiple email subscriptions.
|
464
|
+
* @param - List of email subscriptions to update or create.
|
465
|
+
*/
|
466
|
+
(subscriptions: EmailSubscription[]): Promise<BulkUpsertEmailSubscriptionResponse & BulkUpsertEmailSubscriptionResponseNonNullableFields>;
|
467
|
+
}
|
468
|
+
declare function generateUnsubscribeLink$1(httpClient: HttpClient): GenerateUnsubscribeLinkSignature;
|
469
|
+
interface GenerateUnsubscribeLinkSignature {
|
470
|
+
/**
|
471
|
+
* Creates an unsubscribe link to be shared with the relevant recipient.
|
472
|
+
*
|
473
|
+
* If someone clicks the **Unsubscribe** button on the confirmation page,
|
474
|
+
* the recipient's `subscriptionStatus` is changed to `UNSUBSCRIBED`.
|
475
|
+
* @param - Email address the unsubscribe link is for.
|
476
|
+
*/
|
477
|
+
(emailAddress: string, options?: GenerateUnsubscribeLinkOptions | undefined): Promise<GenerateUnsubscribeLinkResponse & GenerateUnsubscribeLinkResponseNonNullableFields>;
|
230
478
|
}
|
231
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
232
|
-
type HttpResponse<T = any> = {
|
233
|
-
data: T;
|
234
|
-
status: number;
|
235
|
-
statusText: string;
|
236
|
-
headers: any;
|
237
|
-
request?: any;
|
238
|
-
};
|
239
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
240
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
241
|
-
url: string;
|
242
|
-
data?: Data;
|
243
|
-
params?: URLSearchParams;
|
244
|
-
} & APIMetadata;
|
245
|
-
type APIMetadata = {
|
246
|
-
methodFqn?: string;
|
247
|
-
entityFqdn?: string;
|
248
|
-
packageName?: string;
|
249
|
-
};
|
250
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
251
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
252
|
-
__type: 'event-definition';
|
253
|
-
type: Type;
|
254
|
-
isDomainEvent?: boolean;
|
255
|
-
transformations?: unknown;
|
256
|
-
__payload: Payload;
|
257
|
-
};
|
258
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
259
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
260
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
261
|
-
|
262
|
-
declare function queryEmailSubscriptions$1(httpClient: HttpClient): (filter: Record<string, any> | null, options?: QueryEmailSubscriptionsOptions) => Promise<QueryEmailSubscriptionsResponse & QueryEmailSubscriptionsResponseNonNullableFields>;
|
263
|
-
declare function upsertEmailSubscription$1(httpClient: HttpClient): (options?: UpsertEmailSubscriptionOptions) => Promise<UpsertEmailSubscriptionResponse & UpsertEmailSubscriptionResponseNonNullableFields>;
|
264
|
-
declare function bulkUpsertEmailSubscription$1(httpClient: HttpClient): (subscriptions: EmailSubscription[]) => Promise<BulkUpsertEmailSubscriptionResponse & BulkUpsertEmailSubscriptionResponseNonNullableFields>;
|
265
|
-
declare function generateUnsubscribeLink$1(httpClient: HttpClient): (emailAddress: string, options?: GenerateUnsubscribeLinkOptions) => Promise<GenerateUnsubscribeLinkResponse & GenerateUnsubscribeLinkResponseNonNullableFields>;
|
266
479
|
declare const onEmailsubscriptionEmailSubscriptionChanged$1: EventDefinition<EmailsubscriptionEmailSubscriptionChangedEnvelope, "com.wixpress.emailsubscriptions.v1.EmailSubscriptionChanged">;
|
267
480
|
|
268
|
-
declare
|
269
|
-
|
270
|
-
declare const
|
271
|
-
declare const
|
272
|
-
declare const
|
481
|
+
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
482
|
+
|
483
|
+
declare const queryEmailSubscriptions: BuildRESTFunction<typeof queryEmailSubscriptions$1> & typeof queryEmailSubscriptions$1;
|
484
|
+
declare const upsertEmailSubscription: BuildRESTFunction<typeof upsertEmailSubscription$1> & typeof upsertEmailSubscription$1;
|
485
|
+
declare const bulkUpsertEmailSubscription: BuildRESTFunction<typeof bulkUpsertEmailSubscription$1> & typeof bulkUpsertEmailSubscription$1;
|
486
|
+
declare const generateUnsubscribeLink: BuildRESTFunction<typeof generateUnsubscribeLink$1> & typeof generateUnsubscribeLink$1;
|
487
|
+
|
488
|
+
type _publicOnEmailsubscriptionEmailSubscriptionChangedType = typeof onEmailsubscriptionEmailSubscriptionChanged$1;
|
489
|
+
/** */
|
490
|
+
declare const onEmailsubscriptionEmailSubscriptionChanged: ReturnType<typeof createEventModule<_publicOnEmailsubscriptionEmailSubscriptionChangedType>>;
|
273
491
|
|
492
|
+
type context_ActionEvent = ActionEvent;
|
493
|
+
type context_BaseEventMetadata = BaseEventMetadata;
|
494
|
+
type context_BulkUpsertEmailSubscriptionRequest = BulkUpsertEmailSubscriptionRequest;
|
495
|
+
type context_BulkUpsertEmailSubscriptionResponse = BulkUpsertEmailSubscriptionResponse;
|
496
|
+
type context_BulkUpsertEmailSubscriptionResponseNonNullableFields = BulkUpsertEmailSubscriptionResponseNonNullableFields;
|
497
|
+
type context_BulkUpsertEmailSubscriptionResult = BulkUpsertEmailSubscriptionResult;
|
498
|
+
type context_ConfirmUnsubscribeActionRequest = ConfirmUnsubscribeActionRequest;
|
499
|
+
type context_DomainEvent = DomainEvent;
|
500
|
+
type context_DomainEventBodyOneOf = DomainEventBodyOneOf;
|
501
|
+
type context_EmailSubscription = EmailSubscription;
|
502
|
+
type context_EmailSubscriptionChanged = EmailSubscriptionChanged;
|
503
|
+
type context_EmailsubscriptionEmailSubscriptionChangedEnvelope = EmailsubscriptionEmailSubscriptionChangedEnvelope;
|
504
|
+
type context_Empty = Empty;
|
505
|
+
type context_EntityCreatedEvent = EntityCreatedEvent;
|
506
|
+
type context_EntityDeletedEvent = EntityDeletedEvent;
|
507
|
+
type context_EntityUpdatedEvent = EntityUpdatedEvent;
|
508
|
+
type context_Error = Error;
|
509
|
+
type context_GenerateUnsubscribeLinkOptions = GenerateUnsubscribeLinkOptions;
|
510
|
+
type context_GenerateUnsubscribeLinkRequest = GenerateUnsubscribeLinkRequest;
|
511
|
+
type context_GenerateUnsubscribeLinkResponse = GenerateUnsubscribeLinkResponse;
|
512
|
+
type context_GenerateUnsubscribeLinkResponseNonNullableFields = GenerateUnsubscribeLinkResponseNonNullableFields;
|
513
|
+
type context_GetEmailSubscriptionRequest = GetEmailSubscriptionRequest;
|
514
|
+
type context_GetEmailSubscriptionResponse = GetEmailSubscriptionResponse;
|
515
|
+
type context_HeadersEntry = HeadersEntry;
|
516
|
+
type context_IdentificationData = IdentificationData;
|
517
|
+
type context_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
|
518
|
+
type context_MessageEnvelope = MessageEnvelope;
|
519
|
+
type context_Metadata = Metadata;
|
520
|
+
type context_Paging = Paging;
|
521
|
+
type context_PagingMetadata = PagingMetadata;
|
522
|
+
type context_QueryEmailSubscriptionsOptions = QueryEmailSubscriptionsOptions;
|
523
|
+
type context_QueryEmailSubscriptionsRequest = QueryEmailSubscriptionsRequest;
|
524
|
+
type context_QueryEmailSubscriptionsResponse = QueryEmailSubscriptionsResponse;
|
525
|
+
type context_QueryEmailSubscriptionsResponseNonNullableFields = QueryEmailSubscriptionsResponseNonNullableFields;
|
526
|
+
type context_RawHttpResponse = RawHttpResponse;
|
527
|
+
type context_RenderUnsubscribePageRequest = RenderUnsubscribePageRequest;
|
528
|
+
type context_RestoreInfo = RestoreInfo;
|
529
|
+
type context_Status = Status;
|
530
|
+
declare const context_Status: typeof Status;
|
531
|
+
type context_SubscriptionEnumStatus = SubscriptionEnumStatus;
|
532
|
+
declare const context_SubscriptionEnumStatus: typeof SubscriptionEnumStatus;
|
533
|
+
type context_UpdateEmailSubscriptionRequest = UpdateEmailSubscriptionRequest;
|
534
|
+
type context_UpdateEmailSubscriptionResponse = UpdateEmailSubscriptionResponse;
|
535
|
+
type context_UpsertEmailSubscriptionOptions = UpsertEmailSubscriptionOptions;
|
536
|
+
type context_UpsertEmailSubscriptionRequest = UpsertEmailSubscriptionRequest;
|
537
|
+
type context_UpsertEmailSubscriptionResponse = UpsertEmailSubscriptionResponse;
|
538
|
+
type context_UpsertEmailSubscriptionResponseNonNullableFields = UpsertEmailSubscriptionResponseNonNullableFields;
|
539
|
+
type context_V1ConfirmUnsubscribeActionRequest = V1ConfirmUnsubscribeActionRequest;
|
540
|
+
type context_V1RenderUnsubscribePageRequest = V1RenderUnsubscribePageRequest;
|
541
|
+
type context_WebhookIdentityType = WebhookIdentityType;
|
542
|
+
declare const context_WebhookIdentityType: typeof WebhookIdentityType;
|
543
|
+
type context__publicOnEmailsubscriptionEmailSubscriptionChangedType = _publicOnEmailsubscriptionEmailSubscriptionChangedType;
|
274
544
|
declare const context_bulkUpsertEmailSubscription: typeof bulkUpsertEmailSubscription;
|
275
545
|
declare const context_generateUnsubscribeLink: typeof generateUnsubscribeLink;
|
276
546
|
declare const context_onEmailsubscriptionEmailSubscriptionChanged: typeof onEmailsubscriptionEmailSubscriptionChanged;
|
277
547
|
declare const context_queryEmailSubscriptions: typeof queryEmailSubscriptions;
|
278
548
|
declare const context_upsertEmailSubscription: typeof upsertEmailSubscription;
|
279
549
|
declare namespace context {
|
280
|
-
export { context_bulkUpsertEmailSubscription as bulkUpsertEmailSubscription, context_generateUnsubscribeLink as generateUnsubscribeLink, context_onEmailsubscriptionEmailSubscriptionChanged as onEmailsubscriptionEmailSubscriptionChanged, context_queryEmailSubscriptions as queryEmailSubscriptions, context_upsertEmailSubscription as upsertEmailSubscription };
|
550
|
+
export { type context_ActionEvent as ActionEvent, type context_BaseEventMetadata as BaseEventMetadata, type context_BulkUpsertEmailSubscriptionRequest as BulkUpsertEmailSubscriptionRequest, type context_BulkUpsertEmailSubscriptionResponse as BulkUpsertEmailSubscriptionResponse, type context_BulkUpsertEmailSubscriptionResponseNonNullableFields as BulkUpsertEmailSubscriptionResponseNonNullableFields, type context_BulkUpsertEmailSubscriptionResult as BulkUpsertEmailSubscriptionResult, type context_ConfirmUnsubscribeActionRequest as ConfirmUnsubscribeActionRequest, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_EmailSubscription as EmailSubscription, type context_EmailSubscriptionChanged as EmailSubscriptionChanged, type context_EmailsubscriptionEmailSubscriptionChangedEnvelope as EmailsubscriptionEmailSubscriptionChangedEnvelope, type context_Empty as Empty, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_Error as Error, type context_GenerateUnsubscribeLinkOptions as GenerateUnsubscribeLinkOptions, type context_GenerateUnsubscribeLinkRequest as GenerateUnsubscribeLinkRequest, type context_GenerateUnsubscribeLinkResponse as GenerateUnsubscribeLinkResponse, type context_GenerateUnsubscribeLinkResponseNonNullableFields as GenerateUnsubscribeLinkResponseNonNullableFields, type context_GetEmailSubscriptionRequest as GetEmailSubscriptionRequest, type context_GetEmailSubscriptionResponse as GetEmailSubscriptionResponse, type context_HeadersEntry as HeadersEntry, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type context_MessageEnvelope as MessageEnvelope, type context_Metadata as Metadata, type context_Paging as Paging, type context_PagingMetadata as PagingMetadata, type context_QueryEmailSubscriptionsOptions as QueryEmailSubscriptionsOptions, type context_QueryEmailSubscriptionsRequest as QueryEmailSubscriptionsRequest, type context_QueryEmailSubscriptionsResponse as QueryEmailSubscriptionsResponse, type context_QueryEmailSubscriptionsResponseNonNullableFields as QueryEmailSubscriptionsResponseNonNullableFields, type context_RawHttpResponse as RawHttpResponse, type context_RenderUnsubscribePageRequest as RenderUnsubscribePageRequest, type context_RestoreInfo as RestoreInfo, context_Status as Status, context_SubscriptionEnumStatus as SubscriptionEnumStatus, type context_UpdateEmailSubscriptionRequest as UpdateEmailSubscriptionRequest, type context_UpdateEmailSubscriptionResponse as UpdateEmailSubscriptionResponse, type context_UpsertEmailSubscriptionOptions as UpsertEmailSubscriptionOptions, type context_UpsertEmailSubscriptionRequest as UpsertEmailSubscriptionRequest, type context_UpsertEmailSubscriptionResponse as UpsertEmailSubscriptionResponse, type context_UpsertEmailSubscriptionResponseNonNullableFields as UpsertEmailSubscriptionResponseNonNullableFields, type context_V1ConfirmUnsubscribeActionRequest as V1ConfirmUnsubscribeActionRequest, type context_V1RenderUnsubscribePageRequest as V1RenderUnsubscribePageRequest, context_WebhookIdentityType as WebhookIdentityType, type context__publicOnEmailsubscriptionEmailSubscriptionChangedType as _publicOnEmailsubscriptionEmailSubscriptionChangedType, context_bulkUpsertEmailSubscription as bulkUpsertEmailSubscription, context_generateUnsubscribeLink as generateUnsubscribeLink, context_onEmailsubscriptionEmailSubscriptionChanged as onEmailsubscriptionEmailSubscriptionChanged, onEmailsubscriptionEmailSubscriptionChanged$1 as publicOnEmailsubscriptionEmailSubscriptionChanged, context_queryEmailSubscriptions as queryEmailSubscriptions, context_upsertEmailSubscription as upsertEmailSubscription };
|
281
551
|
}
|
282
552
|
|
283
553
|
export { context as emailSubscriptions };
|
@@ -1,3 +1,47 @@
|
|
1
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
2
|
+
interface HttpClient {
|
3
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
4
|
+
fetchWithAuth: typeof fetch;
|
5
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
6
|
+
}
|
7
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
8
|
+
type HttpResponse<T = any> = {
|
9
|
+
data: T;
|
10
|
+
status: number;
|
11
|
+
statusText: string;
|
12
|
+
headers: any;
|
13
|
+
request?: any;
|
14
|
+
};
|
15
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
16
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
17
|
+
url: string;
|
18
|
+
data?: Data;
|
19
|
+
params?: URLSearchParams;
|
20
|
+
} & APIMetadata;
|
21
|
+
type APIMetadata = {
|
22
|
+
methodFqn?: string;
|
23
|
+
entityFqdn?: string;
|
24
|
+
packageName?: string;
|
25
|
+
};
|
26
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
27
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
28
|
+
__type: 'event-definition';
|
29
|
+
type: Type;
|
30
|
+
isDomainEvent?: boolean;
|
31
|
+
transformations?: (envelope: unknown) => Payload;
|
32
|
+
__payload: Payload;
|
33
|
+
};
|
34
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
35
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
36
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
37
|
+
|
38
|
+
declare global {
|
39
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
40
|
+
interface SymbolConstructor {
|
41
|
+
readonly observable: symbol;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
1
45
|
interface EmailSubscription {
|
2
46
|
/**
|
3
47
|
* Email subscription ID.
|
@@ -256,6 +300,9 @@ interface DomainEventBodyOneOf {
|
|
256
300
|
interface EntityCreatedEvent {
|
257
301
|
entity?: string;
|
258
302
|
}
|
303
|
+
interface RestoreInfo {
|
304
|
+
deletedDate?: Date;
|
305
|
+
}
|
259
306
|
interface EntityUpdatedEvent {
|
260
307
|
/**
|
261
308
|
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
@@ -311,37 +358,33 @@ declare enum WebhookIdentityType {
|
|
311
358
|
WIX_USER = "WIX_USER",
|
312
359
|
APP = "APP"
|
313
360
|
}
|
361
|
+
interface EmailSubscriptionNonNullableFields {
|
362
|
+
email: string;
|
363
|
+
subscriptionStatus: SubscriptionEnumStatus;
|
364
|
+
deliverabilityStatus: Status;
|
365
|
+
}
|
314
366
|
interface QueryEmailSubscriptionsResponseNonNullableFields {
|
315
|
-
subscriptions:
|
316
|
-
email: string;
|
317
|
-
subscriptionStatus: SubscriptionEnumStatus;
|
318
|
-
deliverabilityStatus: Status;
|
319
|
-
}[];
|
367
|
+
subscriptions: EmailSubscriptionNonNullableFields[];
|
320
368
|
}
|
321
369
|
interface UpsertEmailSubscriptionResponseNonNullableFields {
|
322
|
-
subscription?:
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
370
|
+
subscription?: EmailSubscriptionNonNullableFields;
|
371
|
+
}
|
372
|
+
interface ErrorNonNullableFields {
|
373
|
+
errorCode: string;
|
374
|
+
message: string;
|
375
|
+
}
|
376
|
+
interface BulkUpsertEmailSubscriptionResultNonNullableFields {
|
377
|
+
originalIndex: number;
|
378
|
+
emailSubscription?: EmailSubscriptionNonNullableFields;
|
379
|
+
error?: ErrorNonNullableFields;
|
380
|
+
}
|
381
|
+
interface MetadataNonNullableFields {
|
382
|
+
totalSuccess: number;
|
383
|
+
totalFailure: number;
|
327
384
|
}
|
328
385
|
interface BulkUpsertEmailSubscriptionResponseNonNullableFields {
|
329
|
-
results:
|
330
|
-
|
331
|
-
emailSubscription?: {
|
332
|
-
email: string;
|
333
|
-
subscriptionStatus: SubscriptionEnumStatus;
|
334
|
-
deliverabilityStatus: Status;
|
335
|
-
};
|
336
|
-
error?: {
|
337
|
-
errorCode: string;
|
338
|
-
message: string;
|
339
|
-
};
|
340
|
-
}[];
|
341
|
-
metadata?: {
|
342
|
-
totalSuccess: number;
|
343
|
-
totalFailure: number;
|
344
|
-
};
|
386
|
+
results: BulkUpsertEmailSubscriptionResultNonNullableFields[];
|
387
|
+
metadata?: MetadataNonNullableFields;
|
345
388
|
}
|
346
389
|
interface GenerateUnsubscribeLinkResponseNonNullableFields {
|
347
390
|
link: string;
|
@@ -376,45 +419,75 @@ interface GenerateUnsubscribeLinkOptions {
|
|
376
419
|
language?: string | null;
|
377
420
|
}
|
378
421
|
|
379
|
-
|
380
|
-
|
422
|
+
declare function queryEmailSubscriptions$1(httpClient: HttpClient): QueryEmailSubscriptionsSignature;
|
423
|
+
interface QueryEmailSubscriptionsSignature {
|
424
|
+
/**
|
425
|
+
* Retrieves email subscriptions,
|
426
|
+
* given the provided paging, filtering, and sorting.
|
427
|
+
*
|
428
|
+
* Currently, querying is supported on the `email` field
|
429
|
+
* with the `$in` array filter.
|
430
|
+
* For example, to query for emails "me@my.com" and "you@your.org",
|
431
|
+
* the filter should be formed like this:
|
432
|
+
*
|
433
|
+
* ```json
|
434
|
+
* { "filter": {
|
435
|
+
* "email": {
|
436
|
+
* "$in": ["me@my.com", "you@your.org"]
|
437
|
+
* }
|
438
|
+
* }
|
439
|
+
* }
|
440
|
+
* ```
|
441
|
+
*
|
442
|
+
* To learn how to query email subscriptions, see
|
443
|
+
* [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
444
|
+
* @param - Filter options.
|
445
|
+
* Currently, querying is supported on the `email` field
|
446
|
+
* with the `$in` array filter.
|
447
|
+
*/
|
448
|
+
(filter: Record<string, any> | null, options?: QueryEmailSubscriptionsOptions | undefined): Promise<QueryEmailSubscriptionsResponse & QueryEmailSubscriptionsResponseNonNullableFields>;
|
381
449
|
}
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
450
|
+
declare function upsertEmailSubscription$1(httpClient: HttpClient): UpsertEmailSubscriptionSignature;
|
451
|
+
interface UpsertEmailSubscriptionSignature {
|
452
|
+
/**
|
453
|
+
* Updates or creates an email subscription for the requested email.
|
454
|
+
*
|
455
|
+
* An email subscription is always returned in the response,
|
456
|
+
* regardless of whether it was updated or created.
|
457
|
+
*/
|
458
|
+
(options?: UpsertEmailSubscriptionOptions | undefined): Promise<UpsertEmailSubscriptionResponse & UpsertEmailSubscriptionResponseNonNullableFields>;
|
459
|
+
}
|
460
|
+
declare function bulkUpsertEmailSubscription$1(httpClient: HttpClient): BulkUpsertEmailSubscriptionSignature;
|
461
|
+
interface BulkUpsertEmailSubscriptionSignature {
|
462
|
+
/**
|
463
|
+
* Updates or creates multiple email subscriptions.
|
464
|
+
* @param - List of email subscriptions to update or create.
|
465
|
+
*/
|
466
|
+
(subscriptions: EmailSubscription[]): Promise<BulkUpsertEmailSubscriptionResponse & BulkUpsertEmailSubscriptionResponseNonNullableFields>;
|
467
|
+
}
|
468
|
+
declare function generateUnsubscribeLink$1(httpClient: HttpClient): GenerateUnsubscribeLinkSignature;
|
469
|
+
interface GenerateUnsubscribeLinkSignature {
|
470
|
+
/**
|
471
|
+
* Creates an unsubscribe link to be shared with the relevant recipient.
|
472
|
+
*
|
473
|
+
* If someone clicks the **Unsubscribe** button on the confirmation page,
|
474
|
+
* the recipient's `subscriptionStatus` is changed to `UNSUBSCRIBED`.
|
475
|
+
* @param - Email address the unsubscribe link is for.
|
476
|
+
*/
|
477
|
+
(emailAddress: string, options?: GenerateUnsubscribeLinkOptions | undefined): Promise<GenerateUnsubscribeLinkResponse & GenerateUnsubscribeLinkResponseNonNullableFields>;
|
478
|
+
}
|
479
|
+
declare const onEmailsubscriptionEmailSubscriptionChanged$1: EventDefinition<EmailsubscriptionEmailSubscriptionChangedEnvelope, "com.wixpress.emailsubscriptions.v1.EmailSubscriptionChanged">;
|
409
480
|
|
410
|
-
declare
|
411
|
-
|
412
|
-
|
413
|
-
declare
|
414
|
-
declare
|
415
|
-
declare
|
416
|
-
|
417
|
-
|
481
|
+
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
482
|
+
|
483
|
+
declare const queryEmailSubscriptions: BuildRESTFunction<typeof queryEmailSubscriptions$1> & typeof queryEmailSubscriptions$1;
|
484
|
+
declare const upsertEmailSubscription: BuildRESTFunction<typeof upsertEmailSubscription$1> & typeof upsertEmailSubscription$1;
|
485
|
+
declare const bulkUpsertEmailSubscription: BuildRESTFunction<typeof bulkUpsertEmailSubscription$1> & typeof bulkUpsertEmailSubscription$1;
|
486
|
+
declare const generateUnsubscribeLink: BuildRESTFunction<typeof generateUnsubscribeLink$1> & typeof generateUnsubscribeLink$1;
|
487
|
+
|
488
|
+
type _publicOnEmailsubscriptionEmailSubscriptionChangedType = typeof onEmailsubscriptionEmailSubscriptionChanged$1;
|
489
|
+
/** */
|
490
|
+
declare const onEmailsubscriptionEmailSubscriptionChanged: ReturnType<typeof createEventModule<_publicOnEmailsubscriptionEmailSubscriptionChangedType>>;
|
418
491
|
|
419
492
|
type index_d_ActionEvent = ActionEvent;
|
420
493
|
type index_d_BaseEventMetadata = BaseEventMetadata;
|
@@ -452,6 +525,7 @@ type index_d_QueryEmailSubscriptionsResponse = QueryEmailSubscriptionsResponse;
|
|
452
525
|
type index_d_QueryEmailSubscriptionsResponseNonNullableFields = QueryEmailSubscriptionsResponseNonNullableFields;
|
453
526
|
type index_d_RawHttpResponse = RawHttpResponse;
|
454
527
|
type index_d_RenderUnsubscribePageRequest = RenderUnsubscribePageRequest;
|
528
|
+
type index_d_RestoreInfo = RestoreInfo;
|
455
529
|
type index_d_Status = Status;
|
456
530
|
declare const index_d_Status: typeof Status;
|
457
531
|
type index_d_SubscriptionEnumStatus = SubscriptionEnumStatus;
|
@@ -466,14 +540,14 @@ type index_d_V1ConfirmUnsubscribeActionRequest = V1ConfirmUnsubscribeActionReque
|
|
466
540
|
type index_d_V1RenderUnsubscribePageRequest = V1RenderUnsubscribePageRequest;
|
467
541
|
type index_d_WebhookIdentityType = WebhookIdentityType;
|
468
542
|
declare const index_d_WebhookIdentityType: typeof WebhookIdentityType;
|
469
|
-
|
543
|
+
type index_d__publicOnEmailsubscriptionEmailSubscriptionChangedType = _publicOnEmailsubscriptionEmailSubscriptionChangedType;
|
470
544
|
declare const index_d_bulkUpsertEmailSubscription: typeof bulkUpsertEmailSubscription;
|
471
545
|
declare const index_d_generateUnsubscribeLink: typeof generateUnsubscribeLink;
|
472
546
|
declare const index_d_onEmailsubscriptionEmailSubscriptionChanged: typeof onEmailsubscriptionEmailSubscriptionChanged;
|
473
547
|
declare const index_d_queryEmailSubscriptions: typeof queryEmailSubscriptions;
|
474
548
|
declare const index_d_upsertEmailSubscription: typeof upsertEmailSubscription;
|
475
549
|
declare namespace index_d {
|
476
|
-
export { type index_d_ActionEvent as ActionEvent, type index_d_BaseEventMetadata as BaseEventMetadata, type index_d_BulkUpsertEmailSubscriptionRequest as BulkUpsertEmailSubscriptionRequest, type index_d_BulkUpsertEmailSubscriptionResponse as BulkUpsertEmailSubscriptionResponse, type index_d_BulkUpsertEmailSubscriptionResponseNonNullableFields as BulkUpsertEmailSubscriptionResponseNonNullableFields, type index_d_BulkUpsertEmailSubscriptionResult as BulkUpsertEmailSubscriptionResult, type index_d_ConfirmUnsubscribeActionRequest as ConfirmUnsubscribeActionRequest, type index_d_DomainEvent as DomainEvent, type index_d_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d_EmailSubscription as EmailSubscription, type index_d_EmailSubscriptionChanged as EmailSubscriptionChanged, type index_d_EmailsubscriptionEmailSubscriptionChangedEnvelope as EmailsubscriptionEmailSubscriptionChangedEnvelope, type index_d_Empty as Empty, type index_d_EntityCreatedEvent as EntityCreatedEvent, type index_d_EntityDeletedEvent as EntityDeletedEvent, type index_d_EntityUpdatedEvent as EntityUpdatedEvent, type index_d_Error as Error, type index_d_GenerateUnsubscribeLinkOptions as GenerateUnsubscribeLinkOptions, type index_d_GenerateUnsubscribeLinkRequest as GenerateUnsubscribeLinkRequest, type index_d_GenerateUnsubscribeLinkResponse as GenerateUnsubscribeLinkResponse, type index_d_GenerateUnsubscribeLinkResponseNonNullableFields as GenerateUnsubscribeLinkResponseNonNullableFields, type index_d_GetEmailSubscriptionRequest as GetEmailSubscriptionRequest, type index_d_GetEmailSubscriptionResponse as GetEmailSubscriptionResponse, type index_d_HeadersEntry as HeadersEntry, type index_d_IdentificationData as IdentificationData, type index_d_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d_MessageEnvelope as MessageEnvelope, type index_d_Metadata as Metadata, type index_d_Paging as Paging, type index_d_PagingMetadata as PagingMetadata, type index_d_QueryEmailSubscriptionsOptions as QueryEmailSubscriptionsOptions, type index_d_QueryEmailSubscriptionsRequest as QueryEmailSubscriptionsRequest, type index_d_QueryEmailSubscriptionsResponse as QueryEmailSubscriptionsResponse, type index_d_QueryEmailSubscriptionsResponseNonNullableFields as QueryEmailSubscriptionsResponseNonNullableFields, type index_d_RawHttpResponse as RawHttpResponse, type index_d_RenderUnsubscribePageRequest as RenderUnsubscribePageRequest, index_d_Status as Status, index_d_SubscriptionEnumStatus as SubscriptionEnumStatus, type index_d_UpdateEmailSubscriptionRequest as UpdateEmailSubscriptionRequest, type index_d_UpdateEmailSubscriptionResponse as UpdateEmailSubscriptionResponse, type index_d_UpsertEmailSubscriptionOptions as UpsertEmailSubscriptionOptions, type index_d_UpsertEmailSubscriptionRequest as UpsertEmailSubscriptionRequest, type index_d_UpsertEmailSubscriptionResponse as UpsertEmailSubscriptionResponse, type index_d_UpsertEmailSubscriptionResponseNonNullableFields as UpsertEmailSubscriptionResponseNonNullableFields, type index_d_V1ConfirmUnsubscribeActionRequest as V1ConfirmUnsubscribeActionRequest, type index_d_V1RenderUnsubscribePageRequest as V1RenderUnsubscribePageRequest, index_d_WebhookIdentityType as WebhookIdentityType,
|
550
|
+
export { type index_d_ActionEvent as ActionEvent, type index_d_BaseEventMetadata as BaseEventMetadata, type index_d_BulkUpsertEmailSubscriptionRequest as BulkUpsertEmailSubscriptionRequest, type index_d_BulkUpsertEmailSubscriptionResponse as BulkUpsertEmailSubscriptionResponse, type index_d_BulkUpsertEmailSubscriptionResponseNonNullableFields as BulkUpsertEmailSubscriptionResponseNonNullableFields, type index_d_BulkUpsertEmailSubscriptionResult as BulkUpsertEmailSubscriptionResult, type index_d_ConfirmUnsubscribeActionRequest as ConfirmUnsubscribeActionRequest, type index_d_DomainEvent as DomainEvent, type index_d_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d_EmailSubscription as EmailSubscription, type index_d_EmailSubscriptionChanged as EmailSubscriptionChanged, type index_d_EmailsubscriptionEmailSubscriptionChangedEnvelope as EmailsubscriptionEmailSubscriptionChangedEnvelope, type index_d_Empty as Empty, type index_d_EntityCreatedEvent as EntityCreatedEvent, type index_d_EntityDeletedEvent as EntityDeletedEvent, type index_d_EntityUpdatedEvent as EntityUpdatedEvent, type index_d_Error as Error, type index_d_GenerateUnsubscribeLinkOptions as GenerateUnsubscribeLinkOptions, type index_d_GenerateUnsubscribeLinkRequest as GenerateUnsubscribeLinkRequest, type index_d_GenerateUnsubscribeLinkResponse as GenerateUnsubscribeLinkResponse, type index_d_GenerateUnsubscribeLinkResponseNonNullableFields as GenerateUnsubscribeLinkResponseNonNullableFields, type index_d_GetEmailSubscriptionRequest as GetEmailSubscriptionRequest, type index_d_GetEmailSubscriptionResponse as GetEmailSubscriptionResponse, type index_d_HeadersEntry as HeadersEntry, type index_d_IdentificationData as IdentificationData, type index_d_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d_MessageEnvelope as MessageEnvelope, type index_d_Metadata as Metadata, type index_d_Paging as Paging, type index_d_PagingMetadata as PagingMetadata, type index_d_QueryEmailSubscriptionsOptions as QueryEmailSubscriptionsOptions, type index_d_QueryEmailSubscriptionsRequest as QueryEmailSubscriptionsRequest, type index_d_QueryEmailSubscriptionsResponse as QueryEmailSubscriptionsResponse, type index_d_QueryEmailSubscriptionsResponseNonNullableFields as QueryEmailSubscriptionsResponseNonNullableFields, type index_d_RawHttpResponse as RawHttpResponse, type index_d_RenderUnsubscribePageRequest as RenderUnsubscribePageRequest, type index_d_RestoreInfo as RestoreInfo, index_d_Status as Status, index_d_SubscriptionEnumStatus as SubscriptionEnumStatus, type index_d_UpdateEmailSubscriptionRequest as UpdateEmailSubscriptionRequest, type index_d_UpdateEmailSubscriptionResponse as UpdateEmailSubscriptionResponse, type index_d_UpsertEmailSubscriptionOptions as UpsertEmailSubscriptionOptions, type index_d_UpsertEmailSubscriptionRequest as UpsertEmailSubscriptionRequest, type index_d_UpsertEmailSubscriptionResponse as UpsertEmailSubscriptionResponse, type index_d_UpsertEmailSubscriptionResponseNonNullableFields as UpsertEmailSubscriptionResponseNonNullableFields, type index_d_V1ConfirmUnsubscribeActionRequest as V1ConfirmUnsubscribeActionRequest, type index_d_V1RenderUnsubscribePageRequest as V1RenderUnsubscribePageRequest, index_d_WebhookIdentityType as WebhookIdentityType, type index_d__publicOnEmailsubscriptionEmailSubscriptionChangedType as _publicOnEmailsubscriptionEmailSubscriptionChangedType, index_d_bulkUpsertEmailSubscription as bulkUpsertEmailSubscription, index_d_generateUnsubscribeLink as generateUnsubscribeLink, index_d_onEmailsubscriptionEmailSubscriptionChanged as onEmailsubscriptionEmailSubscriptionChanged, onEmailsubscriptionEmailSubscriptionChanged$1 as publicOnEmailsubscriptionEmailSubscriptionChanged, index_d_queryEmailSubscriptions as queryEmailSubscriptions, index_d_upsertEmailSubscription as upsertEmailSubscription };
|
477
551
|
}
|
478
552
|
|
479
553
|
export { index_d as emailSubscriptions };
|
@@ -154,37 +154,33 @@ interface GenerateUnsubscribeLinkResponse$1 {
|
|
154
154
|
/** The unsubscribe link. */
|
155
155
|
link?: string;
|
156
156
|
}
|
157
|
+
interface EmailSubscriptionNonNullableFields$1 {
|
158
|
+
email: string;
|
159
|
+
subscriptionStatus: SubscriptionEnumStatus$1;
|
160
|
+
deliverabilityStatus: Status$1;
|
161
|
+
}
|
157
162
|
interface QueryEmailSubscriptionsResponseNonNullableFields$1 {
|
158
|
-
subscriptions:
|
159
|
-
email: string;
|
160
|
-
subscriptionStatus: SubscriptionEnumStatus$1;
|
161
|
-
deliverabilityStatus: Status$1;
|
162
|
-
}[];
|
163
|
+
subscriptions: EmailSubscriptionNonNullableFields$1[];
|
163
164
|
}
|
164
165
|
interface UpsertEmailSubscriptionResponseNonNullableFields$1 {
|
165
|
-
subscription?:
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
166
|
+
subscription?: EmailSubscriptionNonNullableFields$1;
|
167
|
+
}
|
168
|
+
interface ErrorNonNullableFields$1 {
|
169
|
+
errorCode: string;
|
170
|
+
message: string;
|
171
|
+
}
|
172
|
+
interface BulkUpsertEmailSubscriptionResultNonNullableFields$1 {
|
173
|
+
originalIndex: number;
|
174
|
+
emailSubscription?: EmailSubscriptionNonNullableFields$1;
|
175
|
+
error?: ErrorNonNullableFields$1;
|
176
|
+
}
|
177
|
+
interface MetadataNonNullableFields$1 {
|
178
|
+
totalSuccess: number;
|
179
|
+
totalFailure: number;
|
170
180
|
}
|
171
181
|
interface BulkUpsertEmailSubscriptionResponseNonNullableFields$1 {
|
172
|
-
results:
|
173
|
-
|
174
|
-
emailSubscription?: {
|
175
|
-
email: string;
|
176
|
-
subscriptionStatus: SubscriptionEnumStatus$1;
|
177
|
-
deliverabilityStatus: Status$1;
|
178
|
-
};
|
179
|
-
error?: {
|
180
|
-
errorCode: string;
|
181
|
-
message: string;
|
182
|
-
};
|
183
|
-
}[];
|
184
|
-
metadata?: {
|
185
|
-
totalSuccess: number;
|
186
|
-
totalFailure: number;
|
187
|
-
};
|
182
|
+
results: BulkUpsertEmailSubscriptionResultNonNullableFields$1[];
|
183
|
+
metadata?: MetadataNonNullableFields$1;
|
188
184
|
}
|
189
185
|
interface GenerateUnsubscribeLinkResponseNonNullableFields$1 {
|
190
186
|
link: string;
|
@@ -346,37 +342,33 @@ interface GenerateUnsubscribeLinkResponse {
|
|
346
342
|
/** The unsubscribe link. */
|
347
343
|
link?: string;
|
348
344
|
}
|
345
|
+
interface EmailSubscriptionNonNullableFields {
|
346
|
+
email: string;
|
347
|
+
subscriptionStatus: SubscriptionEnumStatus;
|
348
|
+
deliverabilityStatus: Status;
|
349
|
+
}
|
349
350
|
interface QueryEmailSubscriptionsResponseNonNullableFields {
|
350
|
-
subscriptions:
|
351
|
-
email: string;
|
352
|
-
subscriptionStatus: SubscriptionEnumStatus;
|
353
|
-
deliverabilityStatus: Status;
|
354
|
-
}[];
|
351
|
+
subscriptions: EmailSubscriptionNonNullableFields[];
|
355
352
|
}
|
356
353
|
interface UpsertEmailSubscriptionResponseNonNullableFields {
|
357
|
-
subscription?:
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
354
|
+
subscription?: EmailSubscriptionNonNullableFields;
|
355
|
+
}
|
356
|
+
interface ErrorNonNullableFields {
|
357
|
+
errorCode: string;
|
358
|
+
message: string;
|
359
|
+
}
|
360
|
+
interface BulkUpsertEmailSubscriptionResultNonNullableFields {
|
361
|
+
originalIndex: number;
|
362
|
+
emailSubscription?: EmailSubscriptionNonNullableFields;
|
363
|
+
error?: ErrorNonNullableFields;
|
364
|
+
}
|
365
|
+
interface MetadataNonNullableFields {
|
366
|
+
totalSuccess: number;
|
367
|
+
totalFailure: number;
|
362
368
|
}
|
363
369
|
interface BulkUpsertEmailSubscriptionResponseNonNullableFields {
|
364
|
-
results:
|
365
|
-
|
366
|
-
emailSubscription?: {
|
367
|
-
email: string;
|
368
|
-
subscriptionStatus: SubscriptionEnumStatus;
|
369
|
-
deliverabilityStatus: Status;
|
370
|
-
};
|
371
|
-
error?: {
|
372
|
-
errorCode: string;
|
373
|
-
message: string;
|
374
|
-
};
|
375
|
-
}[];
|
376
|
-
metadata?: {
|
377
|
-
totalSuccess: number;
|
378
|
-
totalFailure: number;
|
379
|
-
};
|
370
|
+
results: BulkUpsertEmailSubscriptionResultNonNullableFields[];
|
371
|
+
metadata?: MetadataNonNullableFields;
|
380
372
|
}
|
381
373
|
interface GenerateUnsubscribeLinkResponseNonNullableFields {
|
382
374
|
link: string;
|