@wix/auto_sdk_crm_labels 1.0.59 → 1.0.60

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.
@@ -252,6 +252,236 @@ function queryLabels(payload) {
252
252
 
253
253
  // src/contacts-v4-label-labels.universal.ts
254
254
  import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
255
+
256
+ // src/contacts-v4-label-labels.schemas.ts
257
+ import * as z from "zod";
258
+ var ListLabelsRequest = z.object({
259
+ options: z.object({
260
+ labelType: z.enum(["SYSTEM", "USER_DEFINED", "WIX_APP_DEFINED"]).optional(),
261
+ namespace: z.string().describe("Filter for labels in the specified namespace.").min(3).max(25).optional().nullable(),
262
+ startsWith: z.string().describe(
263
+ "Filter for labels where `displayName` starts with the specified case-sensitive string."
264
+ ).min(1).max(180).optional().nullable(),
265
+ sort: z.object({
266
+ fieldName: z.string().describe("Name of the field to sort by.").max(3e3).optional(),
267
+ order: z.enum(["ASC", "DESC"]).optional()
268
+ }).describe("Sorting options.").optional(),
269
+ paging: z.object({
270
+ limit: z.number().int().describe(
271
+ "Number of items to return.\n\nDefaults to `1000`. <br>\nMaximum: `2000`."
272
+ ).min(0).optional().nullable(),
273
+ offset: z.number().int().describe("Number of items to skip in the current sort order.").min(0).optional().nullable()
274
+ }).describe("Paging options.").optional(),
275
+ language: z.string().optional().nullable()
276
+ }).optional()
277
+ });
278
+ var ListLabelsResponse = z.object({
279
+ labels: z.array(
280
+ z.object({
281
+ namespace: z.string().describe(
282
+ "Label namespace.\n\nLabels created by calling the Find Or Create Label method\nare automatically assigned to the `custom` namespace."
283
+ ).min(1).max(25).optional().nullable(),
284
+ namespaceDisplayName: z.string().describe(
285
+ "Display name for the namespace,\nused to organize the list of labels in the site dashboard."
286
+ ).min(1).max(180).optional().nullable(),
287
+ key: z.string().describe(
288
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
289
+ ).min(1).max(80).optional(),
290
+ displayName: z.string().describe("Label display name shown in the dashboard.").min(1).max(180).optional(),
291
+ labelType: z.enum(["SYSTEM", "USER_DEFINED", "WIX_APP_DEFINED"]).describe("Label type indicating how the label was created.").optional(),
292
+ _createdDate: z.date().describe("Date and time the label was created.").optional().nullable(),
293
+ _updatedDate: z.date().describe("Date and time the label was last updated.").optional().nullable()
294
+ })
295
+ ).optional(),
296
+ metadata: z.object({
297
+ count: z.number().int().describe("Number of items returned.").optional().nullable(),
298
+ offset: z.number().int().describe("Requested offset.").optional().nullable(),
299
+ total: z.number().int().describe("Number of items that matched the query.").optional().nullable(),
300
+ tooManyToCount: z.boolean().describe(
301
+ "Indicates if `total` calculation timed out before the response was sent.\nTypically this happens if there is a large set of results."
302
+ ).optional().nullable()
303
+ }).describe("Metadata for the page of results.").optional()
304
+ });
305
+ var FindOrCreateLabelRequest = z.object({
306
+ displayName: z.string().describe(
307
+ "Display name to retrieve or create.\n\nIf an existing label is an exact match\nfor the specified display name,\nthe existing label is returned.\nIf not, a new label is created and returned."
308
+ ).min(1).max(180),
309
+ options: z.object({
310
+ language: z.string().describe(
311
+ "Language for localization.\n2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format."
312
+ ).optional().nullable()
313
+ }).describe("Language options.").optional()
314
+ });
315
+ var FindOrCreateLabelResponse = z.object({
316
+ label: z.object({
317
+ namespace: z.string().describe(
318
+ "Label namespace.\n\nLabels created by calling the Find Or Create Label method\nare automatically assigned to the `custom` namespace."
319
+ ).min(1).max(25).optional().nullable(),
320
+ namespaceDisplayName: z.string().describe(
321
+ "Display name for the namespace,\nused to organize the list of labels in the site dashboard."
322
+ ).min(1).max(180).optional().nullable(),
323
+ key: z.string().describe(
324
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
325
+ ).min(1).max(80).optional(),
326
+ displayName: z.string().describe("Label display name shown in the dashboard.").min(1).max(180).optional(),
327
+ labelType: z.enum(["SYSTEM", "USER_DEFINED", "WIX_APP_DEFINED"]).describe("Label type indicating how the label was created.").optional(),
328
+ _createdDate: z.date().describe("Date and time the label was created.").optional().nullable(),
329
+ _updatedDate: z.date().describe("Date and time the label was last updated.").optional().nullable()
330
+ }).describe("Label that was found or created.").optional(),
331
+ newLabel: z.boolean().describe(
332
+ "Indicates whether the label was just created or already existed.\n\nReturns `true` if the label was just created."
333
+ ).optional()
334
+ });
335
+ var GetLabelRequest = z.object({
336
+ key: z.string().describe(
337
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
338
+ ).min(1).max(80),
339
+ options: z.object({
340
+ language: z.string().describe(
341
+ "Language for localization.\n2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format."
342
+ ).optional().nullable()
343
+ }).describe("Language options.").optional()
344
+ });
345
+ var GetLabelResponse = z.object({
346
+ namespace: z.string().describe(
347
+ "Label namespace.\n\nLabels created by calling the Find Or Create Label method\nare automatically assigned to the `custom` namespace."
348
+ ).min(1).max(25).optional().nullable(),
349
+ namespaceDisplayName: z.string().describe(
350
+ "Display name for the namespace,\nused to organize the list of labels in the site dashboard."
351
+ ).min(1).max(180).optional().nullable(),
352
+ key: z.string().describe(
353
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
354
+ ).min(1).max(80).optional(),
355
+ displayName: z.string().describe("Label display name shown in the dashboard.").min(1).max(180).optional(),
356
+ labelType: z.enum(["SYSTEM", "USER_DEFINED", "WIX_APP_DEFINED"]).describe("Label type indicating how the label was created.").optional(),
357
+ _createdDate: z.date().describe("Date and time the label was created.").optional().nullable(),
358
+ _updatedDate: z.date().describe("Date and time the label was last updated.").optional().nullable()
359
+ });
360
+ var RenameLabelRequest = z.object({
361
+ key: z.string().describe(
362
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
363
+ ).min(1).max(80),
364
+ label: z.object({
365
+ namespace: z.string().describe(
366
+ "Label namespace.\n\nLabels created by calling the Find Or Create Label method\nare automatically assigned to the `custom` namespace."
367
+ ).min(1).max(25).optional().nullable(),
368
+ namespaceDisplayName: z.string().describe(
369
+ "Display name for the namespace,\nused to organize the list of labels in the site dashboard."
370
+ ).min(1).max(180).optional().nullable(),
371
+ key: z.string().describe(
372
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
373
+ ).min(1).max(80).optional(),
374
+ displayName: z.string().describe("Label display name shown in the dashboard.").min(1).max(180),
375
+ labelType: z.enum(["SYSTEM", "USER_DEFINED", "WIX_APP_DEFINED"]).optional(),
376
+ _createdDate: z.date().describe("Date and time the label was created.").optional().nullable(),
377
+ _updatedDate: z.date().describe("Date and time the label was last updated.").optional().nullable()
378
+ }).describe("Label to rename. "),
379
+ options: z.object({
380
+ language: z.string().describe(
381
+ "Language for localization.\n2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format."
382
+ ).optional().nullable()
383
+ }).describe("Language options.").optional()
384
+ });
385
+ var RenameLabelResponse = z.object({
386
+ namespace: z.string().describe(
387
+ "Label namespace.\n\nLabels created by calling the Find Or Create Label method\nare automatically assigned to the `custom` namespace."
388
+ ).min(1).max(25).optional().nullable(),
389
+ namespaceDisplayName: z.string().describe(
390
+ "Display name for the namespace,\nused to organize the list of labels in the site dashboard."
391
+ ).min(1).max(180).optional().nullable(),
392
+ key: z.string().describe(
393
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
394
+ ).min(1).max(80).optional(),
395
+ displayName: z.string().describe("Label display name shown in the dashboard.").min(1).max(180).optional(),
396
+ labelType: z.enum(["SYSTEM", "USER_DEFINED", "WIX_APP_DEFINED"]).describe("Label type indicating how the label was created.").optional(),
397
+ _createdDate: z.date().describe("Date and time the label was created.").optional().nullable(),
398
+ _updatedDate: z.date().describe("Date and time the label was last updated.").optional().nullable()
399
+ });
400
+ var DeleteLabelRequest = z.object({
401
+ key: z.string().describe("Label key to delete.").min(1).max(80)
402
+ });
403
+ var DeleteLabelResponse = z.object({});
404
+ var QueryLabelsRequest = z.object({
405
+ query: z.object({
406
+ filter: z.object({
407
+ key: z.object({
408
+ $eq: z.string(),
409
+ $in: z.array(z.string()),
410
+ $ne: z.string()
411
+ }).partial().strict().optional(),
412
+ displayName: z.object({
413
+ $eq: z.string(),
414
+ $in: z.array(z.string()),
415
+ $ne: z.string(),
416
+ $startsWith: z.string()
417
+ }).partial().strict().optional(),
418
+ _createdDate: z.object({
419
+ $eq: z.string(),
420
+ $gt: z.string(),
421
+ $gte: z.string(),
422
+ $lt: z.string(),
423
+ $lte: z.string(),
424
+ $ne: z.string()
425
+ }).partial().strict().optional(),
426
+ _updatedDate: z.object({
427
+ $eq: z.string(),
428
+ $gt: z.string(),
429
+ $gte: z.string(),
430
+ $lt: z.string(),
431
+ $lte: z.string(),
432
+ $ne: z.string()
433
+ }).partial().strict().optional(),
434
+ namespace: z.object({ $eq: z.string(), $ne: z.string() }).partial().strict().optional(),
435
+ labelType: z.union([
436
+ z.string(),
437
+ z.object({ $eq: z.string() }).partial().strict()
438
+ ]).optional(),
439
+ $and: z.array(z.any()).optional(),
440
+ $or: z.array(z.any()).optional(),
441
+ $not: z.any().optional()
442
+ }).strict().optional(),
443
+ sort: z.array(
444
+ z.object({
445
+ fieldName: z.enum(["displayName", "_createdDate", "_updatedDate"]).optional(),
446
+ order: z.enum(["ASC", "DESC"]).optional()
447
+ })
448
+ ).optional()
449
+ }).catchall(z.any()).describe("Query options."),
450
+ options: z.object({
451
+ language: z.string().describe(
452
+ "Language for localization.\n2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format."
453
+ ).optional().nullable()
454
+ }).describe("Language options.").optional()
455
+ });
456
+ var QueryLabelsResponse = z.object({
457
+ labels: z.array(
458
+ z.object({
459
+ namespace: z.string().describe(
460
+ "Label namespace.\n\nLabels created by calling the Find Or Create Label method\nare automatically assigned to the `custom` namespace."
461
+ ).min(1).max(25).optional().nullable(),
462
+ namespaceDisplayName: z.string().describe(
463
+ "Display name for the namespace,\nused to organize the list of labels in the site dashboard."
464
+ ).min(1).max(180).optional().nullable(),
465
+ key: z.string().describe(
466
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
467
+ ).min(1).max(80).optional(),
468
+ displayName: z.string().describe("Label display name shown in the dashboard.").min(1).max(180).optional(),
469
+ labelType: z.enum(["SYSTEM", "USER_DEFINED", "WIX_APP_DEFINED"]).describe("Label type indicating how the label was created.").optional(),
470
+ _createdDate: z.date().describe("Date and time the label was created.").optional().nullable(),
471
+ _updatedDate: z.date().describe("Date and time the label was last updated.").optional().nullable()
472
+ })
473
+ ).optional(),
474
+ pagingMetadata: z.object({
475
+ count: z.number().int().describe("Number of items returned.").optional().nullable(),
476
+ offset: z.number().int().describe("Requested offset.").optional().nullable(),
477
+ total: z.number().int().describe("Number of items that matched the query.").optional().nullable(),
478
+ tooManyToCount: z.boolean().describe(
479
+ "Indicates if `total` calculation timed out before the response was sent.\nTypically this happens if there is a large set of results."
480
+ ).optional().nullable()
481
+ }).describe("Details on the paged set of results returned.").optional()
482
+ });
483
+
484
+ // src/contacts-v4-label-labels.universal.ts
255
485
  import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
256
486
  var LabelType = /* @__PURE__ */ ((LabelType2) => {
257
487
  LabelType2["SYSTEM"] = "SYSTEM";
@@ -273,7 +503,10 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
273
503
  return WebhookIdentityType2;
274
504
  })(WebhookIdentityType || {});
275
505
  async function listLabels2(options) {
276
- const { httpClient, sideEffects } = arguments[1];
506
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
507
+ if (validateRequestSchema) {
508
+ ListLabelsRequest.parse({ options });
509
+ }
277
510
  const payload = renameKeysFromSDKRequestToRESTRequest({
278
511
  labelType: options?.labelType,
279
512
  namespace: options?.namespace,
@@ -310,7 +543,10 @@ async function listLabels2(options) {
310
543
  }
311
544
  }
312
545
  async function findOrCreateLabel2(displayName, options) {
313
- const { httpClient, sideEffects } = arguments[2];
546
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
547
+ if (validateRequestSchema) {
548
+ FindOrCreateLabelRequest.parse({ displayName, options });
549
+ }
314
550
  const payload = renameKeysFromSDKRequestToRESTRequest({
315
551
  displayName,
316
552
  language: options?.language
@@ -339,7 +575,10 @@ async function findOrCreateLabel2(displayName, options) {
339
575
  }
340
576
  }
341
577
  async function getLabel2(key, options) {
342
- const { httpClient, sideEffects } = arguments[2];
578
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
579
+ if (validateRequestSchema) {
580
+ GetLabelRequest.parse({ key, options });
581
+ }
343
582
  const payload = renameKeysFromSDKRequestToRESTRequest({
344
583
  key,
345
584
  language: options?.language
@@ -365,7 +604,10 @@ async function getLabel2(key, options) {
365
604
  }
366
605
  }
367
606
  async function renameLabel(key, label, options) {
368
- const { httpClient, sideEffects } = arguments[3];
607
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[3];
608
+ if (validateRequestSchema) {
609
+ RenameLabelRequest.parse({ key, label, options });
610
+ }
369
611
  const payload = renameKeysFromSDKRequestToRESTRequest({
370
612
  label: { ...label, key },
371
613
  language: options?.language
@@ -394,7 +636,10 @@ async function renameLabel(key, label, options) {
394
636
  }
395
637
  }
396
638
  async function deleteLabel2(key) {
397
- const { httpClient, sideEffects } = arguments[1];
639
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
640
+ if (validateRequestSchema) {
641
+ DeleteLabelRequest.parse({ key });
642
+ }
398
643
  const payload = renameKeysFromSDKRequestToRESTRequest({ key });
399
644
  const reqOpts = deleteLabel(payload);
400
645
  sideEffects?.onSiteCall?.();
@@ -462,7 +707,10 @@ function queryLabels2(options) {
462
707
  });
463
708
  }
464
709
  async function typedQueryLabels(query, options) {
465
- const { httpClient, sideEffects } = arguments[2];
710
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
711
+ if (validateRequestSchema) {
712
+ QueryLabelsRequest.parse({ query, options });
713
+ }
466
714
  const payload = renameKeysFromSDKRequestToRESTRequest({
467
715
  query,
468
716
  ...options
@@ -494,58 +742,58 @@ var utils = {
494
742
  };
495
743
 
496
744
  // src/contacts-v4-label-labels.public.ts
497
- function listLabels3(httpClient) {
745
+ function listLabels3(httpClient, __options) {
498
746
  return (options) => listLabels2(
499
747
  options,
500
748
  // @ts-ignore
501
- { httpClient }
749
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
502
750
  );
503
751
  }
504
- function findOrCreateLabel3(httpClient) {
752
+ function findOrCreateLabel3(httpClient, __options) {
505
753
  return (displayName, options) => findOrCreateLabel2(
506
754
  displayName,
507
755
  options,
508
756
  // @ts-ignore
509
- { httpClient }
757
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
510
758
  );
511
759
  }
512
- function getLabel3(httpClient) {
760
+ function getLabel3(httpClient, __options) {
513
761
  return (key, options) => getLabel2(
514
762
  key,
515
763
  options,
516
764
  // @ts-ignore
517
- { httpClient }
765
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
518
766
  );
519
767
  }
520
- function renameLabel2(httpClient) {
768
+ function renameLabel2(httpClient, __options) {
521
769
  return (key, label, options) => renameLabel(
522
770
  key,
523
771
  label,
524
772
  options,
525
773
  // @ts-ignore
526
- { httpClient }
774
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
527
775
  );
528
776
  }
529
- function deleteLabel3(httpClient) {
777
+ function deleteLabel3(httpClient, __options) {
530
778
  return (key) => deleteLabel2(
531
779
  key,
532
780
  // @ts-ignore
533
- { httpClient }
781
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
534
782
  );
535
783
  }
536
- function queryLabels3(httpClient) {
784
+ function queryLabels3(httpClient, __options) {
537
785
  return (options) => queryLabels2(
538
786
  options,
539
787
  // @ts-ignore
540
- { httpClient }
788
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
541
789
  );
542
790
  }
543
- function typedQueryLabels2(httpClient) {
791
+ function typedQueryLabels2(httpClient, __options) {
544
792
  return (query, options) => typedQueryLabels(
545
793
  query,
546
794
  options,
547
795
  // @ts-ignore
548
- { httpClient }
796
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
549
797
  );
550
798
  }
551
799
  var onLabelCreated = EventDefinition(