@wix/auto_sdk_crm_pipelines 1.0.6 → 1.0.7

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
@@ -321,6 +331,454 @@ function bulkUpdatePipelineTagsByFilter(payload) {
321
331
 
322
332
  // src/crm-pipelines-v1-pipeline-pipelines.universal.ts
323
333
  var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
334
+
335
+ // src/crm-pipelines-v1-pipeline-pipelines.schemas.ts
336
+ var z = __toESM(require("zod"));
337
+ var CreatePipelineRequest = z.object({
338
+ pipeline: z.object({
339
+ _id: z.string().describe("Pipeline ID.").regex(
340
+ /^[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}$/,
341
+ "Must be a valid GUID"
342
+ ).optional().nullable(),
343
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
344
+ "Revision number, which increments by 1 each time the pipeline is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the pipeline.\n\nIgnored when creating a pipeline."
345
+ ).optional().nullable(),
346
+ _createdDate: z.date().describe(
347
+ "Date and time the pipeline was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format."
348
+ ).optional().nullable(),
349
+ _updatedDate: z.date().describe(
350
+ "Date and time the pipeline was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format."
351
+ ).optional().nullable(),
352
+ name: z.string().describe("Pipeline name.").min(1).max(60),
353
+ currency: z.string().describe(
354
+ "Currency code for monetary values in this pipeline. Must be a valid ISO 4217 currency code. For example, `USD`.\n\nDefault: Based on the site's currency settings."
355
+ ).optional().nullable(),
356
+ stages: z.array(
357
+ z.object({
358
+ _id: z.string().describe("Stage ID.").regex(
359
+ /^[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}$/,
360
+ "Must be a valid GUID"
361
+ ).optional().nullable(),
362
+ name: z.string().describe("Stage name.").min(1).max(40),
363
+ staleDurationInHours: z.number().int().describe(
364
+ "The duration (in hours) a card can remain in this stage before becoming stale.\nWhen a card exceeds this duration, it's marked as stale to indicate potential workflow delays."
365
+ ).min(1).max(1e5).optional().nullable()
366
+ })
367
+ ).min(1).max(30),
368
+ doneStage: z.object({
369
+ _id: z.string().describe("Done stage ID.").regex(
370
+ /^[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}$/,
371
+ "Must be a valid GUID"
372
+ ).optional().nullable(),
373
+ name: z.string().describe("Done stage name.").min(1).max(40),
374
+ allowedOutcomes: z.array(z.enum(["NONE", "WON", "LOST"])).min(1).max(3)
375
+ }).describe(
376
+ "The final pipeline stage where cards receive a final outcome."
377
+ ),
378
+ extendedFields: z.object({
379
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
380
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
381
+ ).optional()
382
+ }).describe("Extended fields data.").optional(),
383
+ tags: z.object({
384
+ privateTags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
385
+ "Tags that are exposed to anyone with access to the entity, including site members and visitors."
386
+ ).optional()
387
+ }).describe("Tags for organizing and categorizing pipelines.").optional()
388
+ }).describe("Pipeline to create.")
389
+ });
390
+ var CreatePipelineResponse = z.object({
391
+ _id: z.string().describe("Pipeline ID.").regex(
392
+ /^[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}$/,
393
+ "Must be a valid GUID"
394
+ ).optional().nullable(),
395
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
396
+ "Revision number, which increments by 1 each time the pipeline is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the pipeline.\n\nIgnored when creating a pipeline."
397
+ ).optional().nullable(),
398
+ _createdDate: z.date().describe(
399
+ "Date and time the pipeline was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format."
400
+ ).optional().nullable(),
401
+ _updatedDate: z.date().describe(
402
+ "Date and time the pipeline was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format."
403
+ ).optional().nullable(),
404
+ name: z.string().describe("Pipeline name.").min(1).max(60).optional().nullable(),
405
+ currency: z.string().describe(
406
+ "Currency code for monetary values in this pipeline. Must be a valid ISO 4217 currency code. For example, `USD`.\n\nDefault: Based on the site's currency settings."
407
+ ).optional().nullable(),
408
+ stages: z.array(
409
+ z.object({
410
+ _id: z.string().describe("Stage ID.").regex(
411
+ /^[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}$/,
412
+ "Must be a valid GUID"
413
+ ).optional().nullable(),
414
+ name: z.string().describe("Stage name.").min(1).max(40).optional().nullable(),
415
+ staleDurationInHours: z.number().int().describe(
416
+ "The duration (in hours) a card can remain in this stage before becoming stale.\nWhen a card exceeds this duration, it's marked as stale to indicate potential workflow delays."
417
+ ).min(1).max(1e5).optional().nullable()
418
+ })
419
+ ).min(1).max(30).optional(),
420
+ doneStage: z.object({
421
+ _id: z.string().describe("Done stage ID.").regex(
422
+ /^[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}$/,
423
+ "Must be a valid GUID"
424
+ ).optional().nullable(),
425
+ name: z.string().describe("Done stage name.").min(1).max(40).optional().nullable(),
426
+ allowedOutcomes: z.array(z.enum(["NONE", "WON", "LOST"])).min(1).max(3).optional()
427
+ }).describe("The final pipeline stage where cards receive a final outcome.").optional(),
428
+ extendedFields: z.object({
429
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
430
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
431
+ ).optional()
432
+ }).describe("Extended fields data.").optional(),
433
+ tags: z.object({
434
+ privateTags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
435
+ "Tags that are exposed to anyone with access to the entity, including site members and visitors."
436
+ ).optional()
437
+ }).describe("Tags for organizing and categorizing pipelines.").optional()
438
+ });
439
+ var GetPipelineRequest = z.object({
440
+ pipelineId: z.string().describe("Pipeline ID to retrieve.").regex(
441
+ /^[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}$/,
442
+ "Must be a valid GUID"
443
+ )
444
+ });
445
+ var GetPipelineResponse = z.object({
446
+ _id: z.string().describe("Pipeline ID.").regex(
447
+ /^[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}$/,
448
+ "Must be a valid GUID"
449
+ ).optional().nullable(),
450
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
451
+ "Revision number, which increments by 1 each time the pipeline is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the pipeline.\n\nIgnored when creating a pipeline."
452
+ ).optional().nullable(),
453
+ _createdDate: z.date().describe(
454
+ "Date and time the pipeline was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format."
455
+ ).optional().nullable(),
456
+ _updatedDate: z.date().describe(
457
+ "Date and time the pipeline was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format."
458
+ ).optional().nullable(),
459
+ name: z.string().describe("Pipeline name.").min(1).max(60).optional().nullable(),
460
+ currency: z.string().describe(
461
+ "Currency code for monetary values in this pipeline. Must be a valid ISO 4217 currency code. For example, `USD`.\n\nDefault: Based on the site's currency settings."
462
+ ).optional().nullable(),
463
+ stages: z.array(
464
+ z.object({
465
+ _id: z.string().describe("Stage ID.").regex(
466
+ /^[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}$/,
467
+ "Must be a valid GUID"
468
+ ).optional().nullable(),
469
+ name: z.string().describe("Stage name.").min(1).max(40).optional().nullable(),
470
+ staleDurationInHours: z.number().int().describe(
471
+ "The duration (in hours) a card can remain in this stage before becoming stale.\nWhen a card exceeds this duration, it's marked as stale to indicate potential workflow delays."
472
+ ).min(1).max(1e5).optional().nullable()
473
+ })
474
+ ).min(1).max(30).optional(),
475
+ doneStage: z.object({
476
+ _id: z.string().describe("Done stage ID.").regex(
477
+ /^[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}$/,
478
+ "Must be a valid GUID"
479
+ ).optional().nullable(),
480
+ name: z.string().describe("Done stage name.").min(1).max(40).optional().nullable(),
481
+ allowedOutcomes: z.array(z.enum(["NONE", "WON", "LOST"])).min(1).max(3).optional()
482
+ }).describe("The final pipeline stage where cards receive a final outcome.").optional(),
483
+ extendedFields: z.object({
484
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
485
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
486
+ ).optional()
487
+ }).describe("Extended fields data.").optional(),
488
+ tags: z.object({
489
+ privateTags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
490
+ "Tags that are exposed to anyone with access to the entity, including site members and visitors."
491
+ ).optional()
492
+ }).describe("Tags for organizing and categorizing pipelines.").optional()
493
+ });
494
+ var UpdatePipelineRequest = z.object({
495
+ _id: z.string().describe("Pipeline ID.").regex(
496
+ /^[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}$/,
497
+ "Must be a valid GUID"
498
+ ),
499
+ pipeline: z.object({
500
+ _id: z.string().describe("Pipeline ID.").regex(
501
+ /^[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}$/,
502
+ "Must be a valid GUID"
503
+ ).optional().nullable(),
504
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
505
+ "Revision number, which increments by 1 each time the pipeline is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the pipeline.\n\nIgnored when creating a pipeline."
506
+ ),
507
+ _createdDate: z.date().describe(
508
+ "Date and time the pipeline was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format."
509
+ ).optional().nullable(),
510
+ _updatedDate: z.date().describe(
511
+ "Date and time the pipeline was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format."
512
+ ).optional().nullable(),
513
+ name: z.string().describe("Pipeline name.").min(1).max(60).optional().nullable(),
514
+ currency: z.string().describe(
515
+ "Currency code for monetary values in this pipeline. Must be a valid ISO 4217 currency code. For example, `USD`.\n\nDefault: Based on the site's currency settings."
516
+ ).optional().nullable(),
517
+ stages: z.array(
518
+ z.object({
519
+ _id: z.string().describe("Stage ID.").regex(
520
+ /^[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}$/,
521
+ "Must be a valid GUID"
522
+ ).optional().nullable(),
523
+ name: z.string().describe("Stage name.").min(1).max(40).optional().nullable(),
524
+ staleDurationInHours: z.number().int().describe(
525
+ "The duration (in hours) a card can remain in this stage before becoming stale.\nWhen a card exceeds this duration, it's marked as stale to indicate potential workflow delays."
526
+ ).min(1).max(1e5).optional().nullable()
527
+ })
528
+ ).min(1).max(30).optional(),
529
+ doneStage: z.object({
530
+ _id: z.string().describe("Done stage ID.").regex(
531
+ /^[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}$/,
532
+ "Must be a valid GUID"
533
+ ).optional().nullable(),
534
+ name: z.string().describe("Done stage name.").min(1).max(40).optional().nullable(),
535
+ allowedOutcomes: z.array(z.enum(["NONE", "WON", "LOST"])).min(1).max(3).optional()
536
+ }).describe(
537
+ "The final pipeline stage where cards receive a final outcome."
538
+ ).optional(),
539
+ extendedFields: z.object({
540
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
541
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
542
+ ).optional()
543
+ }).describe("Extended fields data.").optional(),
544
+ tags: z.object({
545
+ privateTags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
546
+ "Tags that are exposed to anyone with access to the entity, including site members and visitors."
547
+ ).optional()
548
+ }).describe("Tags for organizing and categorizing pipelines.").optional()
549
+ }).describe("Pipeline to update, may be partial.")
550
+ });
551
+ var UpdatePipelineResponse = z.object({
552
+ _id: z.string().describe("Pipeline ID.").regex(
553
+ /^[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}$/,
554
+ "Must be a valid GUID"
555
+ ).optional().nullable(),
556
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
557
+ "Revision number, which increments by 1 each time the pipeline is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the pipeline.\n\nIgnored when creating a pipeline."
558
+ ).optional().nullable(),
559
+ _createdDate: z.date().describe(
560
+ "Date and time the pipeline was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format."
561
+ ).optional().nullable(),
562
+ _updatedDate: z.date().describe(
563
+ "Date and time the pipeline was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format."
564
+ ).optional().nullable(),
565
+ name: z.string().describe("Pipeline name.").min(1).max(60).optional().nullable(),
566
+ currency: z.string().describe(
567
+ "Currency code for monetary values in this pipeline. Must be a valid ISO 4217 currency code. For example, `USD`.\n\nDefault: Based on the site's currency settings."
568
+ ).optional().nullable(),
569
+ stages: z.array(
570
+ z.object({
571
+ _id: z.string().describe("Stage ID.").regex(
572
+ /^[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}$/,
573
+ "Must be a valid GUID"
574
+ ).optional().nullable(),
575
+ name: z.string().describe("Stage name.").min(1).max(40).optional().nullable(),
576
+ staleDurationInHours: z.number().int().describe(
577
+ "The duration (in hours) a card can remain in this stage before becoming stale.\nWhen a card exceeds this duration, it's marked as stale to indicate potential workflow delays."
578
+ ).min(1).max(1e5).optional().nullable()
579
+ })
580
+ ).min(1).max(30).optional(),
581
+ doneStage: z.object({
582
+ _id: z.string().describe("Done stage ID.").regex(
583
+ /^[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}$/,
584
+ "Must be a valid GUID"
585
+ ).optional().nullable(),
586
+ name: z.string().describe("Done stage name.").min(1).max(40).optional().nullable(),
587
+ allowedOutcomes: z.array(z.enum(["NONE", "WON", "LOST"])).min(1).max(3).optional()
588
+ }).describe("The final pipeline stage where cards receive a final outcome.").optional(),
589
+ extendedFields: z.object({
590
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
591
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
592
+ ).optional()
593
+ }).describe("Extended fields data.").optional(),
594
+ tags: z.object({
595
+ privateTags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
596
+ "Tags that are exposed to anyone with access to the entity, including site members and visitors."
597
+ ).optional()
598
+ }).describe("Tags for organizing and categorizing pipelines.").optional()
599
+ });
600
+ var DeletePipelineRequest = z.object({
601
+ pipelineId: z.string().describe("Pipeline ID.").regex(
602
+ /^[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}$/,
603
+ "Must be a valid GUID"
604
+ )
605
+ });
606
+ var DeletePipelineResponse = z.object({});
607
+ var QueryPipelinesRequest = z.object({
608
+ query: z.intersection(
609
+ z.object({
610
+ filter: z.record(z.string(), z.any()).describe(
611
+ "Filter object.\n\nLearn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section)."
612
+ ).optional().nullable(),
613
+ sort: z.array(
614
+ z.object({
615
+ fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
616
+ order: z.enum(["ASC", "DESC"]).optional()
617
+ })
618
+ ).max(5).optional()
619
+ }),
620
+ z.xor([
621
+ z.object({ cursorPaging: z.never().optional() }),
622
+ z.object({
623
+ cursorPaging: z.object({
624
+ limit: z.number().int().describe("Maximum number of items to return.").min(0).max(100).optional().nullable(),
625
+ cursor: z.string().describe(
626
+ "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."
627
+ ).max(16e3).optional().nullable()
628
+ }).describe(
629
+ "Cursor paging options.\n\nLearn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging)."
630
+ )
631
+ })
632
+ ])
633
+ ).describe("Query options.")
634
+ });
635
+ var QueryPipelinesResponse = z.object({
636
+ pipelines: z.array(
637
+ z.object({
638
+ _id: z.string().describe("Pipeline ID.").regex(
639
+ /^[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}$/,
640
+ "Must be a valid GUID"
641
+ ).optional().nullable(),
642
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
643
+ "Revision number, which increments by 1 each time the pipeline is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the pipeline.\n\nIgnored when creating a pipeline."
644
+ ).optional().nullable(),
645
+ _createdDate: z.date().describe(
646
+ "Date and time the pipeline was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format."
647
+ ).optional().nullable(),
648
+ _updatedDate: z.date().describe(
649
+ "Date and time the pipeline was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format."
650
+ ).optional().nullable(),
651
+ name: z.string().describe("Pipeline name.").min(1).max(60).optional().nullable(),
652
+ currency: z.string().describe(
653
+ "Currency code for monetary values in this pipeline. Must be a valid ISO 4217 currency code. For example, `USD`.\n\nDefault: Based on the site's currency settings."
654
+ ).optional().nullable(),
655
+ stages: z.array(
656
+ z.object({
657
+ _id: z.string().describe("Stage ID.").regex(
658
+ /^[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}$/,
659
+ "Must be a valid GUID"
660
+ ).optional().nullable(),
661
+ name: z.string().describe("Stage name.").min(1).max(40).optional().nullable(),
662
+ staleDurationInHours: z.number().int().describe(
663
+ "The duration (in hours) a card can remain in this stage before becoming stale.\nWhen a card exceeds this duration, it's marked as stale to indicate potential workflow delays."
664
+ ).min(1).max(1e5).optional().nullable()
665
+ })
666
+ ).min(1).max(30).optional(),
667
+ doneStage: z.object({
668
+ _id: z.string().describe("Done stage ID.").regex(
669
+ /^[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}$/,
670
+ "Must be a valid GUID"
671
+ ).optional().nullable(),
672
+ name: z.string().describe("Done stage name.").min(1).max(40).optional().nullable(),
673
+ allowedOutcomes: z.array(z.enum(["NONE", "WON", "LOST"])).min(1).max(3).optional()
674
+ }).describe(
675
+ "The final pipeline stage where cards receive a final outcome."
676
+ ).optional(),
677
+ extendedFields: z.object({
678
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
679
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
680
+ ).optional()
681
+ }).describe("Extended fields data.").optional(),
682
+ tags: z.object({
683
+ privateTags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
684
+ "Tags that are exposed to anyone with access to the entity, including site members and visitors."
685
+ ).optional()
686
+ }).describe("Tags for organizing and categorizing pipelines.").optional()
687
+ })
688
+ ).optional(),
689
+ pagingMetadata: z.object({
690
+ count: z.number().int().describe("Number of items returned in current page.").optional().nullable(),
691
+ cursors: z.object({
692
+ next: z.string().describe(
693
+ "Cursor string pointing to the next page in the list of results."
694
+ ).max(16e3).optional().nullable(),
695
+ prev: z.string().describe(
696
+ "Cursor pointing to the previous page in the list of results."
697
+ ).max(16e3).optional().nullable()
698
+ }).describe(
699
+ "Cursor strings that point to the next page, previous page, or both."
700
+ ).optional(),
701
+ hasNext: z.boolean().describe(
702
+ "Whether there are more pages to retrieve following the current page.\n\n+ `true`: Another page of results can be retrieved.\n+ `false`: This is the last page."
703
+ ).optional().nullable()
704
+ }).describe("Paging metadata.").optional()
705
+ });
706
+ var BulkUpdatePipelineTagsRequest = z.object({
707
+ pipelineIds: z.array(z.string()).min(1).max(100),
708
+ options: z.object({
709
+ assignTags: z.object({
710
+ privateTags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
711
+ "Tags that are exposed to anyone with access to the entity, including site members and visitors."
712
+ ).optional()
713
+ }).describe("List of tags to assign.").optional(),
714
+ unassignTags: z.object({
715
+ privateTags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
716
+ "Tags that are exposed to anyone with access to the entity, including site members and visitors."
717
+ ).optional()
718
+ }).describe("List of tags to unassign.").optional(),
719
+ returnEntity: z.boolean().describe(
720
+ "Whether to return the updated pipelines in the response.\n\nDefault: `false`"
721
+ ).optional()
722
+ }).optional()
723
+ });
724
+ var BulkUpdatePipelineTagsResponse = z.object({
725
+ results: z.array(
726
+ z.object({
727
+ itemMetadata: z.object({
728
+ _id: z.string().describe(
729
+ "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
730
+ ).regex(
731
+ /^[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}$/,
732
+ "Must be a valid GUID"
733
+ ).optional().nullable(),
734
+ originalIndex: z.number().int().describe(
735
+ "Index of the item within the request array. Allows for correlation between request and response items."
736
+ ).optional(),
737
+ success: z.boolean().describe(
738
+ "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
739
+ ).optional(),
740
+ error: z.object({
741
+ code: z.string().describe("Error code.").optional(),
742
+ description: z.string().describe("Description of the error.").optional(),
743
+ data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
744
+ }).describe("Details about the error in case of failure.").optional()
745
+ }).describe("Metadata about the individual updated pipeline.").optional()
746
+ })
747
+ ).min(1).max(100).optional(),
748
+ bulkActionMetadata: z.object({
749
+ totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
750
+ totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
751
+ undetailedFailures: z.number().int().describe(
752
+ "Number of failures without details because detailed failure threshold was exceeded."
753
+ ).optional()
754
+ }).describe("Metadata about the bulk update.").optional()
755
+ });
756
+ var BulkUpdatePipelineTagsByFilterRequest = z.object({
757
+ filter: z.record(z.string(), z.any()).describe("Filter to select which pipelines to update."),
758
+ options: z.object({
759
+ assignTags: z.object({
760
+ privateTags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
761
+ "Tags that are exposed to anyone with access to the entity, including site members and visitors."
762
+ ).optional()
763
+ }).describe("List of tags to assign.").optional(),
764
+ unassignTags: z.object({
765
+ privateTags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
766
+ "Tags that are exposed to anyone with access to the entity, including site members and visitors."
767
+ ).optional()
768
+ }).describe("List of tags to unassign.").optional(),
769
+ returnEntity: z.boolean().describe(
770
+ "Whether to return the updated pipelines in the response.\n\nDefault: `false`"
771
+ ).optional()
772
+ }).optional()
773
+ });
774
+ var BulkUpdatePipelineTagsByFilterResponse = z.object({
775
+ jobId: z.string().describe("Job ID for tracking the asynchronous tag updates.").regex(
776
+ /^[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}$/,
777
+ "Must be a valid GUID"
778
+ ).optional()
779
+ });
780
+
781
+ // src/crm-pipelines-v1-pipeline-pipelines.universal.ts
324
782
  var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
325
783
  var Outcome = /* @__PURE__ */ ((Outcome2) => {
326
784
  Outcome2["NONE"] = "NONE";
@@ -347,7 +805,10 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
347
805
  return WebhookIdentityType2;
348
806
  })(WebhookIdentityType || {});
349
807
  async function createPipeline2(pipeline) {
350
- const { httpClient, sideEffects } = arguments[1];
808
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
809
+ if (validateRequestSchema) {
810
+ CreatePipelineRequest.parse({ pipeline });
811
+ }
351
812
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ pipeline });
352
813
  const reqOpts = createPipeline(payload);
353
814
  sideEffects?.onSiteCall?.();
@@ -370,7 +831,10 @@ async function createPipeline2(pipeline) {
370
831
  }
371
832
  }
372
833
  async function getPipeline2(pipelineId) {
373
- const { httpClient, sideEffects } = arguments[1];
834
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
835
+ if (validateRequestSchema) {
836
+ GetPipelineRequest.parse({ pipelineId });
837
+ }
374
838
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
375
839
  pipelineId
376
840
  });
@@ -395,7 +859,10 @@ async function getPipeline2(pipelineId) {
395
859
  }
396
860
  }
397
861
  async function updatePipeline2(_id, pipeline) {
398
- const { httpClient, sideEffects } = arguments[2];
862
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
863
+ if (validateRequestSchema) {
864
+ UpdatePipelineRequest.parse({ _id, pipeline });
865
+ }
399
866
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
400
867
  pipeline: { ...pipeline, id: _id }
401
868
  });
@@ -420,7 +887,10 @@ async function updatePipeline2(_id, pipeline) {
420
887
  }
421
888
  }
422
889
  async function deletePipeline2(pipelineId) {
423
- const { httpClient, sideEffects } = arguments[1];
890
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
891
+ if (validateRequestSchema) {
892
+ DeletePipelineRequest.parse({ pipelineId });
893
+ }
424
894
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
425
895
  pipelineId
426
896
  });
@@ -488,7 +958,10 @@ function queryPipelines2() {
488
958
  });
489
959
  }
490
960
  async function typedQueryPipelines(query) {
491
- const { httpClient, sideEffects } = arguments[1];
961
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
962
+ if (validateRequestSchema) {
963
+ QueryPipelinesRequest.parse({ query });
964
+ }
492
965
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
493
966
  const reqOpts = queryPipelines(payload);
494
967
  sideEffects?.onSiteCall?.();
@@ -516,7 +989,10 @@ var utils = {
516
989
  }
517
990
  };
518
991
  async function bulkUpdatePipelineTags2(pipelineIds, options) {
519
- const { httpClient, sideEffects } = arguments[2];
992
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
993
+ if (validateRequestSchema) {
994
+ BulkUpdatePipelineTagsRequest.parse({ pipelineIds, options });
995
+ }
520
996
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
521
997
  pipelineIds,
522
998
  assignTags: options?.assignTags,
@@ -549,7 +1025,10 @@ async function bulkUpdatePipelineTags2(pipelineIds, options) {
549
1025
  }
550
1026
  }
551
1027
  async function bulkUpdatePipelineTagsByFilter2(filter, options) {
552
- const { httpClient, sideEffects } = arguments[2];
1028
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1029
+ if (validateRequestSchema) {
1030
+ BulkUpdatePipelineTagsByFilterRequest.parse({ filter, options });
1031
+ }
553
1032
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
554
1033
  filter,
555
1034
  assignTags: options?.assignTags,