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