@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.
@@ -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.typings.ts
@@ -279,6 +289,236 @@ function queryLabels(payload) {
279
289
 
280
290
  // src/contacts-v4-label-labels.universal.ts
281
291
  var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
292
+
293
+ // src/contacts-v4-label-labels.schemas.ts
294
+ var z = __toESM(require("zod"));
295
+ var ListLabelsRequest = z.object({
296
+ options: z.object({
297
+ labelType: z.enum(["SYSTEM", "USER_DEFINED", "WIX_APP_DEFINED"]).optional(),
298
+ namespace: z.string().describe("Filter for labels in the specified namespace.").min(3).max(25).optional().nullable(),
299
+ startsWith: z.string().describe(
300
+ "Filter for labels where `displayName` starts with the specified case-sensitive string."
301
+ ).min(1).max(180).optional().nullable(),
302
+ sort: z.object({
303
+ fieldName: z.string().describe("Name of the field to sort by.").max(3e3).optional(),
304
+ order: z.enum(["ASC", "DESC"]).optional()
305
+ }).describe("Sorting options.").optional(),
306
+ paging: z.object({
307
+ limit: z.number().int().describe(
308
+ "Number of items to return.\n\nDefaults to `1000`. <br>\nMaximum: `2000`."
309
+ ).min(0).optional().nullable(),
310
+ offset: z.number().int().describe("Number of items to skip in the current sort order.").min(0).optional().nullable()
311
+ }).describe("Paging options.").optional(),
312
+ language: z.string().optional().nullable()
313
+ }).optional()
314
+ });
315
+ var ListLabelsResponse = z.object({
316
+ labels: z.array(
317
+ z.object({
318
+ namespace: z.string().describe(
319
+ "Label namespace.\n\nLabels created by calling the Find Or Create Label method\nare automatically assigned to the `custom` namespace."
320
+ ).min(1).max(25).optional().nullable(),
321
+ namespaceDisplayName: z.string().describe(
322
+ "Display name for the namespace,\nused to organize the list of labels in the site dashboard."
323
+ ).min(1).max(180).optional().nullable(),
324
+ key: z.string().describe(
325
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
326
+ ).min(1).max(80).optional(),
327
+ displayName: z.string().describe("Label display name shown in the dashboard.").min(1).max(180).optional(),
328
+ labelType: z.enum(["SYSTEM", "USER_DEFINED", "WIX_APP_DEFINED"]).describe("Label type indicating how the label was created.").optional(),
329
+ _createdDate: z.date().describe("Date and time the label was created.").optional().nullable(),
330
+ _updatedDate: z.date().describe("Date and time the label was last updated.").optional().nullable()
331
+ })
332
+ ).optional(),
333
+ metadata: z.object({
334
+ count: z.number().int().describe("Number of items returned.").optional().nullable(),
335
+ offset: z.number().int().describe("Requested offset.").optional().nullable(),
336
+ total: z.number().int().describe("Number of items that matched the query.").optional().nullable(),
337
+ tooManyToCount: z.boolean().describe(
338
+ "Indicates if `total` calculation timed out before the response was sent.\nTypically this happens if there is a large set of results."
339
+ ).optional().nullable()
340
+ }).describe("Metadata for the page of results.").optional()
341
+ });
342
+ var FindOrCreateLabelRequest = z.object({
343
+ displayName: z.string().describe(
344
+ "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."
345
+ ).min(1).max(180),
346
+ options: z.object({
347
+ language: z.string().describe(
348
+ "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."
349
+ ).optional().nullable()
350
+ }).describe("Language options.").optional()
351
+ });
352
+ var FindOrCreateLabelResponse = z.object({
353
+ label: z.object({
354
+ namespace: z.string().describe(
355
+ "Label namespace.\n\nLabels created by calling the Find Or Create Label method\nare automatically assigned to the `custom` namespace."
356
+ ).min(1).max(25).optional().nullable(),
357
+ namespaceDisplayName: z.string().describe(
358
+ "Display name for the namespace,\nused to organize the list of labels in the site dashboard."
359
+ ).min(1).max(180).optional().nullable(),
360
+ key: z.string().describe(
361
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
362
+ ).min(1).max(80).optional(),
363
+ displayName: z.string().describe("Label display name shown in the dashboard.").min(1).max(180).optional(),
364
+ labelType: z.enum(["SYSTEM", "USER_DEFINED", "WIX_APP_DEFINED"]).describe("Label type indicating how the label was created.").optional(),
365
+ _createdDate: z.date().describe("Date and time the label was created.").optional().nullable(),
366
+ _updatedDate: z.date().describe("Date and time the label was last updated.").optional().nullable()
367
+ }).describe("Label that was found or created.").optional(),
368
+ newLabel: z.boolean().describe(
369
+ "Indicates whether the label was just created or already existed.\n\nReturns `true` if the label was just created."
370
+ ).optional()
371
+ });
372
+ var GetLabelRequest = z.object({
373
+ key: z.string().describe(
374
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
375
+ ).min(1).max(80),
376
+ options: z.object({
377
+ language: z.string().describe(
378
+ "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."
379
+ ).optional().nullable()
380
+ }).describe("Language options.").optional()
381
+ });
382
+ var GetLabelResponse = z.object({
383
+ namespace: z.string().describe(
384
+ "Label namespace.\n\nLabels created by calling the Find Or Create Label method\nare automatically assigned to the `custom` namespace."
385
+ ).min(1).max(25).optional().nullable(),
386
+ namespaceDisplayName: z.string().describe(
387
+ "Display name for the namespace,\nused to organize the list of labels in the site dashboard."
388
+ ).min(1).max(180).optional().nullable(),
389
+ key: z.string().describe(
390
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
391
+ ).min(1).max(80).optional(),
392
+ displayName: z.string().describe("Label display name shown in the dashboard.").min(1).max(180).optional(),
393
+ labelType: z.enum(["SYSTEM", "USER_DEFINED", "WIX_APP_DEFINED"]).describe("Label type indicating how the label was created.").optional(),
394
+ _createdDate: z.date().describe("Date and time the label was created.").optional().nullable(),
395
+ _updatedDate: z.date().describe("Date and time the label was last updated.").optional().nullable()
396
+ });
397
+ var RenameLabelRequest = z.object({
398
+ key: z.string().describe(
399
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
400
+ ).min(1).max(80),
401
+ label: z.object({
402
+ namespace: z.string().describe(
403
+ "Label namespace.\n\nLabels created by calling the Find Or Create Label method\nare automatically assigned to the `custom` namespace."
404
+ ).min(1).max(25).optional().nullable(),
405
+ namespaceDisplayName: z.string().describe(
406
+ "Display name for the namespace,\nused to organize the list of labels in the site dashboard."
407
+ ).min(1).max(180).optional().nullable(),
408
+ key: z.string().describe(
409
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
410
+ ).min(1).max(80).optional(),
411
+ displayName: z.string().describe("Label display name shown in the dashboard.").min(1).max(180),
412
+ labelType: z.enum(["SYSTEM", "USER_DEFINED", "WIX_APP_DEFINED"]).optional(),
413
+ _createdDate: z.date().describe("Date and time the label was created.").optional().nullable(),
414
+ _updatedDate: z.date().describe("Date and time the label was last updated.").optional().nullable()
415
+ }).describe("Label to rename. "),
416
+ options: z.object({
417
+ language: z.string().describe(
418
+ "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."
419
+ ).optional().nullable()
420
+ }).describe("Language options.").optional()
421
+ });
422
+ var RenameLabelResponse = z.object({
423
+ namespace: z.string().describe(
424
+ "Label namespace.\n\nLabels created by calling the Find Or Create Label method\nare automatically assigned to the `custom` namespace."
425
+ ).min(1).max(25).optional().nullable(),
426
+ namespaceDisplayName: z.string().describe(
427
+ "Display name for the namespace,\nused to organize the list of labels in the site dashboard."
428
+ ).min(1).max(180).optional().nullable(),
429
+ key: z.string().describe(
430
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
431
+ ).min(1).max(80).optional(),
432
+ displayName: z.string().describe("Label display name shown in the dashboard.").min(1).max(180).optional(),
433
+ labelType: z.enum(["SYSTEM", "USER_DEFINED", "WIX_APP_DEFINED"]).describe("Label type indicating how the label was created.").optional(),
434
+ _createdDate: z.date().describe("Date and time the label was created.").optional().nullable(),
435
+ _updatedDate: z.date().describe("Date and time the label was last updated.").optional().nullable()
436
+ });
437
+ var DeleteLabelRequest = z.object({
438
+ key: z.string().describe("Label key to delete.").min(1).max(80)
439
+ });
440
+ var DeleteLabelResponse = z.object({});
441
+ var QueryLabelsRequest = z.object({
442
+ query: z.object({
443
+ filter: z.object({
444
+ key: z.object({
445
+ $eq: z.string(),
446
+ $in: z.array(z.string()),
447
+ $ne: z.string()
448
+ }).partial().strict().optional(),
449
+ displayName: z.object({
450
+ $eq: z.string(),
451
+ $in: z.array(z.string()),
452
+ $ne: z.string(),
453
+ $startsWith: z.string()
454
+ }).partial().strict().optional(),
455
+ _createdDate: z.object({
456
+ $eq: z.string(),
457
+ $gt: z.string(),
458
+ $gte: z.string(),
459
+ $lt: z.string(),
460
+ $lte: z.string(),
461
+ $ne: z.string()
462
+ }).partial().strict().optional(),
463
+ _updatedDate: z.object({
464
+ $eq: z.string(),
465
+ $gt: z.string(),
466
+ $gte: z.string(),
467
+ $lt: z.string(),
468
+ $lte: z.string(),
469
+ $ne: z.string()
470
+ }).partial().strict().optional(),
471
+ namespace: z.object({ $eq: z.string(), $ne: z.string() }).partial().strict().optional(),
472
+ labelType: z.union([
473
+ z.string(),
474
+ z.object({ $eq: z.string() }).partial().strict()
475
+ ]).optional(),
476
+ $and: z.array(z.any()).optional(),
477
+ $or: z.array(z.any()).optional(),
478
+ $not: z.any().optional()
479
+ }).strict().optional(),
480
+ sort: z.array(
481
+ z.object({
482
+ fieldName: z.enum(["displayName", "_createdDate", "_updatedDate"]).optional(),
483
+ order: z.enum(["ASC", "DESC"]).optional()
484
+ })
485
+ ).optional()
486
+ }).catchall(z.any()).describe("Query options."),
487
+ options: z.object({
488
+ language: z.string().describe(
489
+ "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."
490
+ ).optional().nullable()
491
+ }).describe("Language options.").optional()
492
+ });
493
+ var QueryLabelsResponse = z.object({
494
+ labels: z.array(
495
+ z.object({
496
+ namespace: z.string().describe(
497
+ "Label namespace.\n\nLabels created by calling the Find Or Create Label method\nare automatically assigned to the `custom` namespace."
498
+ ).min(1).max(25).optional().nullable(),
499
+ namespaceDisplayName: z.string().describe(
500
+ "Display name for the namespace,\nused to organize the list of labels in the site dashboard."
501
+ ).min(1).max(180).optional().nullable(),
502
+ key: z.string().describe(
503
+ "Label key.\n\n`key` is generated when the label is created.\nIt can't be modified, even if `displayName` is updated."
504
+ ).min(1).max(80).optional(),
505
+ displayName: z.string().describe("Label display name shown in the dashboard.").min(1).max(180).optional(),
506
+ labelType: z.enum(["SYSTEM", "USER_DEFINED", "WIX_APP_DEFINED"]).describe("Label type indicating how the label was created.").optional(),
507
+ _createdDate: z.date().describe("Date and time the label was created.").optional().nullable(),
508
+ _updatedDate: z.date().describe("Date and time the label was last updated.").optional().nullable()
509
+ })
510
+ ).optional(),
511
+ pagingMetadata: z.object({
512
+ count: z.number().int().describe("Number of items returned.").optional().nullable(),
513
+ offset: z.number().int().describe("Requested offset.").optional().nullable(),
514
+ total: z.number().int().describe("Number of items that matched the query.").optional().nullable(),
515
+ tooManyToCount: z.boolean().describe(
516
+ "Indicates if `total` calculation timed out before the response was sent.\nTypically this happens if there is a large set of results."
517
+ ).optional().nullable()
518
+ }).describe("Details on the paged set of results returned.").optional()
519
+ });
520
+
521
+ // src/contacts-v4-label-labels.universal.ts
282
522
  var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
283
523
  var LabelType = /* @__PURE__ */ ((LabelType2) => {
284
524
  LabelType2["SYSTEM"] = "SYSTEM";
@@ -300,7 +540,10 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
300
540
  return WebhookIdentityType2;
301
541
  })(WebhookIdentityType || {});
302
542
  async function listLabels2(options) {
303
- const { httpClient, sideEffects } = arguments[1];
543
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
544
+ if (validateRequestSchema) {
545
+ ListLabelsRequest.parse({ options });
546
+ }
304
547
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
305
548
  labelType: options?.labelType,
306
549
  namespace: options?.namespace,
@@ -337,7 +580,10 @@ async function listLabels2(options) {
337
580
  }
338
581
  }
339
582
  async function findOrCreateLabel2(displayName, options) {
340
- const { httpClient, sideEffects } = arguments[2];
583
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
584
+ if (validateRequestSchema) {
585
+ FindOrCreateLabelRequest.parse({ displayName, options });
586
+ }
341
587
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
342
588
  displayName,
343
589
  language: options?.language
@@ -366,7 +612,10 @@ async function findOrCreateLabel2(displayName, options) {
366
612
  }
367
613
  }
368
614
  async function getLabel2(key, options) {
369
- const { httpClient, sideEffects } = arguments[2];
615
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
616
+ if (validateRequestSchema) {
617
+ GetLabelRequest.parse({ key, options });
618
+ }
370
619
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
371
620
  key,
372
621
  language: options?.language
@@ -392,7 +641,10 @@ async function getLabel2(key, options) {
392
641
  }
393
642
  }
394
643
  async function renameLabel(key, label, options) {
395
- const { httpClient, sideEffects } = arguments[3];
644
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[3];
645
+ if (validateRequestSchema) {
646
+ RenameLabelRequest.parse({ key, label, options });
647
+ }
396
648
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
397
649
  label: { ...label, key },
398
650
  language: options?.language
@@ -421,7 +673,10 @@ async function renameLabel(key, label, options) {
421
673
  }
422
674
  }
423
675
  async function deleteLabel2(key) {
424
- const { httpClient, sideEffects } = arguments[1];
676
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
677
+ if (validateRequestSchema) {
678
+ DeleteLabelRequest.parse({ key });
679
+ }
425
680
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ key });
426
681
  const reqOpts = deleteLabel(payload);
427
682
  sideEffects?.onSiteCall?.();
@@ -489,7 +744,10 @@ function queryLabels2(options) {
489
744
  });
490
745
  }
491
746
  async function typedQueryLabels(query, options) {
492
- const { httpClient, sideEffects } = arguments[2];
747
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
748
+ if (validateRequestSchema) {
749
+ QueryLabelsRequest.parse({ query, options });
750
+ }
493
751
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
494
752
  query,
495
753
  ...options