@wix/auto_sdk_sites_sites 1.0.41 → 1.0.43

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.
@@ -2,7 +2,9 @@ import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTF
2
2
  import { CountSitesOptions, CountSitesResponse, CountSitesApplicationErrors, SiteCreatedEnvelope, SiteDeletedEnvelope, SiteUpdatedEnvelope, SitesQueryBuilder, SiteQuery, typedQuerySites } from './index.typings.js';
3
3
  export { AccountInfo, AccountInfoMetadata, ActionEvent, BaseEventMetadata, CommonQueryWithEntityContext, CountSitesRequest, CursorPaging, Cursors, DomainEvent, DomainEventBodyOneOf, EditorType, EditorTypeWithLiterals, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, Namespace, NamespaceWithLiterals, PagingMetadataV2, ParentChildRole, ParentChildRoleWithLiterals, QuerySitesApplicationErrors, QuerySitesRequest, QuerySitesResponse, QueryV2, QueryV2PagingMethodOneOf, RestoreInfo, Site, SiteQuerySpec, SitesQueryResult, SortOrder, SortOrderWithLiterals, Sorting, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.js';
4
4
 
5
- declare function countSites$1(httpClient: HttpClient): CountSitesSignature;
5
+ declare function countSites$1(httpClient: HttpClient, __options?: {
6
+ validateRequestSchema?: boolean;
7
+ }): CountSitesSignature;
6
8
  interface CountSitesSignature {
7
9
  /**
8
10
  * Retrieves the number of sites, given the provided filtering.
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // index.ts
@@ -59,12 +69,20 @@ function resolveComWixpressSitelistApiSiteListServiceV2Url(opts) {
59
69
  {
60
70
  srcPath: "/_api/sites-list/v2/sites",
61
71
  destPath: "/v2/sites"
72
+ },
73
+ {
74
+ srcPath: "/account/sites",
75
+ destPath: ""
62
76
  }
63
77
  ],
64
78
  "feedback._base_domain_": [
65
79
  {
66
80
  srcPath: "/_api/sites-list",
67
81
  destPath: "/api"
82
+ },
83
+ {
84
+ srcPath: "/account/sites",
85
+ destPath: ""
68
86
  }
69
87
  ],
70
88
  "manage._base_domain_": [
@@ -76,6 +94,10 @@ function resolveComWixpressSitelistApiSiteListServiceV2Url(opts) {
76
94
  srcPath: "/_api/sites-list/v2/sites",
77
95
  destPath: "/v2/sites"
78
96
  },
97
+ {
98
+ srcPath: "/account/sites",
99
+ destPath: ""
100
+ },
79
101
  {
80
102
  srcPath: "/_api/sites-list-data",
81
103
  destPath: "/api/sites-list-data"
@@ -216,6 +238,270 @@ function countSites(payload) {
216
238
 
217
239
  // src/site-list-v2-site-sites.universal.ts
218
240
  var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
241
+
242
+ // src/site-list-v2-site-sites.schemas.ts
243
+ var z = __toESM(require("zod"));
244
+ var QuerySitesRequest = z.object({
245
+ query: z.object({
246
+ filter: z.object({
247
+ _id: z.object({
248
+ $eq: z.string(),
249
+ $exists: z.boolean(),
250
+ $gt: z.string(),
251
+ $gte: z.string(),
252
+ $hasAll: z.array(z.string()),
253
+ $hasSome: z.array(z.string()),
254
+ $in: z.array(z.string()),
255
+ $lt: z.string(),
256
+ $lte: z.string(),
257
+ $ne: z.string(),
258
+ $nin: z.array(z.string()),
259
+ $startsWith: z.string()
260
+ }).partial().strict().optional(),
261
+ name: z.object({
262
+ $eq: z.string(),
263
+ $exists: z.boolean(),
264
+ $gt: z.string(),
265
+ $gte: z.string(),
266
+ $hasAll: z.array(z.string()),
267
+ $hasSome: z.array(z.string()),
268
+ $in: z.array(z.string()),
269
+ $lt: z.string(),
270
+ $lte: z.string(),
271
+ $ne: z.string(),
272
+ $nin: z.array(z.string()),
273
+ $startsWith: z.string()
274
+ }).partial().strict().optional(),
275
+ published: z.object({
276
+ $eq: z.boolean(),
277
+ $exists: z.boolean(),
278
+ $gt: z.boolean(),
279
+ $gte: z.boolean(),
280
+ $hasAll: z.array(z.boolean()),
281
+ $hasSome: z.array(z.boolean()),
282
+ $in: z.array(z.boolean()),
283
+ $lt: z.boolean(),
284
+ $lte: z.boolean(),
285
+ $ne: z.boolean(),
286
+ $nin: z.array(z.boolean()),
287
+ $startsWith: z.string()
288
+ }).partial().strict().optional(),
289
+ premium: z.object({
290
+ $eq: z.boolean(),
291
+ $exists: z.boolean(),
292
+ $gt: z.boolean(),
293
+ $gte: z.boolean(),
294
+ $hasAll: z.array(z.boolean()),
295
+ $hasSome: z.array(z.boolean()),
296
+ $in: z.array(z.boolean()),
297
+ $lt: z.boolean(),
298
+ $lte: z.boolean(),
299
+ $ne: z.boolean(),
300
+ $nin: z.array(z.boolean()),
301
+ $startsWith: z.string()
302
+ }).partial().strict().optional(),
303
+ editorType: z.object({
304
+ $eq: z.string(),
305
+ $exists: z.boolean(),
306
+ $gt: z.string(),
307
+ $gte: z.string(),
308
+ $hasAll: z.array(z.string()),
309
+ $hasSome: z.array(z.string()),
310
+ $in: z.array(z.string()),
311
+ $lt: z.string(),
312
+ $lte: z.string(),
313
+ $ne: z.string(),
314
+ $nin: z.array(z.string()),
315
+ $startsWith: z.string()
316
+ }).partial().strict().optional(),
317
+ folderId: z.object({
318
+ $eq: z.string(),
319
+ $exists: z.boolean(),
320
+ $gt: z.string(),
321
+ $gte: z.string(),
322
+ $hasAll: z.array(z.string()),
323
+ $hasSome: z.array(z.string()),
324
+ $in: z.array(z.string()),
325
+ $lt: z.string(),
326
+ $lte: z.string(),
327
+ $ne: z.string(),
328
+ $nin: z.array(z.string()),
329
+ $startsWith: z.string()
330
+ }).partial().strict().optional(),
331
+ namespace: z.object({
332
+ $eq: z.string(),
333
+ $exists: z.boolean(),
334
+ $gt: z.string(),
335
+ $gte: z.string(),
336
+ $hasAll: z.array(z.string()),
337
+ $hasSome: z.array(z.string()),
338
+ $in: z.array(z.string()),
339
+ $lt: z.string(),
340
+ $lte: z.string(),
341
+ $ne: z.string(),
342
+ $nin: z.array(z.string()),
343
+ $startsWith: z.string()
344
+ }).partial().strict().optional(),
345
+ domainConnected: z.object({
346
+ $eq: z.boolean(),
347
+ $exists: z.boolean(),
348
+ $gt: z.boolean(),
349
+ $gte: z.boolean(),
350
+ $hasAll: z.array(z.boolean()),
351
+ $hasSome: z.array(z.boolean()),
352
+ $in: z.array(z.boolean()),
353
+ $lt: z.boolean(),
354
+ $lte: z.boolean(),
355
+ $ne: z.boolean(),
356
+ $nin: z.array(z.boolean()),
357
+ $startsWith: z.string()
358
+ }).partial().strict().optional(),
359
+ displayName: z.object({}).partial().strict().optional(),
360
+ _createdDate: z.object({}).partial().strict().optional(),
361
+ _updatedDate: z.object({}).partial().strict().optional(),
362
+ trashedDate: z.object({}).partial().strict().optional(),
363
+ $and: z.array(z.any()).optional(),
364
+ $or: z.array(z.any()).optional(),
365
+ $not: z.any().optional()
366
+ }).strict().optional(),
367
+ sort: z.array(
368
+ z.object({
369
+ fieldName: z.enum([
370
+ "displayName",
371
+ "_createdDate",
372
+ "_updatedDate",
373
+ "trashedDate"
374
+ ]).optional(),
375
+ order: z.enum(["ASC", "DESC"]).optional()
376
+ })
377
+ ).optional()
378
+ }).catchall(z.any()).describe(
379
+ 'Filter and sorting with the following format:\n`"filter" : { "displayName": "my-site" }`'
380
+ )
381
+ });
382
+ var QuerySitesResponse = z.object({
383
+ sites: z.array(
384
+ z.object({
385
+ _id: z.string().describe("Site ID.").regex(
386
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
387
+ "Must be a valid GUID"
388
+ ).optional(),
389
+ htmlAppId: z.string().describe("HTML app ID for the site.").regex(
390
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
391
+ "Must be a valid GUID"
392
+ ).optional().nullable(),
393
+ name: z.string().describe("Site name. Used in the site's URL.").optional(),
394
+ displayName: z.string().describe(
395
+ "Site display name. Used for display purposes, such as in the browser's tab name."
396
+ ).optional(),
397
+ _createdDate: z.date().describe("Site creation date.").optional().nullable(),
398
+ _updatedDate: z.date().describe("Site updated date.").optional().nullable(),
399
+ trashedDate: z.date().describe("Site trashed date.").optional().nullable(),
400
+ published: z.boolean().describe("Whether the site is published.").optional(),
401
+ premium: z.boolean().describe("Whether the site has a Wix Premium (paid) plan.").optional(),
402
+ viewUrl: z.string().describe("Live site URL.").optional(),
403
+ editUrl: z.string().describe("Editor site URL.").optional(),
404
+ thumbnail: z.string().describe("Site thumbnail.").optional(),
405
+ ownerAccountId: z.string().describe("Site owner's account ID.").regex(
406
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
407
+ "Must be a valid GUID"
408
+ ).optional(),
409
+ contributorAccountIds: z.array(z.string()).min(1).max(1e3).optional(),
410
+ editorType: z.enum([
411
+ "UNKNOWN",
412
+ "EDITOR",
413
+ "ADI",
414
+ "EDITORX",
415
+ "STUDIO",
416
+ "ODEDITOR",
417
+ "PICASSO",
418
+ "WIXEL",
419
+ "STUDIO_TWO",
420
+ "EDITORLESS"
421
+ ]).describe("Site's Wix editor type.").optional(),
422
+ blocked: z.boolean().describe("Whether Wix has blocked this site due to legal issues.").optional(),
423
+ folderId: z.string().describe(
424
+ "Folder ID that contains this site. Empty if site is at root level."
425
+ ).regex(
426
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
427
+ "Must be a valid GUID"
428
+ ).optional().nullable(),
429
+ namespace: z.enum([
430
+ "UNKNOWN_NAMESPACE",
431
+ "WIX",
432
+ "SHOUT_OUT",
433
+ "ALBUMS",
434
+ "WIX_STORES_TEST_DRIVE",
435
+ "HOTELS",
436
+ "CLUBS",
437
+ "ONBOARDING_DRAFT",
438
+ "DEV_SITE",
439
+ "LOGOS",
440
+ "VIDEO_MAKER",
441
+ "PARTNER_DASHBOARD",
442
+ "DEV_CENTER_COMPANY",
443
+ "HTML_DRAFT",
444
+ "SITELESS_BUSINESS",
445
+ "CREATOR_ECONOMY",
446
+ "DASHBOARD_FIRST",
447
+ "ANYWHERE",
448
+ "HEADLESS",
449
+ "ACCOUNT_MASTER_CMS",
450
+ "RISE",
451
+ "BRANDED_FIRST",
452
+ "NOWNIA",
453
+ "UGC_TEMPLATE",
454
+ "CODUX",
455
+ "MEDIA_DESIGN_CREATOR",
456
+ "SHARED_BLOG_ENTERPRISE",
457
+ "STANDALONE_FORMS",
458
+ "STANDALONE_EVENTS",
459
+ "MIMIR",
460
+ "TWINS",
461
+ "NANO",
462
+ "BASE44",
463
+ "CHANNELS",
464
+ "NAUTILUS"
465
+ ]).describe("Namespace of the site, for internal use.").optional(),
466
+ domainConnected: z.boolean().describe("Whether the site has a connected domain.").optional(),
467
+ parentChildRole: z.enum(["NONE", "CHILD", "PARENT"]).describe(
468
+ "Role of the site in a parent-child data-sharing relationship."
469
+ ).optional(),
470
+ parentId: z.string().describe("For child sites, the parent meta site ID.").regex(
471
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
472
+ "Must be a valid GUID"
473
+ ).optional().nullable()
474
+ })
475
+ ).optional(),
476
+ cursorPaging: z.object({
477
+ limit: z.number().int().describe("Maximum number of items to return in the results.").min(0).max(100).optional().nullable(),
478
+ cursor: z.string().describe(
479
+ "Pointer to the next or previous page in the list of results.\n\nPass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\nNot relevant for the first request."
480
+ ).max(16e3).optional().nullable()
481
+ }).describe("Paging information.").optional(),
482
+ metadata: z.object({
483
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
484
+ cursors: z.object({
485
+ next: z.string().describe("Cursor pointing to next page in the list of results.").optional().nullable()
486
+ }).describe(
487
+ "Cursors to navigate through the result pages. Returned if cursor paging is used."
488
+ ).optional()
489
+ }).describe("Meta data about the returned sites").optional()
490
+ });
491
+ var CountSitesRequest = z.object({
492
+ options: z.object({
493
+ filter: z.record(z.string(), z.any()).describe(
494
+ "Filter object. See [Query Sites](https://dev.wix.com/docs/rest/account-level-apis/sites/sites/query-sites) for a list of supported filters.\nNote: the `premium` and `appIds` filters are not supported in this endpoint."
495
+ ).optional().nullable()
496
+ }).optional()
497
+ });
498
+ var CountSitesResponse = z.object({
499
+ count: z.number().int().describe(
500
+ "Number of sites retrieved basd on the filter.\nFree Wix accounts are limited to max 1,000 sites.\nPremium accounts can have an unlimited number of sites."
501
+ ).optional()
502
+ });
503
+
504
+ // src/site-list-v2-site-sites.universal.ts
219
505
  var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
220
506
  var EditorType = /* @__PURE__ */ ((EditorType2) => {
221
507
  EditorType2["UNKNOWN"] = "UNKNOWN";
@@ -331,7 +617,10 @@ function querySites2() {
331
617
  });
332
618
  }
333
619
  async function typedQuerySites(query) {
334
- const { httpClient, sideEffects } = arguments[1];
620
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
621
+ if (validateRequestSchema) {
622
+ QuerySitesRequest.parse({ query });
623
+ }
335
624
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
336
625
  const reqOpts = querySites(payload);
337
626
  sideEffects?.onSiteCall?.();
@@ -359,7 +648,10 @@ var utils = {
359
648
  }
360
649
  };
361
650
  async function countSites2(options) {
362
- const { httpClient, sideEffects } = arguments[1];
651
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
652
+ if (validateRequestSchema) {
653
+ CountSitesRequest.parse({ options });
654
+ }
363
655
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
364
656
  filter: options?.filter
365
657
  });
@@ -385,24 +677,24 @@ async function countSites2(options) {
385
677
  }
386
678
 
387
679
  // src/site-list-v2-site-sites.public.ts
388
- function querySites3(httpClient) {
680
+ function querySites3(httpClient, __options) {
389
681
  return () => querySites2(
390
682
  // @ts-ignore
391
- { httpClient }
683
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
392
684
  );
393
685
  }
394
- function typedQuerySites2(httpClient) {
686
+ function typedQuerySites2(httpClient, __options) {
395
687
  return (query) => typedQuerySites(
396
688
  query,
397
689
  // @ts-ignore
398
- { httpClient }
690
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
399
691
  );
400
692
  }
401
- function countSites3(httpClient) {
693
+ function countSites3(httpClient, __options) {
402
694
  return (options) => countSites2(
403
695
  options,
404
696
  // @ts-ignore
405
- { httpClient }
697
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
406
698
  );
407
699
  }
408
700
  var onSiteCreated = (0, import_sdk_types.EventDefinition)(