@wix/auto_sdk_seo_redirects 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/build/cjs/index.d.ts +159 -0
  2. package/build/cjs/index.js +524 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +787 -0
  5. package/build/cjs/index.typings.js +443 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +573 -0
  8. package/build/cjs/meta.js +394 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/schemas.d.ts +140 -0
  11. package/build/cjs/schemas.js +322 -0
  12. package/build/cjs/schemas.js.map +1 -0
  13. package/build/es/index.d.mts +159 -0
  14. package/build/es/index.mjs +492 -0
  15. package/build/es/index.mjs.map +1 -0
  16. package/build/es/index.typings.d.mts +787 -0
  17. package/build/es/index.typings.mjs +412 -0
  18. package/build/es/index.typings.mjs.map +1 -0
  19. package/build/es/meta.d.mts +573 -0
  20. package/build/es/meta.mjs +360 -0
  21. package/build/es/meta.mjs.map +1 -0
  22. package/build/es/package.json +3 -0
  23. package/build/es/schemas.d.mts +140 -0
  24. package/build/es/schemas.mjs +274 -0
  25. package/build/es/schemas.mjs.map +1 -0
  26. package/build/internal/cjs/index.d.ts +159 -0
  27. package/build/internal/cjs/index.js +524 -0
  28. package/build/internal/cjs/index.js.map +1 -0
  29. package/build/internal/cjs/index.typings.d.ts +807 -0
  30. package/build/internal/cjs/index.typings.js +443 -0
  31. package/build/internal/cjs/index.typings.js.map +1 -0
  32. package/build/internal/cjs/meta.d.ts +635 -0
  33. package/build/internal/cjs/meta.js +394 -0
  34. package/build/internal/cjs/meta.js.map +1 -0
  35. package/build/internal/cjs/schemas.d.ts +140 -0
  36. package/build/internal/cjs/schemas.js +322 -0
  37. package/build/internal/cjs/schemas.js.map +1 -0
  38. package/build/internal/es/index.d.mts +159 -0
  39. package/build/internal/es/index.mjs +492 -0
  40. package/build/internal/es/index.mjs.map +1 -0
  41. package/build/internal/es/index.typings.d.mts +807 -0
  42. package/build/internal/es/index.typings.mjs +412 -0
  43. package/build/internal/es/index.typings.mjs.map +1 -0
  44. package/build/internal/es/meta.d.mts +635 -0
  45. package/build/internal/es/meta.mjs +360 -0
  46. package/build/internal/es/meta.mjs.map +1 -0
  47. package/build/internal/es/schemas.d.mts +140 -0
  48. package/build/internal/es/schemas.mjs +274 -0
  49. package/build/internal/es/schemas.mjs.map +1 -0
  50. package/meta/package.json +3 -0
  51. package/package.json +61 -0
  52. package/schemas/package.json +3 -0
@@ -0,0 +1,787 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
3
+ /**
4
+ * Represent redirect entity
5
+ *
6
+ * This service is a proxy in front of the Redirector
7
+ * (com.wixpress.redirector.api.v1.RedirectsApi), which owns the storage. Two platform entity
8
+ * fields are therefore deliberately absent, and the matching rules are disabled below:
9
+ *
10
+ * - `revision`: the Redirector has no revision column and no optimistic concurrency. Writes are
11
+ * last-write-wins. Synthesising a revision we cannot enforce would be worse than omitting it.
12
+ * - `updated_date`: the Redirector tracks creation only (its `date_created`), so there is no
13
+ * source for a modification timestamp.
14
+ *
15
+ * `id` is present but client-assignable (a StringValue, not a server-assigned `string`), because
16
+ * the Redirector's Upsert accepts a caller-supplied id and CreateRedirect/AddRedirects/
17
+ * AddGroupRedirects have always passed one through. Changing it would break both the wire and
18
+ * existing callers.
19
+ *
20
+ * `Source`'s zero value carries no enum_maturity because the enum is defined in the Redirector's
21
+ * proto (com/wixpress/redirector/api/v1/redirects.proto), not here. Redirects are not user-taggable.
22
+ */
23
+ interface Redirect {
24
+ /**
25
+ * The path that is intercepted from. Accepts only an encoded string.
26
+ *
27
+ * Capped at 950 to match the Redirector's own `from_path`, which is where this ends up. Without
28
+ * the cap an over-long path is accepted here and only rejected downstream, after this service has
29
+ * already begun writing.
30
+ *
31
+ * No `minLength`: the service rejects an empty path itself, and adding one here would move that
32
+ * rejection into the gateway and change the error payload of the deprecated Add* endpoints.
33
+ * @maxLength 950
34
+ */
35
+ from?: string;
36
+ /**
37
+ * The path that is going to be resolved to. Either a path on the site or a full URL, encoded.
38
+ *
39
+ * Capped at 4096 to match the Redirector's own `target`.
40
+ * @maxLength 4096
41
+ */
42
+ to?: string;
43
+ /** additional options for the redirect */
44
+ options?: RedirectOptions;
45
+ /**
46
+ * When provided, defines a language specific redirect. Otherwise, defines a general redirect.
47
+ * @minLength 2
48
+ * @maxLength 5
49
+ */
50
+ language?: string | null;
51
+ /**
52
+ * Unique identifier for the redirect
53
+ * @format GUID
54
+ */
55
+ _id?: string | null;
56
+ /**
57
+ * Date the redirect was created. Sourced from the Redirector's `date_created`.
58
+ * @readonly
59
+ */
60
+ _createdDate?: Date | null;
61
+ }
62
+ /** options and configurations specific for the redirect */
63
+ interface RedirectOptions {
64
+ /** set to true for group redirects */
65
+ groupRedirect?: boolean;
66
+ }
67
+ declare enum Source {
68
+ /** Unknown. */
69
+ UNKNOWN_SOURCE = "UNKNOWN_SOURCE",
70
+ /** A route is created by user in SEO tab. */
71
+ REDIRECTOR = "REDIRECTOR",
72
+ /** A route is created via offline process (e.g., blogs migration). */
73
+ REDIRECTOR_NON_USER_FACING = "REDIRECTOR_NON_USER_FACING",
74
+ /** A route is created on page slug rename. */
75
+ PAGE_SLUG_RENAME = "PAGE_SLUG_RENAME"
76
+ }
77
+ /** @enumType */
78
+ type SourceWithLiterals = Source | 'UNKNOWN_SOURCE' | 'REDIRECTOR' | 'REDIRECTOR_NON_USER_FACING' | 'PAGE_SLUG_RENAME';
79
+ /** The request for adding bulk redirects */
80
+ interface AddRedirectsRequest {
81
+ /**
82
+ * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The
83
+ * service chunks larger batches, but an unbounded request array is a memory risk with no caller
84
+ * asking for it - and BulkCreateRedirects, which replaces this endpoint, already declares 500.
85
+ *
86
+ * No `minSize`: the service already rejects an empty array with its own message, and adding one
87
+ * here would add a second field violation to this deprecated endpoint's error payload.
88
+ * @maxSize 500
89
+ */
90
+ redirects?: Redirect[];
91
+ /** Extra options for adding bulk redirects */
92
+ options?: AddRedirectsOptions;
93
+ }
94
+ /** Add bulk extra options and configurations */
95
+ interface AddRedirectsOptions {
96
+ /** Should be true if the domain will be included to the redirect */
97
+ requireDomain?: boolean;
98
+ }
99
+ /** The response for adding bulk redirects */
100
+ interface AddRedirectsResponse {
101
+ /**
102
+ * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The
103
+ * service chunks larger batches, but an unbounded request array is a memory risk with no caller
104
+ * asking for it - and BulkCreateRedirects, which replaces this endpoint, already declares 500.
105
+ *
106
+ * No `minSize`: the service already rejects an empty array with its own message, and adding one
107
+ * here would add a second field violation to this deprecated endpoint's error payload.
108
+ * @maxSize 500
109
+ */
110
+ redirects?: Redirect[];
111
+ }
112
+ /** The request for adding group redirects */
113
+ interface AddGroupRedirectsRequest {
114
+ /**
115
+ * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The
116
+ * service chunks larger batches, but an unbounded request array is a memory risk with no caller
117
+ * asking for it - and BulkCreateRedirects, which replaces this endpoint, already declares 500.
118
+ *
119
+ * No `minSize`: the service already rejects an empty array with its own message, and adding one
120
+ * here would add a second field violation to this deprecated endpoint's error payload.
121
+ * @maxSize 500
122
+ */
123
+ redirects?: Redirect[];
124
+ /** Extra options for adding group redirects */
125
+ options?: AddGroupRedirectsOptions;
126
+ }
127
+ /** Add group extra options and configurations */
128
+ interface AddGroupRedirectsOptions {
129
+ /** Should be true if the domain will be included to the redirect */
130
+ requireDomain?: boolean;
131
+ }
132
+ /** The response for adding group redirects */
133
+ interface AddGroupRedirectsResponse {
134
+ /**
135
+ * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The
136
+ * service chunks larger batches, but an unbounded request array is a memory risk with no caller
137
+ * asking for it - and BulkCreateRedirects, which replaces this endpoint, already declares 500.
138
+ *
139
+ * No `minSize`: the service already rejects an empty array with its own message, and adding one
140
+ * here would add a second field violation to this deprecated endpoint's error payload.
141
+ * @maxSize 500
142
+ */
143
+ redirects?: Redirect[];
144
+ }
145
+ /**
146
+ * The request for deleting redirects in bulk.
147
+ *
148
+ * Redirects are addressed by id, but the Redirector matches redirects by path rather than by id, so
149
+ * the service resolves each id to the stored redirect before deleting it. A caller therefore sends
150
+ * ids and never has to reconstruct an entity.
151
+ *
152
+ * The 1-500 bound is the Redirector's own `maxRedirectsPerRequest`, not a number chosen here.
153
+ */
154
+ interface BulkDeleteRedirectsRequest {
155
+ /**
156
+ * Unique identifiers of the redirects to delete
157
+ * @minSize 1
158
+ * @maxSize 500
159
+ * @format GUID
160
+ */
161
+ redirectIds: string[];
162
+ }
163
+ /**
164
+ * The response for deleting redirects in bulk.
165
+ *
166
+ * One result per requested id, in request order - `item_metadata.original_index` is the index in
167
+ * `redirect_ids`. Per-item semantics:
168
+ *
169
+ * - `success` true means the redirect was found and sent to the Redirector for deletion. It is not a
170
+ * confirmation that the redirect is gone: the Redirector's BulkRemove returns no per-item outcome,
171
+ * so there is nothing to confirm it against.
172
+ * - `success` false with `error.code` REDIRECT_NOT_FOUND means no redirect on this site carries that
173
+ * id. The call still succeeds and every other id is still sent to the Redirector, under the same
174
+ * `success` meaning as above.
175
+ *
176
+ * `item` is never populated - there is no created entity to return.
177
+ */
178
+ interface BulkDeleteRedirectsResponse {
179
+ /**
180
+ * Per-item outcome, in request order
181
+ * @maxSize 500
182
+ */
183
+ results?: BulkRedirectResult[];
184
+ /** Totals for the bulk action: successes, failures and undetailed failures */
185
+ bulkActionMetadata?: BulkActionMetadata;
186
+ }
187
+ /** The result of creating a single redirect within a bulk request */
188
+ interface BulkRedirectResult {
189
+ /** Index, id and success/error details for this item */
190
+ itemMetadata?: ItemMetadata;
191
+ /** The created redirect. Only populated when return_full_entity is true */
192
+ item?: Redirect;
193
+ }
194
+ interface ItemMetadata {
195
+ /**
196
+ * Item ID. Should always be available, unless it's impossible (for example, when failing to create an item).
197
+ * @maxLength 100
198
+ */
199
+ _id?: string | null;
200
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
201
+ originalIndex?: number;
202
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
203
+ success?: boolean;
204
+ /** Details about the error in case of failure. */
205
+ error?: ApplicationError;
206
+ }
207
+ interface ApplicationError {
208
+ /** Error code. */
209
+ code?: string;
210
+ /** Description of the error. */
211
+ description?: string;
212
+ /** Data related to the error. */
213
+ data?: Record<string, any> | null;
214
+ }
215
+ interface BulkActionMetadata {
216
+ /** Number of items that were successfully processed. */
217
+ totalSuccesses?: number;
218
+ /** Number of items that couldn't be processed. */
219
+ totalFailures?: number;
220
+ /** Number of failures without details because detailed failure threshold was exceeded. */
221
+ undetailedFailures?: number;
222
+ }
223
+ /** The request for listing the site's redirects */
224
+ interface ListRedirectsRequest {
225
+ }
226
+ /**
227
+ * The response for listing the site's redirects.
228
+ *
229
+ * Unpaged, so there is no paging_metadata: the Redirector's Get returns every redirect for the
230
+ * site in a single response and offers no paging or filtering of its own. Paging here would mean
231
+ * reading the whole set and then slicing it, which costs the same and buys the caller nothing.
232
+ * Revisit if the Redirector ever gains real paging.
233
+ *
234
+ * Unbounded for the same reason, mirroring the Redirector's own GetResponse.redirects, which
235
+ * declares no maxSize. The 500 in the Redirector's protos bounds its bulk *write* requests
236
+ * (Upsert, Remove, Validate); it is not a ceiling on how many redirects a site can hold.
237
+ */
238
+ interface ListRedirectsResponse {
239
+ /** The site's redirects */
240
+ redirects?: Redirect[];
241
+ }
242
+ /** The request for retrieving a single redirect by id */
243
+ interface GetRedirectRequest {
244
+ /**
245
+ * Unique identifier of the redirect to retrieve
246
+ * @format GUID
247
+ */
248
+ redirectId: string;
249
+ }
250
+ /** The response for retrieving a single redirect */
251
+ interface GetRedirectResponse {
252
+ /** The retrieved redirect */
253
+ redirect?: Redirect;
254
+ }
255
+ /**
256
+ * The request for creating redirects in bulk.
257
+ *
258
+ * Unlike the deprecated AddRedirects and AddGroupRedirects, the exact-versus-group choice is taken
259
+ * per redirect from `options.groupRedirect` rather than being fixed by the endpoint.
260
+ */
261
+ interface BulkCreateRedirectsRequest {
262
+ /**
263
+ * The redirects to create
264
+ * @minSize 1
265
+ * @maxSize 500
266
+ */
267
+ redirects: Redirect[];
268
+ /** Set to true to return the created redirects, not just their metadata */
269
+ returnFullEntity?: boolean;
270
+ /** Extra options for creating redirects in bulk */
271
+ options?: BulkCreateRedirectsOptions;
272
+ }
273
+ /** Bulk create options and configurations */
274
+ interface BulkCreateRedirectsOptions {
275
+ /** set to true to replace a conflicting redirect's from-url instead of failing that item */
276
+ forceReplace?: boolean;
277
+ }
278
+ /** The response for creating redirects in bulk */
279
+ interface BulkCreateRedirectsResponse {
280
+ /**
281
+ * Per-item outcome, in request order
282
+ * @maxSize 500
283
+ */
284
+ results?: BulkRedirectResult[];
285
+ /** Totals for the bulk action: successes, failures and undetailed failures */
286
+ bulkActionMetadata?: BulkActionMetadata;
287
+ }
288
+ /** The request for creating a redirect */
289
+ interface CreateRedirectRequest {
290
+ /** The redirect to create */
291
+ redirect: Redirect;
292
+ /** Extra options for creating a redirect */
293
+ options?: CreateRedirectOptions;
294
+ }
295
+ /** Create redirect options and configurations */
296
+ interface CreateRedirectOptions {
297
+ /** set to true when need to replace a conflicting redirect's from-url (if it exists) */
298
+ forceReplace?: boolean;
299
+ }
300
+ /** The response for creating a redirect */
301
+ interface CreateRedirectResponse {
302
+ /** The created redirect */
303
+ redirect?: Redirect;
304
+ }
305
+ /** The request for deleting a single redirect by id */
306
+ interface DeleteRedirectRequest {
307
+ /**
308
+ * Unique identifier of the redirect to delete
309
+ * @format GUID
310
+ */
311
+ redirectId: string;
312
+ }
313
+ /** The response for deleting a single redirect */
314
+ interface DeleteRedirectResponse {
315
+ }
316
+ /** The request for removing a general (all languages) redirect */
317
+ interface RemoveGeneralRedirectRequest {
318
+ /** general redirect to be removed. its language property should be empty */
319
+ redirect?: Redirect;
320
+ /**
321
+ * language for which this general redirect should be removed
322
+ * @minLength 2
323
+ * @maxLength 5
324
+ */
325
+ applicableLanguage?: string | null;
326
+ /** Extra options for removing general redirect */
327
+ options?: RemoveGeneralRedirectsOptions;
328
+ }
329
+ /** remove general (all languages) redirect options and configurations */
330
+ interface RemoveGeneralRedirectsOptions {
331
+ /** Should be true if the domain will be included to the redirect */
332
+ requireDomain?: boolean;
333
+ }
334
+ /** The response for removing a general (all languages) redirect */
335
+ interface RemoveGeneralRedirectResponse {
336
+ /** added redirects */
337
+ redirects?: Redirect[];
338
+ }
339
+ /** The request for getting http status */
340
+ interface GetHttpStatusRequest {
341
+ /**
342
+ * url
343
+ * @maxLength 1000
344
+ */
345
+ url?: string | null;
346
+ }
347
+ /** The response for getting http status */
348
+ interface GetHttpStatusResponse {
349
+ /** http status code */
350
+ status?: number | null;
351
+ /**
352
+ * http status text
353
+ * @maxLength 100
354
+ */
355
+ statusText?: string | null;
356
+ }
357
+ /** Request to delete all redirects scoped to a specific language code. */
358
+ interface CleanupLanguageRedirectsRequest {
359
+ /**
360
+ * Language code of redirects to remove (e.g. "fr", "en-US").
361
+ * @minLength 2
362
+ * @maxLength 5
363
+ */
364
+ languageCode?: string;
365
+ }
366
+ /**
367
+ * Response with counts describing the cleanup outcome.
368
+ * found_count vs removed_count lets callers detect partial failures
369
+ * (a future per-batch failure-handling change may diverge the two).
370
+ */
371
+ interface CleanupLanguageRedirectsResponse {
372
+ /** Number of redirects found for the given language before cleanup. */
373
+ foundCount?: number;
374
+ /** Number of redirects successfully removed for the given language. */
375
+ removedCount?: number;
376
+ }
377
+ interface DomainEvent extends DomainEventBodyOneOf {
378
+ createdEvent?: EntityCreatedEvent;
379
+ updatedEvent?: EntityUpdatedEvent;
380
+ deletedEvent?: EntityDeletedEvent;
381
+ actionEvent?: ActionEvent;
382
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
383
+ _id?: string;
384
+ /**
385
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
386
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
387
+ */
388
+ entityFqdn?: string;
389
+ /**
390
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
391
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
392
+ */
393
+ slug?: string;
394
+ /** ID of the entity associated with the event. */
395
+ entityId?: string;
396
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
397
+ eventTime?: Date | null;
398
+ /**
399
+ * Whether the event was triggered as a result of a privacy regulation application
400
+ * (for example, GDPR).
401
+ */
402
+ triggeredByAnonymizeRequest?: boolean | null;
403
+ /** If present, indicates the action that triggered the event. */
404
+ originatedFrom?: string | null;
405
+ /**
406
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
407
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
408
+ */
409
+ entityEventSequence?: string | null;
410
+ }
411
+ /** @oneof */
412
+ interface DomainEventBodyOneOf {
413
+ createdEvent?: EntityCreatedEvent;
414
+ updatedEvent?: EntityUpdatedEvent;
415
+ deletedEvent?: EntityDeletedEvent;
416
+ actionEvent?: ActionEvent;
417
+ }
418
+ interface EntityCreatedEvent {
419
+ entity?: string;
420
+ }
421
+ interface RestoreInfo {
422
+ deletedDate?: Date | null;
423
+ }
424
+ interface EntityUpdatedEvent {
425
+ /**
426
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
427
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
428
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
429
+ */
430
+ currentEntity?: string;
431
+ }
432
+ interface EntityDeletedEvent {
433
+ /** Entity that was deleted. */
434
+ deletedEntity?: string | null;
435
+ }
436
+ interface ActionEvent {
437
+ body?: string;
438
+ }
439
+ interface MessageEnvelope {
440
+ /**
441
+ * App instance ID.
442
+ * @format GUID
443
+ */
444
+ instanceId?: string | null;
445
+ /**
446
+ * Event type.
447
+ * @maxLength 150
448
+ */
449
+ eventType?: string;
450
+ /** The identification type and identity data. */
451
+ identity?: IdentificationData;
452
+ /** Stringify payload. */
453
+ data?: string;
454
+ /** Details related to the account */
455
+ accountInfo?: AccountInfo;
456
+ }
457
+ interface IdentificationData extends IdentificationDataIdOneOf {
458
+ /**
459
+ * ID of a site visitor that has not logged in to the site.
460
+ * @format GUID
461
+ */
462
+ anonymousVisitorId?: string;
463
+ /**
464
+ * ID of a site visitor that has logged in to the site.
465
+ * @format GUID
466
+ */
467
+ memberId?: string;
468
+ /**
469
+ * ID of a Wix user (site owner, contributor, etc.).
470
+ * @format GUID
471
+ */
472
+ wixUserId?: string;
473
+ /**
474
+ * ID of an app.
475
+ * @format GUID
476
+ */
477
+ appId?: string;
478
+ /** @readonly */
479
+ identityType?: WebhookIdentityTypeWithLiterals;
480
+ }
481
+ /** @oneof */
482
+ interface IdentificationDataIdOneOf {
483
+ /**
484
+ * ID of a site visitor that has not logged in to the site.
485
+ * @format GUID
486
+ */
487
+ anonymousVisitorId?: string;
488
+ /**
489
+ * ID of a site visitor that has logged in to the site.
490
+ * @format GUID
491
+ */
492
+ memberId?: string;
493
+ /**
494
+ * ID of a Wix user (site owner, contributor, etc.).
495
+ * @format GUID
496
+ */
497
+ wixUserId?: string;
498
+ /**
499
+ * ID of an app.
500
+ * @format GUID
501
+ */
502
+ appId?: string;
503
+ }
504
+ declare enum WebhookIdentityType {
505
+ UNKNOWN = "UNKNOWN",
506
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
507
+ MEMBER = "MEMBER",
508
+ WIX_USER = "WIX_USER",
509
+ APP = "APP"
510
+ }
511
+ /** @enumType */
512
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
513
+ interface AccountInfo {
514
+ /**
515
+ * ID of the Wix account associated with the event.
516
+ * @format GUID
517
+ */
518
+ accountId?: string | null;
519
+ /**
520
+ * ID of the parent Wix account. Only included when accountId belongs to a child account.
521
+ * @format GUID
522
+ */
523
+ parentAccountId?: string | null;
524
+ /**
525
+ * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
526
+ * @format GUID
527
+ */
528
+ siteId?: string | null;
529
+ }
530
+ /** @docsIgnore */
531
+ type GetRedirectApplicationErrors = {
532
+ code?: 'REDIRECT_NOT_FOUND';
533
+ description?: string;
534
+ data?: Record<string, any>;
535
+ };
536
+ /** @docsIgnore */
537
+ type CreateRedirectApplicationErrors = {
538
+ code?: 'FROM_URL_EXISTS';
539
+ description?: string;
540
+ data?: Record<string, any>;
541
+ };
542
+ /** @docsIgnore */
543
+ type DeleteRedirectApplicationErrors = {
544
+ code?: 'REDIRECT_NOT_FOUND';
545
+ description?: string;
546
+ data?: Record<string, any>;
547
+ };
548
+ interface BaseEventMetadata {
549
+ /**
550
+ * App instance ID.
551
+ * @format GUID
552
+ */
553
+ instanceId?: string | null;
554
+ /**
555
+ * Event type.
556
+ * @maxLength 150
557
+ */
558
+ eventType?: string;
559
+ /** The identification type and identity data. */
560
+ identity?: IdentificationData;
561
+ /** Details related to the account */
562
+ accountInfo?: AccountInfo;
563
+ }
564
+ interface EventMetadata extends BaseEventMetadata {
565
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
566
+ _id?: string;
567
+ /**
568
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
569
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
570
+ */
571
+ entityFqdn?: string;
572
+ /**
573
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
574
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
575
+ */
576
+ slug?: string;
577
+ /** ID of the entity associated with the event. */
578
+ entityId?: string;
579
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
580
+ eventTime?: Date | null;
581
+ /**
582
+ * Whether the event was triggered as a result of a privacy regulation application
583
+ * (for example, GDPR).
584
+ */
585
+ triggeredByAnonymizeRequest?: boolean | null;
586
+ /** If present, indicates the action that triggered the event. */
587
+ originatedFrom?: string | null;
588
+ /**
589
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
590
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
591
+ */
592
+ entityEventSequence?: string | null;
593
+ accountInfo?: AccountInfoMetadata;
594
+ }
595
+ interface AccountInfoMetadata {
596
+ /** ID of the Wix account associated with the event */
597
+ accountId: string;
598
+ /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */
599
+ siteId?: string;
600
+ /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */
601
+ parentAccountId?: string;
602
+ }
603
+ interface RedirectCreatedEnvelope {
604
+ entity: Redirect;
605
+ metadata: EventMetadata;
606
+ }
607
+ /** @webhook
608
+ * @eventType wix.promote.seo.v1.redirect_created
609
+ * @serviceIdentifier com.wixpress.promote.seo.redirects.api.RedirectsService
610
+ * @slug created
611
+ * @documentationMaturity preview
612
+ */
613
+ declare function onRedirectCreated(handler: (event: RedirectCreatedEnvelope) => void | Promise<void>): void;
614
+ /**
615
+ * Deletes redirects in bulk, by id.
616
+ *
617
+ * An id that matches no redirect on the site fails only its own item - the batch proceeds and every
618
+ * other id is still sent. See BulkDeleteRedirectsResponse for what `success` does and does not
619
+ * promise: the Redirector's BulkRemove reports no per-item outcome, so a successful item means
620
+ * resolved-and-sent rather than confirmed-deleted.
621
+ *
622
+ * Language-scoped redirects are a known gap. The Redirector filters its stored-row delete to
623
+ * redirects without a language, so a language-scoped redirect loses its route but keeps its stored
624
+ * row. DeleteRedirect behaves identically - this is upstream behaviour rather than something this
625
+ * endpoint introduces.
626
+ *
627
+ * Example, with one unknown id:
628
+ *
629
+ * POST /v1/bulk/redirects/delete
630
+ * { "redirectIds": ["<a>", "<b>", "<unknown>"] }
631
+ *
632
+ * 200 {
633
+ * "results": [
634
+ * { "itemMetadata": { "id": "<a>", "originalIndex": 0, "success": true } },
635
+ * { "itemMetadata": { "id": "<b>", "originalIndex": 1, "success": true } },
636
+ * { "itemMetadata": { "id": "<unknown>", "originalIndex": 2, "success": false,
637
+ * "error": { "code": "REDIRECT_NOT_FOUND",
638
+ * "description": "Redirect <unknown> was not found" } } }
639
+ * ],
640
+ * "bulkActionMetadata": { "totalSuccesses": 2, "totalFailures": 1, "undetailedFailures": 0 }
641
+ * }
642
+ *
643
+ * Permission naming and domain events follow the rest of this service: `wix-seo.*` is what the
644
+ * Redirector itself checks, and no CUD event is emitted because this service owns no storage, so
645
+ * emitting one only here would leave consumers reading the absence of an event as the absence of a
646
+ * change.
647
+ * @param redirectIds - Unique identifiers of the redirects to delete
648
+ * @public
649
+ * @documentationMaturity preview
650
+ * @requiredField redirectIds
651
+ * @permissionId wix-seo.edit
652
+ * @applicableIdentity APP
653
+ * @returns The response for deleting redirects in bulk.
654
+ *
655
+ * One result per requested id, in request order - `item_metadata.original_index` is the index in
656
+ * `redirect_ids`. Per-item semantics:
657
+ *
658
+ * - `success` true means the redirect was found and sent to the Redirector for deletion. It is not a
659
+ * confirmation that the redirect is gone: the Redirector's BulkRemove returns no per-item outcome,
660
+ * so there is nothing to confirm it against.
661
+ * - `success` false with `error.code` REDIRECT_NOT_FOUND means no redirect on this site carries that
662
+ * id. The call still succeeds and every other id is still sent to the Redirector, under the same
663
+ * `success` meaning as above.
664
+ *
665
+ * `item` is never populated - there is no created entity to return.
666
+ * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.BulkDeleteRedirects
667
+ */
668
+ declare function bulkDeleteRedirects(redirectIds: string[]): Promise<NonNullablePaths<BulkDeleteRedirectsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.item.from` | `results.${number}.item.to` | `results.${number}.item.options.groupRedirect` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
669
+ /**
670
+ * Lists the site's redirects.
671
+ *
672
+ * Unpaged - see ListRedirectsResponse. Permission naming follows the rest of this service:
673
+ * `wix-seo.*` is what the Redirector itself checks.
674
+ * @public
675
+ * @documentationMaturity preview
676
+ * @permissionId wix-seo.read
677
+ * @applicableIdentity APP
678
+ * @applicableIdentity MEMBER
679
+ * @returns The response for listing the site's redirects.
680
+ *
681
+ * Unpaged, so there is no paging_metadata: the Redirector's Get returns every redirect for the
682
+ * site in a single response and offers no paging or filtering of its own. Paging here would mean
683
+ * reading the whole set and then slicing it, which costs the same and buys the caller nothing.
684
+ * Revisit if the Redirector ever gains real paging.
685
+ *
686
+ * Unbounded for the same reason, mirroring the Redirector's own GetResponse.redirects, which
687
+ * declares no maxSize. The 500 in the Redirector's protos bounds its bulk *write* requests
688
+ * (Upsert, Remove, Validate); it is not a ceiling on how many redirects a site can hold.
689
+ * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.ListRedirects
690
+ */
691
+ declare function listRedirects(): Promise<NonNullablePaths<ListRedirectsResponse, `redirects` | `redirects.${number}.from` | `redirects.${number}.to` | `redirects.${number}.options.groupRedirect`, 5>>;
692
+ /**
693
+ * Retrieves a single redirect by id.
694
+ *
695
+ * Permission naming follows the rest of this service: `wix-seo.*` is what the Redirector itself
696
+ * checks.
697
+ * @param redirectId - Unique identifier of the redirect to retrieve
698
+ * @public
699
+ * @documentationMaturity preview
700
+ * @requiredField redirectId
701
+ * @permissionId wix-seo.read
702
+ * @applicableIdentity APP
703
+ * @applicableIdentity MEMBER
704
+ * @returns The retrieved redirect
705
+ * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.GetRedirect
706
+ */
707
+ declare function getRedirect(redirectId: string): Promise<NonNullablePaths<Redirect, `from` | `to` | `options.groupRedirect`, 3> & {
708
+ __applicationErrorsType?: GetRedirectApplicationErrors;
709
+ }>;
710
+ /**
711
+ * Creates redirects in bulk. Replaces AddRedirects and AddGroupRedirects.
712
+ *
713
+ * Permission naming and domain events follow the rest of this service: `wix-seo.*` is what the
714
+ * Redirector itself checks, and no CUD event is emitted because this service owns no storage -
715
+ * the redirects live in the Redirector. Neither is changed here, since a service-wide convention
716
+ * should not be broken by a single endpoint.
717
+ * @param redirects - The redirects to create
718
+ * @public
719
+ * @documentationMaturity preview
720
+ * @requiredField redirects
721
+ * @permissionId wix-seo.edit
722
+ * @applicableIdentity APP
723
+ * @returns The response for creating redirects in bulk
724
+ * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.BulkCreateRedirects
725
+ */
726
+ declare function bulkCreateRedirects(redirects: Redirect[], options?: BulkCreateRedirectsOptionsForRequest): Promise<NonNullablePaths<BulkCreateRedirectsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.item.from` | `results.${number}.item.to` | `results.${number}.item.options.groupRedirect` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
727
+ interface BulkCreateRedirectsOptionsForRequest {
728
+ /** Set to true to return the created redirects, not just their metadata */
729
+ returnFullEntity?: boolean;
730
+ /** Extra options for creating redirects in bulk */
731
+ options?: BulkCreateRedirectsOptions;
732
+ }
733
+ /**
734
+ * Create a redirect with loop solving
735
+ * @param redirect - The redirect to create
736
+ * @public
737
+ * @documentationMaturity preview
738
+ * @requiredField redirect
739
+ * @permissionId wix-seo.edit
740
+ * @applicableIdentity APP
741
+ * @returns The created redirect
742
+ * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.CreateRedirect
743
+ */
744
+ declare function createRedirect(redirect: Redirect, options?: CreateRedirectOptionsForRequest): Promise<NonNullablePaths<Redirect, `from` | `to` | `options.groupRedirect`, 3> & {
745
+ __applicationErrorsType?: CreateRedirectApplicationErrors;
746
+ }>;
747
+ interface CreateRedirectOptionsForRequest {
748
+ /** Extra options for creating a redirect */
749
+ options?: CreateRedirectOptions;
750
+ }
751
+ /**
752
+ * Deletes a single redirect by id.
753
+ *
754
+ * The Redirector's Remove takes the whole redirect rather than an id, because it locates the route
755
+ * by `id` when one is present and by matching on `from_path`, exact/group matching and `regex`
756
+ * when it is not. The redirect is therefore read back through the Redirector's own get-by-id first
757
+ * and handed over as-is, so the caller only has to know the id; see DeleteRedirectService.
758
+ *
759
+ * Permission naming follows the rest of this service: `wix-seo.*` is what the Redirector itself
760
+ * checks.
761
+ *
762
+ * No domain event is emitted - neither a CUD event nor the `wix.api.emits` the DELETE annotation
763
+ * asks for - because the redirects live in the Redirector, which owns the storage and does not
764
+ * emit through us. Emitting only here would publish a stream that is silently incomplete: every
765
+ * other write path (AddRedirects, BulkCreateRedirects, RemoveGeneralRedirect,
766
+ * CleanupLanguageRedirects) and every caller reaching the Redirector directly would stay silent,
767
+ * so a consumer would take the absence of an event as the absence of a change. Publishing redirect
768
+ * events is therefore a service-wide follow-up, not a per-endpoint one; BulkCreateRedirects above
769
+ * carries the same suppression for the same reason.
770
+ *
771
+ * CUSTOM_ACTION is not an alternative escape from the rule: with a top-level id field on the
772
+ * request, flynt requires this method to be annotated `method: DELETE`
773
+ * (`crud-add-delete-annotation`).
774
+ * @param redirectId - Unique identifier of the redirect to delete
775
+ * @public
776
+ * @documentationMaturity preview
777
+ * @requiredField redirectId
778
+ * @permissionId wix-seo.edit
779
+ * @applicableIdentity APP
780
+ * @returns The response for deleting a single redirect
781
+ * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.DeleteRedirect
782
+ */
783
+ declare function deleteRedirect(redirectId: string): Promise<void & {
784
+ __applicationErrorsType?: DeleteRedirectApplicationErrors;
785
+ }>;
786
+
787
+ export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type AddGroupRedirectsOptions, type AddGroupRedirectsRequest, type AddGroupRedirectsResponse, type AddRedirectsOptions, type AddRedirectsRequest, type AddRedirectsResponse, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkCreateRedirectsOptions, type BulkCreateRedirectsOptionsForRequest, type BulkCreateRedirectsRequest, type BulkCreateRedirectsResponse, type BulkDeleteRedirectsRequest, type BulkDeleteRedirectsResponse, type BulkRedirectResult, type CleanupLanguageRedirectsRequest, type CleanupLanguageRedirectsResponse, type CreateRedirectApplicationErrors, type CreateRedirectOptions, type CreateRedirectOptionsForRequest, type CreateRedirectRequest, type CreateRedirectResponse, type DeleteRedirectApplicationErrors, type DeleteRedirectRequest, type DeleteRedirectResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type GetHttpStatusRequest, type GetHttpStatusResponse, type GetRedirectApplicationErrors, type GetRedirectRequest, type GetRedirectResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type ListRedirectsRequest, type ListRedirectsResponse, type MessageEnvelope, type Redirect, type RedirectCreatedEnvelope, type RedirectOptions, type RemoveGeneralRedirectRequest, type RemoveGeneralRedirectResponse, type RemoveGeneralRedirectsOptions, type RestoreInfo, Source, type SourceWithLiterals, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCreateRedirects, bulkDeleteRedirects, createRedirect, deleteRedirect, getRedirect, listRedirects, onRedirectCreated };