@wix/email-subscriptions 1.0.13 → 1.0.16

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 (59) hide show
  1. package/build/cjs/context.d.ts +1 -0
  2. package/build/cjs/{index.typings.js → context.js} +2 -2
  3. package/build/cjs/context.js.map +1 -0
  4. package/build/cjs/index.d.ts +1 -1
  5. package/build/cjs/index.js +1 -1
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +1 -1
  8. package/build/cjs/meta.js +1 -1
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +1 -0
  11. package/build/es/context.js +2 -0
  12. package/build/es/context.js.map +1 -0
  13. package/build/es/index.d.ts +1 -1
  14. package/build/es/index.js +1 -1
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +1 -1
  17. package/build/es/meta.js +1 -1
  18. package/build/es/meta.js.map +1 -1
  19. package/context/package.json +7 -0
  20. package/meta/package.json +2 -1
  21. package/package.json +19 -9
  22. package/type-bundles/context.bundle.d.ts +283 -0
  23. package/type-bundles/index.bundle.d.ts +479 -0
  24. package/type-bundles/meta.bundle.d.ts +409 -0
  25. package/build/cjs/index.typings.d.ts +0 -1
  26. package/build/cjs/index.typings.js.map +0 -1
  27. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.http.d.ts +0 -40
  28. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.http.js +0 -204
  29. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.http.js.map +0 -1
  30. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.meta.d.ts +0 -16
  31. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.meta.js +0 -104
  32. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.meta.js.map +0 -1
  33. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.public.d.ts +0 -11
  34. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.public.js +0 -33
  35. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.public.js.map +0 -1
  36. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.types.d.ts +0 -298
  37. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.types.js +0 -28
  38. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.types.js.map +0 -1
  39. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.universal.d.ts +0 -390
  40. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.universal.js +0 -343
  41. package/build/cjs/src/emailsubscriptions-v1-emailsubscription.universal.js.map +0 -1
  42. package/build/es/index.typings.d.ts +0 -1
  43. package/build/es/index.typings.js +0 -2
  44. package/build/es/index.typings.js.map +0 -1
  45. package/build/es/src/emailsubscriptions-v1-emailsubscription.http.d.ts +0 -40
  46. package/build/es/src/emailsubscriptions-v1-emailsubscription.http.js +0 -197
  47. package/build/es/src/emailsubscriptions-v1-emailsubscription.http.js.map +0 -1
  48. package/build/es/src/emailsubscriptions-v1-emailsubscription.meta.d.ts +0 -16
  49. package/build/es/src/emailsubscriptions-v1-emailsubscription.meta.js +0 -74
  50. package/build/es/src/emailsubscriptions-v1-emailsubscription.meta.js.map +0 -1
  51. package/build/es/src/emailsubscriptions-v1-emailsubscription.public.d.ts +0 -11
  52. package/build/es/src/emailsubscriptions-v1-emailsubscription.public.js +0 -24
  53. package/build/es/src/emailsubscriptions-v1-emailsubscription.public.js.map +0 -1
  54. package/build/es/src/emailsubscriptions-v1-emailsubscription.types.d.ts +0 -298
  55. package/build/es/src/emailsubscriptions-v1-emailsubscription.types.js +0 -25
  56. package/build/es/src/emailsubscriptions-v1-emailsubscription.types.js.map +0 -1
  57. package/build/es/src/emailsubscriptions-v1-emailsubscription.universal.d.ts +0 -390
  58. package/build/es/src/emailsubscriptions-v1-emailsubscription.universal.js +0 -313
  59. package/build/es/src/emailsubscriptions-v1-emailsubscription.universal.js.map +0 -1
@@ -1,390 +0,0 @@
1
- export declare const __debug: {
2
- verboseLogging: {
3
- on: () => boolean;
4
- off: () => boolean;
5
- };
6
- };
7
- export interface EmailSubscription {
8
- /**
9
- * Email subscription ID.
10
- * @readonly
11
- */
12
- _id?: string | null;
13
- /** Email address. */
14
- email?: string;
15
- /**
16
- * Indicates the recipient's opt-in or opt-out status
17
- * for marketing emails.
18
- *
19
- * - `NOT_SET`: No status specified. This is the default, initial value before any info about the email address is known.
20
- * - `PENDING`: Subscription confirmation was requested,
21
- * but recipient hasn't confirmed yet.
22
- * - `SUBSCRIBED`: Recipient has opted in to marketing emails.
23
- * - `UNSUBSCRIBED`: Recipient has opted out of marketing emails.
24
- *
25
- * Defaults to `NOT_SET`.
26
- */
27
- subscriptionStatus?: SubscriptionEnumStatus;
28
- /**
29
- * Indicates last reported status of sent emails.
30
- *
31
- * - `NOT_SET`: No status specified. This is the default, initial value before any info about the email address is known.
32
- * - `VALID`: Emails to this email address are being delivered successfully.
33
- * - `BOUNCED`: The last email to the recipient bounced or was rejected.
34
- * - `SPAM_COMPLAINT`: The recipient registered a spam complaint
35
- * with their email provider.
36
- * - `INACTIVE`: Multiple campaigns have been delivered to this address without any engagement from the recipient. (No emails were opened and no content was clicked.)
37
- * This status might impact subsequent emails sent to this address.
38
- *
39
- * Defaults to `NOT_SET`.
40
- */
41
- deliverabilityStatus?: Status;
42
- /**
43
- * Date and time the email subscription was created.
44
- * @readonly
45
- */
46
- _createdDate?: Date;
47
- /**
48
- * Date and time the email subscription was last updated.
49
- * @readonly
50
- */
51
- _updatedDate?: Date;
52
- }
53
- export declare enum SubscriptionEnumStatus {
54
- UNKNOWN = "UNKNOWN",
55
- /** No Subscription exists */
56
- NOT_SET = "NOT_SET",
57
- /** Pending Subscription */
58
- PENDING = "PENDING",
59
- /** Subscribed */
60
- SUBSCRIBED = "SUBSCRIBED",
61
- /** UnSubscribed */
62
- UNSUBSCRIBED = "UNSUBSCRIBED"
63
- }
64
- export declare enum Status {
65
- NOT_SET = "NOT_SET",
66
- /** valid/deferral */
67
- VALID = "VALID",
68
- /** bounced/rejected/invalid */
69
- BOUNCED = "BOUNCED",
70
- /** spam/complaint */
71
- SPAM_COMPLAINT = "SPAM_COMPLAINT",
72
- /** valid, but no activity reported */
73
- INACTIVE = "INACTIVE"
74
- }
75
- export interface EmailSubscriptionChanged {
76
- /** subscription */
77
- subscription?: EmailSubscription;
78
- }
79
- export interface GetEmailSubscriptionRequest {
80
- _id?: string;
81
- }
82
- export interface GetEmailSubscriptionResponse {
83
- /** Returned email subscription */
84
- emailSubscription?: EmailSubscription;
85
- }
86
- export interface UpdateEmailSubscriptionRequest {
87
- /** Email subscription to update */
88
- subscription?: EmailSubscription;
89
- }
90
- export interface UpdateEmailSubscriptionResponse {
91
- /** Updated email subscription */
92
- subscription?: EmailSubscription;
93
- }
94
- export interface QueryEmailSubscriptionsRequest {
95
- /**
96
- * Filter options.
97
- * Currently, querying is supported on the `email` field
98
- * with the `$in` array filter.
99
- */
100
- filter: Record<string, any> | null;
101
- /**
102
- * Pagination options. For more information, see
103
- * [Pagination](https://dev.wix.com/api/rest/getting-started/pagination).
104
- */
105
- paging?: Paging;
106
- }
107
- export interface Paging {
108
- /** Number of items to load. */
109
- limit?: number | null;
110
- /** Number of items to skip in the current sort order. */
111
- offset?: number | null;
112
- }
113
- export interface QueryEmailSubscriptionsResponse {
114
- /** List of subscribed emails that matched the query options. */
115
- subscriptions?: EmailSubscription[];
116
- /** Metadata for the paginated results. */
117
- metadata?: PagingMetadata;
118
- }
119
- export interface PagingMetadata {
120
- /** Number of items returned in the response. */
121
- count?: number | null;
122
- /** Offset that was requested. */
123
- offset?: number | null;
124
- /** Total number of items that match the query. */
125
- total?: number | null;
126
- /** Flag that indicates the server failed to calculate the `total` field. */
127
- tooManyToCount?: boolean | null;
128
- }
129
- export interface UpsertEmailSubscriptionRequest {
130
- /** Email subscription to update or create. */
131
- subscription?: EmailSubscription;
132
- }
133
- export interface UpsertEmailSubscriptionResponse {
134
- /** Updated or created email subscription. */
135
- subscription?: EmailSubscription;
136
- }
137
- export interface BulkUpsertEmailSubscriptionRequest {
138
- /** List of email subscriptions to update or create. */
139
- subscriptions: EmailSubscription[];
140
- }
141
- export interface BulkUpsertEmailSubscriptionResponse {
142
- /** List of updated or created email subscriptions. */
143
- results?: BulkUpsertEmailSubscriptionResult[];
144
- /** Numbers of successful and failed actions. */
145
- metadata?: Metadata;
146
- }
147
- export interface BulkUpsertEmailSubscriptionResult {
148
- /** Position of the requested email subscription in the bulk array. */
149
- originalIndex?: number;
150
- /** New or updated email subscription. */
151
- emailSubscription?: EmailSubscription;
152
- /**
153
- * Error information if the action failed.
154
- * Omitted from successful actions.
155
- */
156
- error?: Error;
157
- }
158
- export interface Error {
159
- /** Error code. */
160
- errorCode?: string;
161
- /** Message that contains details about the error. */
162
- message?: string;
163
- }
164
- export interface Metadata {
165
- /** Number of successful actions. */
166
- totalSuccess?: number;
167
- /** Number of failed actions. */
168
- totalFailure?: number;
169
- }
170
- export interface GenerateUnsubscribeLinkRequest {
171
- /** Email address the unsubscribe link is for. */
172
- emailAddress: string;
173
- /** Arbitrary parameters for closing-the-loop. */
174
- metadata?: Record<string, string>;
175
- /** Language for displaying unsubscribe confirmation page (optional - default EN). */
176
- language?: string | null;
177
- }
178
- export interface GenerateUnsubscribeLinkResponse {
179
- /** The unsubscribe link. */
180
- link?: string;
181
- }
182
- export interface RenderUnsubscribePageRequest {
183
- /** Payload */
184
- payload?: string;
185
- /** Language */
186
- language?: string | null;
187
- }
188
- export interface RawHttpResponse {
189
- body?: Uint8Array;
190
- statusCode?: number | null;
191
- headers?: HeadersEntry[];
192
- }
193
- export interface HeadersEntry {
194
- key?: string;
195
- value?: string;
196
- }
197
- export interface ConfirmUnsubscribeActionRequest {
198
- /** Payload */
199
- payload?: string;
200
- }
201
- export interface Empty {
202
- }
203
- export interface DomainEvent extends DomainEventBodyOneOf {
204
- createdEvent?: EntityCreatedEvent;
205
- updatedEvent?: EntityUpdatedEvent;
206
- deletedEvent?: EntityDeletedEvent;
207
- actionEvent?: ActionEvent;
208
- /**
209
- * Unique event ID.
210
- * Allows clients to ignore duplicate webhooks.
211
- */
212
- _id?: string;
213
- /**
214
- * Assumes actions are also always typed to an entity_type
215
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
216
- */
217
- entityFqdn?: string;
218
- /**
219
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
220
- * This is although the created/updated/deleted notion is duplication of the oneof types
221
- * Example: created/updated/deleted/started/completed/email_opened
222
- */
223
- slug?: string;
224
- /** ID of the entity associated with the event. */
225
- entityId?: string;
226
- /** Event timestamp. */
227
- eventTime?: Date;
228
- /**
229
- * Whether the event was triggered as a result of a privacy regulation application
230
- * (for example, GDPR).
231
- */
232
- triggeredByAnonymizeRequest?: boolean | null;
233
- /** If present, indicates the action that triggered the event. */
234
- originatedFrom?: string | null;
235
- /**
236
- * A sequence number defining the order of updates to the underlying entity.
237
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
238
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
239
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
240
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
241
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
242
- */
243
- entityEventSequence?: string | null;
244
- }
245
- /** @oneof */
246
- export interface DomainEventBodyOneOf {
247
- createdEvent?: EntityCreatedEvent;
248
- updatedEvent?: EntityUpdatedEvent;
249
- deletedEvent?: EntityDeletedEvent;
250
- actionEvent?: ActionEvent;
251
- }
252
- export interface EntityCreatedEvent {
253
- entityAsJson?: string;
254
- }
255
- export interface EntityUpdatedEvent {
256
- /**
257
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
258
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
259
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
260
- */
261
- currentEntityAsJson?: string;
262
- }
263
- export interface EntityDeletedEvent {
264
- /** Entity that was deleted */
265
- deletedEntityAsJson?: string | null;
266
- }
267
- export interface ActionEvent {
268
- bodyAsJson?: string;
269
- }
270
- export interface QueryEmailSubscriptionsResponseNonNullableFields {
271
- subscriptions: {
272
- email: string;
273
- subscriptionStatus: SubscriptionEnumStatus;
274
- deliverabilityStatus: Status;
275
- }[];
276
- }
277
- export interface UpsertEmailSubscriptionResponseNonNullableFields {
278
- subscription?: {
279
- email: string;
280
- subscriptionStatus: SubscriptionEnumStatus;
281
- deliverabilityStatus: Status;
282
- };
283
- }
284
- export interface BulkUpsertEmailSubscriptionResponseNonNullableFields {
285
- results: {
286
- originalIndex: number;
287
- emailSubscription?: {
288
- email: string;
289
- subscriptionStatus: SubscriptionEnumStatus;
290
- deliverabilityStatus: Status;
291
- };
292
- error?: {
293
- errorCode: string;
294
- message: string;
295
- };
296
- }[];
297
- metadata?: {
298
- totalSuccess: number;
299
- totalFailure: number;
300
- };
301
- }
302
- export interface GenerateUnsubscribeLinkResponseNonNullableFields {
303
- link: string;
304
- }
305
- /**
306
- * Retrieves email subscriptions,
307
- * given the provided paging, filtering, and sorting.
308
- *
309
- * Currently, querying is supported on the `email` field
310
- * with the `$in` array filter.
311
- * For example, to query for emails "me@my.com" and "you@your.org",
312
- * the filter should be formed like this:
313
- *
314
- * ```json
315
- * { "filter": {
316
- * "email": {
317
- * "$in": ["me@my.com", "you@your.org"]
318
- * }
319
- * }
320
- * }
321
- * ```
322
- *
323
- * To learn how to query email subscriptions, see
324
- * [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
325
- * @param filter - Filter options.
326
- * Currently, querying is supported on the `email` field
327
- * with the `$in` array filter.
328
- * @public
329
- * @documentationMaturity preview
330
- * @requiredField filter
331
- * @permissionScope Manage Email Subscriptions
332
- * @permissionScopeId SCOPE.DC-MANAGE.EMAIL-SUBSCRIPTIONS
333
- * @applicableIdentity APP
334
- */
335
- export declare function queryEmailSubscriptions(filter: Record<string, any> | null, options?: QueryEmailSubscriptionsOptions): Promise<QueryEmailSubscriptionsResponse & QueryEmailSubscriptionsResponseNonNullableFields>;
336
- export interface QueryEmailSubscriptionsOptions {
337
- /**
338
- * Pagination options. For more information, see
339
- * [Pagination](https://dev.wix.com/api/rest/getting-started/pagination).
340
- */
341
- paging?: Paging;
342
- }
343
- /**
344
- * Updates or creates an email subscription for the requested email.
345
- *
346
- * An email subscription is always returned in the response,
347
- * regardless of whether it was updated or created.
348
- * @public
349
- * @documentationMaturity preview
350
- * @requiredField options.subscription.email
351
- * @permissionScope Manage Email Subscriptions
352
- * @permissionScopeId SCOPE.DC-MANAGE.EMAIL-SUBSCRIPTIONS
353
- * @applicableIdentity APP
354
- */
355
- export declare function upsertEmailSubscription(options?: UpsertEmailSubscriptionOptions): Promise<UpsertEmailSubscriptionResponse & UpsertEmailSubscriptionResponseNonNullableFields>;
356
- export interface UpsertEmailSubscriptionOptions {
357
- /** Email subscription to update or create. */
358
- subscription?: EmailSubscription;
359
- }
360
- /**
361
- * Updates or creates multiple email subscriptions.
362
- * @param subscriptions - List of email subscriptions to update or create.
363
- * @public
364
- * @documentationMaturity preview
365
- * @requiredField subscriptions
366
- * @permissionScope Manage Email Subscriptions
367
- * @permissionScopeId SCOPE.DC-MANAGE.EMAIL-SUBSCRIPTIONS
368
- * @applicableIdentity APP
369
- */
370
- export declare function bulkUpsertEmailSubscription(subscriptions: EmailSubscription[]): Promise<BulkUpsertEmailSubscriptionResponse & BulkUpsertEmailSubscriptionResponseNonNullableFields>;
371
- /**
372
- * Creates an unsubscribe link to be shared with the relevant recipient.
373
- *
374
- * If someone clicks the **Unsubscribe** button on the confirmation page,
375
- * the recipient's `subscriptionStatus` is changed to `UNSUBSCRIBED`.
376
- * @param emailAddress - Email address the unsubscribe link is for.
377
- * @public
378
- * @documentationMaturity preview
379
- * @requiredField emailAddress
380
- * @permissionScope Manage Email Subscriptions
381
- * @permissionScopeId SCOPE.DC-MANAGE.EMAIL-SUBSCRIPTIONS
382
- * @applicableIdentity APP
383
- */
384
- export declare function generateUnsubscribeLink(emailAddress: string, options?: GenerateUnsubscribeLinkOptions): Promise<GenerateUnsubscribeLinkResponse & GenerateUnsubscribeLinkResponseNonNullableFields>;
385
- export interface GenerateUnsubscribeLinkOptions {
386
- /** Arbitrary parameters for closing-the-loop. */
387
- metadata?: Record<string, string>;
388
- /** Language for displaying unsubscribe confirmation page (optional - default EN). */
389
- language?: string | null;
390
- }