@apify/input_schema 3.16.1 → 3.17.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.
package/cjs/index.cjs CHANGED
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  // src/index.ts
22
22
  var index_exports = {};
23
23
  __export(index_exports, {
24
+ ensureAjvSupportsDraft2019: () => ensureAjvSupportsDraft2019,
24
25
  inputSchema: () => schema_default,
25
26
  m: () => m,
26
27
  makeInputJsFieldsReadable: () => makeInputJsFieldsReadable,
@@ -234,86 +235,91 @@ var schema_default = {
234
235
  type: "object",
235
236
  properties: {
236
237
  type: { enum: ["array"] },
237
- editor: { enum: ["json", "requestListSources", "pseudoUrls", "globs", "keyValue", "stringList", "select", "hidden"] },
238
+ editor: { enum: ["json", "requestListSources", "pseudoUrls", "globs", "keyValue", "stringList", "select", "schemaBased", "hidden"] },
238
239
  isSecret: { type: "boolean" }
239
240
  },
240
- additionalProperties: true,
241
241
  required: ["type", "title", "description", "editor"],
242
242
  if: {
243
243
  properties: {
244
- isSecret: {
245
- not: {
246
- const: true
247
- }
248
- }
244
+ isSecret: { not: { const: true } }
249
245
  }
250
246
  },
251
247
  then: {
252
- if: {
253
- properties: {
254
- editor: { const: "select" }
255
- }
256
- },
257
- then: {
258
- additionalProperties: false,
259
- required: ["items"],
260
- properties: {
261
- type: { enum: ["array"] },
262
- editor: { enum: ["select"] },
263
- title: { type: "string" },
264
- description: { type: "string" },
265
- default: { type: "array" },
266
- prefill: { type: "array" },
267
- example: { type: "array" },
268
- nullable: { type: "boolean" },
269
- minItems: { type: "integer" },
270
- maxItems: { type: "integer" },
271
- uniqueItems: { type: "boolean" },
272
- sectionCaption: { type: "string" },
273
- sectionDescription: { type: "string" },
274
- items: {
275
- type: "object",
276
- additionalProperties: false,
277
- properties: {
278
- type: { enum: ["string"] },
279
- enum: {
280
- type: "array",
281
- items: { type: "string" },
282
- uniqueItems: true
283
- },
284
- enumTitles: {
285
- type: "array",
286
- items: { type: "string" }
287
- }
288
- },
289
- required: ["type", "enum"]
290
- },
291
- isSecret: { enum: [false] }
292
- }
248
+ properties: {
249
+ type: { enum: ["array"] },
250
+ title: { type: "string" },
251
+ description: { type: "string" },
252
+ default: { type: "array" },
253
+ prefill: { type: "array" },
254
+ example: { type: "array" },
255
+ nullable: { type: "boolean" },
256
+ minItems: { type: "integer" },
257
+ maxItems: { type: "integer" },
258
+ uniqueItems: { type: "boolean" },
259
+ sectionCaption: { type: "string" },
260
+ sectionDescription: { type: "string" },
261
+ placeholderKey: { type: "string" },
262
+ placeholderValue: { type: "string" },
263
+ patternKey: { type: "string" },
264
+ patternValue: { type: "string" },
265
+ isSecret: { enum: [false] }
293
266
  },
294
- else: {
295
- additionalProperties: false,
296
- properties: {
297
- type: { enum: ["array"] },
298
- editor: { enum: ["json", "requestListSources", "pseudoUrls", "globs", "keyValue", "stringList", "hidden"] },
299
- title: { type: "string" },
300
- description: { type: "string" },
301
- default: { type: "array" },
302
- prefill: { type: "array" },
303
- example: { type: "array" },
304
- nullable: { type: "boolean" },
305
- minItems: { type: "integer" },
306
- maxItems: { type: "integer" },
307
- uniqueItems: { type: "boolean" },
308
- sectionCaption: { type: "string" },
309
- sectionDescription: { type: "string" },
310
- placeholderKey: { type: "string" },
311
- placeholderValue: { type: "string" },
312
- patternKey: { type: "string" },
313
- patternValue: { type: "string" },
314
- isSecret: { enum: [false] }
267
+ unevaluatedProperties: false,
268
+ oneOf: [
269
+ {
270
+ required: ["editor"],
271
+ properties: {
272
+ editor: { enum: ["select"] },
273
+ items: { $ref: "#/definitions/arrayItemsSelect" }
274
+ }
275
+ },
276
+ {
277
+ required: ["editor"],
278
+ properties: {
279
+ editor: { enum: ["keyValue"] },
280
+ items: { $ref: "#/definitions/arrayItemsKeyValue" }
281
+ }
282
+ },
283
+ {
284
+ required: ["editor"],
285
+ properties: {
286
+ editor: { enum: ["stringList"] },
287
+ items: { $ref: "#/definitions/arrayItemsStringList" }
288
+ }
289
+ },
290
+ {
291
+ required: ["editor"],
292
+ properties: {
293
+ editor: { enum: ["globs"] },
294
+ items: { $ref: "#/definitions/arrayItemsGlobs" }
295
+ }
296
+ },
297
+ {
298
+ required: ["editor"],
299
+ properties: {
300
+ editor: { enum: ["pseudoUrls"] },
301
+ items: { $ref: "#/definitions/arrayItemsPseudoUrls" }
302
+ }
303
+ },
304
+ {
305
+ required: ["editor"],
306
+ properties: {
307
+ editor: { enum: ["requestListSources"] },
308
+ items: { $ref: "#/definitions/arrayItemsRequestListSources" }
309
+ }
310
+ },
311
+ {
312
+ required: ["editor"],
313
+ properties: {
314
+ editor: { enum: ["json", "schemaBased", "hidden"] },
315
+ items: { $ref: "#/definitions/arrayItems" }
316
+ }
317
+ },
318
+ {
319
+ not: { required: ["editor"] },
320
+ properties: { items: { $ref: "#/definitions/arrayItems" } }
315
321
  }
316
- }
322
+ ]
317
323
  },
318
324
  else: {
319
325
  additionalProperties: false,
@@ -330,6 +336,7 @@ var schema_default = {
330
336
  uniqueItems: { type: "boolean" },
331
337
  sectionCaption: { type: "string" },
332
338
  sectionDescription: { type: "string" },
339
+ items: { $ref: "#/definitions/arrayItems" },
333
340
  isSecret: { enum: [true] }
334
341
  }
335
342
  }
@@ -337,26 +344,20 @@ var schema_default = {
337
344
  objectProperty: {
338
345
  title: "Object property",
339
346
  type: "object",
340
- additionalProperties: true,
341
347
  properties: {
342
348
  type: { enum: ["object"] },
343
349
  title: { type: "string" },
344
350
  description: { type: "string" },
345
- editor: { enum: ["json", "proxy", "hidden"] },
351
+ editor: { enum: ["json", "proxy", "schemaBased", "hidden"] },
346
352
  isSecret: { type: "boolean" }
347
353
  },
348
354
  required: ["type", "title", "description", "editor"],
349
355
  if: {
350
356
  properties: {
351
- isSecret: {
352
- not: {
353
- const: true
354
- }
355
- }
357
+ isSecret: { not: { const: true } }
356
358
  }
357
359
  },
358
360
  then: {
359
- additionalProperties: false,
360
361
  properties: {
361
362
  type: { enum: ["object"] },
362
363
  title: { type: "string" },
@@ -369,11 +370,31 @@ var schema_default = {
369
370
  nullable: { type: "boolean" },
370
371
  minProperties: { type: "integer" },
371
372
  maxProperties: { type: "integer" },
372
- editor: { enum: ["json", "proxy", "hidden"] },
373
+ editor: { enum: ["json", "proxy", "schemaBased", "hidden"] },
373
374
  sectionCaption: { type: "string" },
374
375
  sectionDescription: { type: "string" },
375
- isSecret: { enum: [false] }
376
- }
376
+ isSecret: { enum: [false] },
377
+ required: {
378
+ type: "array",
379
+ minItems: 0,
380
+ items: { type: "string" },
381
+ uniqueItems: true
382
+ },
383
+ additionalProperties: {
384
+ type: "boolean"
385
+ }
386
+ },
387
+ unevaluatedProperties: false,
388
+ oneOf: [
389
+ { properties: {
390
+ editor: { enum: ["proxy"] },
391
+ properties: { $ref: "#/definitions/subObjectPropertiesProxy" }
392
+ } },
393
+ { properties: {
394
+ editor: { enum: ["json", "schemaBased", "hidden"] },
395
+ properties: { $ref: "#/definitions/subObjectProperties" }
396
+ } }
397
+ ]
377
398
  },
378
399
  else: {
379
400
  additionalProperties: false,
@@ -391,7 +412,17 @@ var schema_default = {
391
412
  editor: { enum: ["json", "hidden"] },
392
413
  sectionCaption: { type: "string" },
393
414
  sectionDescription: { type: "string" },
394
- isSecret: { enum: [true] }
415
+ properties: { $ref: "#/definitions/subObjectProperties" },
416
+ isSecret: { enum: [true] },
417
+ required: {
418
+ type: "array",
419
+ minItems: 0,
420
+ items: { type: "string" },
421
+ uniqueItems: true
422
+ },
423
+ additionalProperties: {
424
+ type: "boolean"
425
+ }
395
426
  }
396
427
  }
397
428
  },
@@ -529,133 +560,774 @@ var schema_default = {
529
560
  }
530
561
  }
531
562
  }
532
- ]
563
+ ]
564
+ },
565
+ anyProperty: {
566
+ title: "Any property",
567
+ type: "object",
568
+ additionalProperties: false,
569
+ properties: {
570
+ type: {
571
+ type: ["array"],
572
+ items: {
573
+ type: "string",
574
+ enum: ["object", "array", "string", "integer", "boolean"]
575
+ },
576
+ uniqueItems: true,
577
+ additionalItems: false,
578
+ minItems: 1
579
+ },
580
+ title: { type: "string" },
581
+ description: { type: "string" },
582
+ default: { type: ["object", "array", "string", "integer", "boolean"] },
583
+ prefill: { type: ["object", "array", "string", "integer", "boolean"] },
584
+ example: { type: ["object", "array", "string", "integer", "boolean"] },
585
+ nullable: { type: "boolean" },
586
+ editor: { enum: ["json", "hidden"] },
587
+ sectionCaption: { type: "string" },
588
+ sectionDescription: { type: "string" }
589
+ },
590
+ required: ["type", "title", "description", "editor"]
591
+ },
592
+ subSchemaStringEnumProperty: {
593
+ title: "Sub-schema: Enum property",
594
+ type: "object",
595
+ additionalProperties: false,
596
+ properties: {
597
+ type: { enum: ["string"] },
598
+ editor: { enum: ["select"] },
599
+ title: { type: "string" },
600
+ description: { type: "string" },
601
+ nullable: { type: "boolean" },
602
+ enum: {
603
+ type: "array",
604
+ items: { type: "string" },
605
+ minItems: 1,
606
+ uniqueItems: true
607
+ },
608
+ enumTitles: {
609
+ type: "array",
610
+ items: { type: "string" },
611
+ minItems: 1
612
+ }
613
+ },
614
+ required: ["type", "title", "description", "enum"]
615
+ },
616
+ subSchemaStringProperty: {
617
+ title: "Sub-schema: String property",
618
+ type: "object",
619
+ additionalProperties: true,
620
+ properties: {
621
+ type: { enum: ["string"] },
622
+ title: { type: "string" },
623
+ description: { type: "string" },
624
+ nullable: { type: "boolean" },
625
+ editor: { enum: ["javascript", "python", "textfield", "textarea", "datepicker", "hidden", "fileupload"] }
626
+ },
627
+ required: ["type", "title", "description"],
628
+ if: {
629
+ properties: {
630
+ editor: { const: "datepicker" }
631
+ }
632
+ },
633
+ then: {
634
+ additionalProperties: false,
635
+ properties: {
636
+ type: { enum: ["string"] },
637
+ title: { type: "string" },
638
+ description: { type: "string" },
639
+ pattern: { type: "string" },
640
+ nullable: { type: "boolean" },
641
+ minLength: { type: "integer" },
642
+ maxLength: { type: "integer" },
643
+ editor: { enum: ["datepicker"] },
644
+ dateType: { enum: ["absolute", "relative", "absoluteOrRelative"] }
645
+ }
646
+ },
647
+ else: {
648
+ additionalProperties: false,
649
+ properties: {
650
+ type: { enum: ["string"] },
651
+ title: { type: "string" },
652
+ description: { type: "string" },
653
+ pattern: { type: "string" },
654
+ nullable: { type: "boolean" },
655
+ minLength: { type: "integer" },
656
+ maxLength: { type: "integer" },
657
+ editor: { enum: ["javascript", "python", "textfield", "textarea", "hidden", "fileupload"] }
658
+ }
659
+ }
660
+ },
661
+ subSchemaArrayProperty: {
662
+ title: "Sub-schema: Array property",
663
+ type: "object",
664
+ properties: {
665
+ type: { enum: ["array"] },
666
+ editor: { enum: ["json", "requestListSources", "pseudoUrls", "globs", "keyValue", "stringList", "select", "hidden"] },
667
+ title: { type: "string" },
668
+ description: { type: "string" },
669
+ nullable: { type: "boolean" },
670
+ minItems: { type: "integer" },
671
+ maxItems: { type: "integer" },
672
+ uniqueItems: { type: "boolean" },
673
+ placeholderKey: { type: "string" },
674
+ placeholderValue: { type: "string" },
675
+ patternKey: { type: "string" },
676
+ patternValue: { type: "string" }
677
+ },
678
+ required: ["type", "title", "description"],
679
+ unevaluatedProperties: false,
680
+ oneOf: [
681
+ {
682
+ required: ["editor"],
683
+ properties: {
684
+ editor: { enum: ["select"] },
685
+ items: { $ref: "#/definitions/arrayItemsSelect" }
686
+ }
687
+ },
688
+ {
689
+ required: ["editor"],
690
+ properties: {
691
+ editor: { enum: ["keyValue"] },
692
+ items: { $ref: "#/definitions/arrayItemsKeyValue" }
693
+ }
694
+ },
695
+ {
696
+ required: ["editor"],
697
+ properties: {
698
+ editor: { enum: ["stringList"] },
699
+ items: { $ref: "#/definitions/arrayItemsStringList" }
700
+ }
701
+ },
702
+ {
703
+ required: ["editor"],
704
+ properties: {
705
+ editor: { enum: ["globs"] },
706
+ items: { $ref: "#/definitions/arrayItemsGlobs" }
707
+ }
708
+ },
709
+ {
710
+ required: ["editor"],
711
+ properties: {
712
+ editor: { enum: ["pseudoUrls"] },
713
+ items: { $ref: "#/definitions/arrayItemsPseudoUrls" }
714
+ }
715
+ },
716
+ {
717
+ required: ["editor"],
718
+ properties: {
719
+ editor: { enum: ["requestListSources"] },
720
+ items: { $ref: "#/definitions/arrayItemsRequestListSources" }
721
+ }
722
+ },
723
+ {
724
+ required: ["editor"],
725
+ properties: {
726
+ editor: { enum: ["json", "schemaBased", "hidden"] },
727
+ items: { $ref: "#/definitions/arrayItems" }
728
+ }
729
+ },
730
+ {
731
+ not: { required: ["editor"] },
732
+ properties: { items: { $ref: "#/definitions/arrayItems" } }
733
+ }
734
+ ]
735
+ },
736
+ subSchemaIntegerProperty: {
737
+ title: "Sub-schema: Integer property",
738
+ type: "object",
739
+ additionalProperties: false,
740
+ properties: {
741
+ type: { enum: ["integer"] },
742
+ title: { type: "string" },
743
+ description: { type: "string" },
744
+ nullable: { type: "boolean" },
745
+ minimum: { type: "integer" },
746
+ maximum: { type: "integer" },
747
+ unit: { type: "string" },
748
+ editor: { enum: ["number", "hidden"] }
749
+ },
750
+ required: ["type", "title", "description"]
751
+ },
752
+ subSchemaBooleanProperty: {
753
+ title: "Sub-schema: Boolean property",
754
+ type: "object",
755
+ additionalProperties: false,
756
+ properties: {
757
+ type: { enum: ["boolean"] },
758
+ title: { type: "string" },
759
+ description: { type: "string" },
760
+ nullable: { type: "boolean" },
761
+ groupCaption: { type: "string" },
762
+ groupDescription: { type: "string" },
763
+ editor: { enum: ["checkbox", "hidden"] }
764
+ },
765
+ required: ["type", "title", "description"]
766
+ },
767
+ subSchemaObjectProperty: {
768
+ title: "Sub-schema: Object property",
769
+ type: "object",
770
+ additionalProperties: false,
771
+ properties: {
772
+ type: { enum: ["object"] },
773
+ title: { type: "string" },
774
+ description: { type: "string" },
775
+ patternKey: { type: "string" },
776
+ patternValue: { type: "string" },
777
+ nullable: { type: "boolean" },
778
+ minProperties: { type: "integer" },
779
+ maxProperties: { type: "integer" },
780
+ editor: { enum: ["json", "proxy", "hidden"] },
781
+ properties: { $ref: "#/definitions/subObjectProperties" },
782
+ required: {
783
+ type: "array",
784
+ minItems: 0,
785
+ items: { type: "string" },
786
+ uniqueItems: true
787
+ },
788
+ additionalProperties: {
789
+ type: "boolean"
790
+ }
791
+ },
792
+ required: ["type", "title", "description"]
793
+ },
794
+ subSchemaResourceProperty: {
795
+ title: "Sub-schema: Resource property",
796
+ type: "object",
797
+ additionalProperties: false,
798
+ properties: {
799
+ type: { enum: ["string"] },
800
+ title: { type: "string" },
801
+ description: { type: "string" },
802
+ editor: { enum: ["resourcePicker", "hidden"] },
803
+ resourceType: { enum: ["dataset", "keyValueStore", "requestQueue"] },
804
+ resourcePermissions: {
805
+ type: "array",
806
+ items: {
807
+ type: "string",
808
+ enum: ["READ", "WRITE"]
809
+ },
810
+ minItems: 1,
811
+ uniqueItems: true,
812
+ contains: {
813
+ const: "READ"
814
+ }
815
+ },
816
+ nullable: { type: "boolean" }
817
+ },
818
+ required: ["type", "title", "description", "resourceType"]
819
+ },
820
+ subSchemaResourceArrayProperty: {
821
+ title: "Sub-schema: Resource array property",
822
+ type: "object",
823
+ additionalProperties: false,
824
+ properties: {
825
+ type: { enum: ["array"] },
826
+ title: { type: "string" },
827
+ description: { type: "string" },
828
+ editor: { enum: ["resourcePicker", "hidden"] },
829
+ resourcePermissions: {
830
+ type: "array",
831
+ items: {
832
+ type: "string",
833
+ enum: ["READ", "WRITE"]
834
+ },
835
+ minItems: 1,
836
+ uniqueItems: true,
837
+ contains: {
838
+ const: "READ"
839
+ }
840
+ },
841
+ nullable: { type: "boolean" },
842
+ minItems: { type: "integer" },
843
+ maxItems: { type: "integer" },
844
+ uniqueItems: { type: "boolean" },
845
+ resourceType: { enum: ["dataset", "keyValueStore", "requestQueue"] }
846
+ },
847
+ required: ["type", "title", "description", "resourceType"]
848
+ },
849
+ arrayItems: {
850
+ title: "Utils: Array items definition",
851
+ type: "object",
852
+ properties: {
853
+ type: { enum: ["string", "integer", "boolean", "object", "array"] }
854
+ },
855
+ required: ["type"],
856
+ if: {
857
+ properties: {
858
+ type: { enum: ["object"] }
859
+ }
860
+ },
861
+ then: {
862
+ additionalProperties: false,
863
+ properties: {
864
+ type: { enum: ["object"] },
865
+ properties: {
866
+ type: "object",
867
+ patternProperties: {
868
+ "^": {
869
+ oneOf: [
870
+ { $ref: "#/definitions/subSchemaStringProperty" },
871
+ { $ref: "#/definitions/subSchemaStringEnumProperty" },
872
+ { $ref: "#/definitions/subSchemaArrayProperty" },
873
+ { $ref: "#/definitions/subSchemaObjectProperty" },
874
+ { $ref: "#/definitions/subSchemaIntegerProperty" },
875
+ { $ref: "#/definitions/subSchemaBooleanProperty" },
876
+ { $ref: "#/definitions/subSchemaResourceProperty" },
877
+ { $ref: "#/definitions/subSchemaResourceArrayProperty" }
878
+ ]
879
+ }
880
+ },
881
+ additionalProperties: false
882
+ },
883
+ required: {
884
+ type: "array",
885
+ minItems: 0,
886
+ items: { type: "string" },
887
+ uniqueItems: true
888
+ },
889
+ additionalProperties: {
890
+ type: "boolean"
891
+ }
892
+ }
893
+ },
894
+ else: {
895
+ if: {
896
+ properties: { type: { const: "array" } }
897
+ },
898
+ then: {
899
+ additionalProperties: false,
900
+ properties: {
901
+ type: { enum: ["array"] },
902
+ items: {
903
+ $ref: "#/definitions/arrayItems"
904
+ }
905
+ }
906
+ },
907
+ else: {
908
+ additionalProperties: false,
909
+ properties: {
910
+ type: { enum: ["string", "integer", "boolean"] }
911
+ }
912
+ }
913
+ }
914
+ },
915
+ arrayItemsSelect: {
916
+ title: "Utils: Array items select definition",
917
+ type: "object",
918
+ additionalProperties: false,
919
+ properties: {
920
+ type: { enum: ["string"] },
921
+ enum: {
922
+ type: "array",
923
+ items: { type: "string" },
924
+ uniqueItems: true
925
+ },
926
+ enumTitles: {
927
+ type: "array",
928
+ items: { type: "string" }
929
+ }
930
+ },
931
+ required: ["type", "enum"]
932
+ },
933
+ arrayItemsKeyValue: {
934
+ title: "Utils: Array items keyValue definition",
935
+ type: "object",
936
+ additionalProperties: false,
937
+ properties: {
938
+ type: { enum: ["object"] },
939
+ properties: {
940
+ type: "object",
941
+ properties: {
942
+ key: {
943
+ type: "object",
944
+ additionalProperties: false,
945
+ properties: {
946
+ type: { enum: ["string"] },
947
+ title: { type: "string" },
948
+ description: { type: "string" },
949
+ pattern: { type: "string" },
950
+ minLength: { type: "integer" },
951
+ maxLength: { type: "integer" }
952
+ },
953
+ required: ["type"]
954
+ },
955
+ value: {
956
+ type: "object",
957
+ additionalProperties: false,
958
+ properties: {
959
+ type: { enum: ["string"] },
960
+ title: { type: "string" },
961
+ description: { type: "string" },
962
+ pattern: { type: "string" },
963
+ minLength: { type: "integer" },
964
+ maxLength: { type: "integer" }
965
+ },
966
+ required: ["type"]
967
+ }
968
+ },
969
+ required: ["key", "value"],
970
+ additionalProperties: false
971
+ },
972
+ required: {
973
+ type: "array",
974
+ minItems: 0,
975
+ items: { type: "string" },
976
+ uniqueItems: true
977
+ },
978
+ additionalProperties: { type: "boolean" }
979
+ },
980
+ required: ["type", "properties"]
981
+ },
982
+ arrayItemsStringList: {
983
+ title: "Utils: Array items stringList definition",
984
+ type: "object",
985
+ additionalProperties: false,
986
+ properties: {
987
+ type: { enum: ["string"] },
988
+ pattern: { type: "string" },
989
+ minLength: { type: "integer" },
990
+ maxLength: { type: "integer" }
991
+ },
992
+ required: ["type"]
993
+ },
994
+ arrayItemsGlobs: {
995
+ title: "Utils: Array items globs definition",
996
+ type: "object",
997
+ additionalProperties: false,
998
+ properties: {
999
+ type: { enum: ["object"] },
1000
+ properties: {
1001
+ type: "object",
1002
+ additionalProperties: false,
1003
+ properties: {
1004
+ glob: {
1005
+ type: "object",
1006
+ additionalProperties: false,
1007
+ properties: {
1008
+ type: { enum: ["string"] },
1009
+ title: { type: "string" },
1010
+ description: { type: "string" },
1011
+ pattern: { type: "string" },
1012
+ minLength: { type: "integer" },
1013
+ maxLength: { type: "integer" }
1014
+ },
1015
+ required: ["type"]
1016
+ },
1017
+ method: {
1018
+ type: "object",
1019
+ additionalProperties: false,
1020
+ properties: {
1021
+ type: { enum: ["string"] },
1022
+ title: { type: "string" },
1023
+ description: { type: "string" },
1024
+ pattern: { type: "string" },
1025
+ minLength: { type: "integer" },
1026
+ maxLength: { type: "integer" }
1027
+ },
1028
+ required: ["type"]
1029
+ },
1030
+ payload: {
1031
+ type: "object",
1032
+ additionalProperties: false,
1033
+ properties: {
1034
+ type: { enum: ["string"] },
1035
+ title: { type: "string" },
1036
+ description: { type: "string" },
1037
+ pattern: { type: "string" },
1038
+ minLength: { type: "integer" },
1039
+ maxLength: { type: "integer" }
1040
+ },
1041
+ required: ["type"]
1042
+ },
1043
+ userData: {
1044
+ type: "object",
1045
+ additionalProperties: false,
1046
+ properties: {
1047
+ type: { enum: ["object"] },
1048
+ title: { type: "string" },
1049
+ description: { type: "string" },
1050
+ properties: { type: "object" }
1051
+ },
1052
+ required: ["type"]
1053
+ },
1054
+ headers: {
1055
+ type: "object",
1056
+ additionalProperties: false,
1057
+ properties: {
1058
+ type: { enum: ["object"] },
1059
+ title: { type: "string" },
1060
+ description: { type: "string" },
1061
+ properties: { type: "object" }
1062
+ },
1063
+ required: ["type"]
1064
+ }
1065
+ }
1066
+ },
1067
+ required: {
1068
+ type: "array",
1069
+ minItems: 0,
1070
+ items: { type: "string" },
1071
+ uniqueItems: true
1072
+ },
1073
+ additionalProperties: { type: "boolean" }
1074
+ },
1075
+ required: ["type"]
1076
+ },
1077
+ arrayItemsPseudoUrls: {
1078
+ title: "Utils: Array items pseudoUrls definition",
1079
+ type: "object",
1080
+ additionalProperties: false,
1081
+ properties: {
1082
+ type: { enum: ["object"] },
1083
+ properties: {
1084
+ type: "object",
1085
+ additionalProperties: false,
1086
+ properties: {
1087
+ purl: {
1088
+ type: "object",
1089
+ additionalProperties: false,
1090
+ properties: {
1091
+ type: { enum: ["string"] },
1092
+ title: { type: "string" },
1093
+ description: { type: "string" },
1094
+ pattern: { type: "string" },
1095
+ minLength: { type: "integer" },
1096
+ maxLength: { type: "integer" }
1097
+ },
1098
+ required: ["type"]
1099
+ },
1100
+ method: {
1101
+ type: "object",
1102
+ additionalProperties: false,
1103
+ properties: {
1104
+ type: { enum: ["string"] },
1105
+ title: { type: "string" },
1106
+ description: { type: "string" },
1107
+ pattern: { type: "string" },
1108
+ minLength: { type: "integer" },
1109
+ maxLength: { type: "integer" }
1110
+ },
1111
+ required: ["type"]
1112
+ },
1113
+ payload: {
1114
+ type: "object",
1115
+ additionalProperties: false,
1116
+ properties: {
1117
+ type: { enum: ["string"] },
1118
+ title: { type: "string" },
1119
+ description: { type: "string" },
1120
+ pattern: { type: "string" },
1121
+ minLength: { type: "integer" },
1122
+ maxLength: { type: "integer" }
1123
+ },
1124
+ required: ["type"]
1125
+ },
1126
+ userData: {
1127
+ type: "object",
1128
+ additionalProperties: false,
1129
+ properties: {
1130
+ type: { enum: ["object"] },
1131
+ title: { type: "string" },
1132
+ description: { type: "string" },
1133
+ properties: { type: "object" }
1134
+ },
1135
+ required: ["type"]
1136
+ },
1137
+ headers: {
1138
+ type: "object",
1139
+ additionalProperties: false,
1140
+ properties: {
1141
+ type: { enum: ["object"] },
1142
+ title: { type: "string" },
1143
+ description: { type: "string" },
1144
+ properties: { type: "object" }
1145
+ },
1146
+ required: ["type"]
1147
+ }
1148
+ }
1149
+ },
1150
+ required: {
1151
+ type: "array",
1152
+ minItems: 0,
1153
+ items: { type: "string" },
1154
+ uniqueItems: true
1155
+ },
1156
+ additionalProperties: { type: "boolean" }
1157
+ },
1158
+ required: ["type"]
1159
+ },
1160
+ arrayItemsRequestListSources: {
1161
+ title: "Utils: Array items requestListSources definition",
1162
+ type: "object",
1163
+ additionalProperties: false,
1164
+ properties: {
1165
+ type: { enum: ["object"] },
1166
+ properties: {
1167
+ type: "object",
1168
+ additionalProperties: false,
1169
+ properties: {
1170
+ url: {
1171
+ type: "object",
1172
+ additionalProperties: false,
1173
+ properties: {
1174
+ type: { enum: ["string"] },
1175
+ title: { type: "string" },
1176
+ description: { type: "string" },
1177
+ pattern: { type: "string" },
1178
+ minLength: { type: "integer" },
1179
+ maxLength: { type: "integer" }
1180
+ },
1181
+ required: ["type"]
1182
+ },
1183
+ method: {
1184
+ type: "object",
1185
+ additionalProperties: false,
1186
+ properties: {
1187
+ type: { enum: ["string"] },
1188
+ title: { type: "string" },
1189
+ description: { type: "string" },
1190
+ pattern: { type: "string" },
1191
+ minLength: { type: "integer" },
1192
+ maxLength: { type: "integer" }
1193
+ },
1194
+ required: ["type"]
1195
+ },
1196
+ payload: {
1197
+ type: "object",
1198
+ additionalProperties: false,
1199
+ properties: {
1200
+ type: { enum: ["string"] },
1201
+ title: { type: "string" },
1202
+ description: { type: "string" },
1203
+ pattern: { type: "string" },
1204
+ minLength: { type: "integer" },
1205
+ maxLength: { type: "integer" }
1206
+ },
1207
+ required: ["type"]
1208
+ },
1209
+ userData: {
1210
+ type: "object",
1211
+ additionalProperties: false,
1212
+ properties: {
1213
+ type: { enum: ["object"] },
1214
+ title: { type: "string" },
1215
+ description: { type: "string" },
1216
+ properties: { type: "object" }
1217
+ },
1218
+ required: ["type"]
1219
+ },
1220
+ headers: {
1221
+ type: "object",
1222
+ additionalProperties: false,
1223
+ properties: {
1224
+ type: { enum: ["object"] },
1225
+ title: { type: "string" },
1226
+ description: { type: "string" },
1227
+ properties: { type: "object" }
1228
+ },
1229
+ required: ["type"]
1230
+ }
1231
+ }
1232
+ },
1233
+ required: {
1234
+ type: "array",
1235
+ minItems: 0,
1236
+ items: { type: "string" },
1237
+ uniqueItems: true
1238
+ },
1239
+ additionalProperties: { type: "boolean" }
1240
+ },
1241
+ required: ["type"]
1242
+ },
1243
+ subObjectProperties: {
1244
+ title: "Utils: Sub-object properties definition",
1245
+ type: "object",
1246
+ patternProperties: {
1247
+ "^": {
1248
+ oneOf: [
1249
+ { $ref: "#/definitions/subSchemaStringProperty" },
1250
+ { $ref: "#/definitions/subSchemaStringEnumProperty" },
1251
+ { $ref: "#/definitions/subSchemaArrayProperty" },
1252
+ { $ref: "#/definitions/subSchemaObjectProperty" },
1253
+ { $ref: "#/definitions/subSchemaIntegerProperty" },
1254
+ { $ref: "#/definitions/subSchemaBooleanProperty" },
1255
+ { $ref: "#/definitions/subSchemaResourceProperty" },
1256
+ { $ref: "#/definitions/subSchemaResourceArrayProperty" }
1257
+ ]
1258
+ }
1259
+ },
1260
+ additionalProperties: false
533
1261
  },
534
- anyProperty: {
535
- title: "Any property",
1262
+ subObjectPropertiesProxy: {
1263
+ title: "Utils: Sub-object properties proxy definition",
536
1264
  type: "object",
537
1265
  additionalProperties: false,
538
1266
  properties: {
539
- type: {
540
- type: ["array"],
541
- items: {
542
- type: "string",
543
- enum: ["object", "array", "string", "integer", "boolean"]
1267
+ useApifyProxy: {
1268
+ type: "object",
1269
+ additionalProperties: false,
1270
+ properties: {
1271
+ type: { enum: ["boolean"] },
1272
+ title: { type: "string" },
1273
+ description: { type: "string" }
544
1274
  },
545
- uniqueItems: true,
546
- additionalItems: false,
547
- minItems: 1
1275
+ required: ["type"]
548
1276
  },
549
- title: { type: "string" },
550
- description: { type: "string" },
551
- default: { type: ["object", "array", "string", "integer", "boolean"] },
552
- prefill: { type: ["object", "array", "string", "integer", "boolean"] },
553
- example: { type: ["object", "array", "string", "integer", "boolean"] },
554
- nullable: { type: "boolean" },
555
- editor: { enum: ["json", "hidden"] },
556
- sectionCaption: { type: "string" },
557
- sectionDescription: { type: "string" }
558
- },
559
- required: ["type", "title", "description", "editor"]
1277
+ apifyProxyGroups: {
1278
+ type: "object",
1279
+ additionalProperties: false,
1280
+ properties: {
1281
+ type: { enum: ["array"] },
1282
+ title: { type: "string" },
1283
+ description: { type: "string" },
1284
+ items: {
1285
+ type: ["object"],
1286
+ properties: {
1287
+ type: { enum: ["string"] }
1288
+ },
1289
+ additionalProperties: false,
1290
+ required: ["type"]
1291
+ }
1292
+ },
1293
+ required: ["type"]
1294
+ },
1295
+ proxyUrls: {
1296
+ type: "object",
1297
+ additionalProperties: false,
1298
+ properties: {
1299
+ type: { enum: ["array"] },
1300
+ title: { type: "string" },
1301
+ description: { type: "string" },
1302
+ items: {
1303
+ type: ["object"],
1304
+ properties: {
1305
+ type: { enum: ["string"] }
1306
+ },
1307
+ additionalProperties: false,
1308
+ required: ["type"]
1309
+ }
1310
+ },
1311
+ required: ["type"]
1312
+ },
1313
+ apifyProxyCountry: {
1314
+ type: "object",
1315
+ additionalProperties: false,
1316
+ properties: {
1317
+ type: { enum: ["string"] },
1318
+ title: { type: "string" },
1319
+ description: { type: "string" },
1320
+ pattern: { type: "string" },
1321
+ minLength: { type: "integer" },
1322
+ maxLength: { type: "integer" }
1323
+ },
1324
+ required: ["type"]
1325
+ }
1326
+ }
560
1327
  }
561
1328
  }
562
1329
  };
563
1330
 
564
- // src/input_schema.ts
565
- var { definitions } = schema_default;
566
- function parseAjvError(error, rootName, properties = {}, input = {}) {
567
- let fieldKey;
568
- let message;
569
- if (error.keyword === "type") {
570
- fieldKey = error.instancePath.split("/").pop();
571
- if (properties[fieldKey] && properties[fieldKey].nullable && input[fieldKey] === null) {
572
- return null;
573
- }
574
- message = m("inputSchema.validation.generic", { rootName, fieldKey, message: error.message });
575
- } else if (error.keyword === "required") {
576
- fieldKey = error.params.missingProperty;
577
- message = m("inputSchema.validation.required", { rootName, fieldKey });
578
- } else if (error.keyword === "additionalProperties") {
579
- fieldKey = error.params.additionalProperty;
580
- message = m("inputSchema.validation.additionalProperty", { rootName, fieldKey });
581
- } else if (error.keyword === "enum") {
582
- fieldKey = error.instancePath.split("/").pop();
583
- const errorMessage = `${error.message}: "${error.params.allowedValues.join('", "')}"`;
584
- message = m("inputSchema.validation.generic", { rootName, fieldKey, message: errorMessage });
585
- } else if (error.keyword === "const") {
586
- fieldKey = error.instancePath.split("/").pop();
587
- message = m("inputSchema.validation.generic", { rootName, fieldKey, message: error.message });
588
- } else {
589
- fieldKey = error.instancePath.split("/").pop();
590
- message = m("inputSchema.validation.generic", { rootName, fieldKey, message: error.message });
591
- }
592
- return { fieldKey, message };
593
- }
594
- __name(parseAjvError, "parseAjvError");
595
- var validateAgainstSchemaOrThrow = /* @__PURE__ */ __name((validator, obj, inputSchema, rootName) => {
596
- if (validator.validate(inputSchema, obj)) return;
597
- const errorMessage = parseAjvError(validator.errors[0], rootName)?.message;
598
- throw new Error(`Input schema is not valid (${errorMessage})`);
599
- }, "validateAgainstSchemaOrThrow");
600
- function validateBasicStructure(validator, obj) {
601
- const schemaWithoutProperties = {
602
- ...schema_default,
603
- properties: { ...schema_default.properties, properties: { type: "object" } }
604
- };
605
- validateAgainstSchemaOrThrow(validator, obj, schemaWithoutProperties, "schema");
606
- }
607
- __name(validateBasicStructure, "validateBasicStructure");
608
- function validateField(validator, fieldSchema, fieldKey) {
609
- const matchingDefinitions = Object.values(definitions).filter((definition2) => {
610
- return definition2.properties.type.enum ? definition2.properties.type.enum[0] === fieldSchema.type : Array.isArray(fieldSchema.type);
611
- });
612
- if (matchingDefinitions.length === 0) {
613
- const errorMessage = m("inputSchema.validation.noMatchingDefinition", { fieldKey });
614
- throw new Error(`Input schema is not valid (${errorMessage})`);
615
- }
616
- if (matchingDefinitions.length === 1) {
617
- validateAgainstSchemaOrThrow(validator, fieldSchema, matchingDefinitions[0], `schema.properties.${fieldKey}`);
618
- return;
619
- }
620
- if (fieldSchema.enum) {
621
- const definition2 = matchingDefinitions.filter((item) => !!item.properties.enum).pop();
622
- if (!definition2) throw new Error('Input schema validation failed to find "enum property" definition');
623
- validateAgainstSchemaOrThrow(validator, fieldSchema, definition2, `schema.properties.${fieldKey}.enum`);
624
- return;
625
- }
626
- if (fieldSchema.resourceType) {
627
- const definition2 = matchingDefinitions.filter((item) => !!item.properties.resourceType).pop();
628
- if (!definition2) throw new Error('Input schema validation failed to find "resource property" definition');
629
- validateAgainstSchemaOrThrow(validator, fieldSchema, definition2, `schema.properties.${fieldKey}`);
630
- return;
631
- }
632
- const definition = matchingDefinitions.filter((item) => !item.properties.enum && !item.properties.resourceType).pop();
633
- if (!definition) throw new Error('Input schema validation failed to find other than "enum property" definition');
634
- validateAgainstSchemaOrThrow(validator, fieldSchema, definition, `schema.properties.${fieldKey}`);
635
- }
636
- __name(validateField, "validateField");
637
- function validateProperties(inputSchema, validator) {
638
- Object.entries(inputSchema.properties).forEach(
639
- ([fieldKey, fieldSchema]) => validateField(validator, fieldSchema, fieldKey)
640
- );
641
- }
642
- __name(validateProperties, "validateProperties");
643
- function validateExistenceOfRequiredFields(inputSchema) {
644
- if (!inputSchema?.required?.length) return;
645
- Object.values(inputSchema?.required).forEach((fieldKey) => {
646
- if (inputSchema?.properties[fieldKey]) return;
647
- throw new Error(m("inputSchema.validation.missingRequiredField", { fieldKey }));
648
- });
649
- }
650
- __name(validateExistenceOfRequiredFields, "validateExistenceOfRequiredFields");
651
- function validateInputSchema(validator, inputSchema) {
652
- validateBasicStructure(validator, inputSchema);
653
- validateProperties(inputSchema, validator);
654
- validateExistenceOfRequiredFields(inputSchema);
655
- validateAgainstSchemaOrThrow(validator, inputSchema, schema_default, "schema");
656
- }
657
- __name(validateInputSchema, "validateInputSchema");
658
-
659
1331
  // src/utilities.ts
660
1332
  var import_acorn_loose = require("acorn-loose");
661
1333
  var import_countries_list = require("countries-list");
@@ -893,8 +1565,168 @@ ${globalSpaces}`);
893
1565
  return niceJson;
894
1566
  }
895
1567
  __name(makeInputJsFieldsReadable, "makeInputJsFieldsReadable");
1568
+ var DRAFT_2019_09_META_SCHEMA = "https://json-schema.org/draft/2019-09/schema";
1569
+ function ensureAjvSupportsDraft2019(ajvInstance) {
1570
+ const metaSchema = ajvInstance.getSchema(DRAFT_2019_09_META_SCHEMA);
1571
+ if (!metaSchema) {
1572
+ throw new Error(
1573
+ `The provided Ajv instance does not support draft-2019-09 (missing meta-schema ${DRAFT_2019_09_META_SCHEMA}).`
1574
+ );
1575
+ }
1576
+ }
1577
+ __name(ensureAjvSupportsDraft2019, "ensureAjvSupportsDraft2019");
1578
+
1579
+ // src/input_schema.ts
1580
+ var { definitions } = schema_default;
1581
+ var [fieldDefinitions, subFieldDefinitions] = Object.values(definitions).reduce((acc, definition) => {
1582
+ if (definition.title.startsWith("Utils:")) {
1583
+ return acc;
1584
+ }
1585
+ if (definition.title.startsWith("Sub-schema:")) {
1586
+ acc[1].push(definition);
1587
+ } else {
1588
+ acc[0].push(definition);
1589
+ }
1590
+ return acc;
1591
+ }, [[], []]);
1592
+ function parseAjvError(error, rootName, properties = {}, input = {}) {
1593
+ let fieldKey;
1594
+ let message;
1595
+ const cleanPropertyName = /* @__PURE__ */ __name((name) => {
1596
+ return name.replace(/^\/|\/$/g, "").replace(/\//g, ".");
1597
+ }, "cleanPropertyName");
1598
+ if (error.keyword === "type") {
1599
+ fieldKey = error.instancePath.split("/").pop();
1600
+ if (properties[fieldKey] && properties[fieldKey].nullable && input[fieldKey] === null) {
1601
+ return null;
1602
+ }
1603
+ message = m("inputSchema.validation.generic", { rootName, fieldKey, message: error.message });
1604
+ } else if (error.keyword === "required") {
1605
+ fieldKey = cleanPropertyName(`${error.instancePath}/${error.params.missingProperty}`);
1606
+ message = m("inputSchema.validation.required", { rootName, fieldKey });
1607
+ } else if (error.keyword === "additionalProperties") {
1608
+ fieldKey = cleanPropertyName(`${error.instancePath}/${error.params.additionalProperty}`);
1609
+ message = m("inputSchema.validation.additionalProperty", { rootName, fieldKey });
1610
+ } else if (error.keyword === "unevaluatedProperties") {
1611
+ fieldKey = cleanPropertyName(`${error.instancePath}/${error.params.unevaluatedProperty}`);
1612
+ message = m("inputSchema.validation.additionalProperty", { rootName, fieldKey });
1613
+ } else if (error.keyword === "enum") {
1614
+ fieldKey = cleanPropertyName(error.instancePath);
1615
+ const errorMessage = `${error.message}: "${error.params.allowedValues.join('", "')}"`;
1616
+ message = m("inputSchema.validation.generic", { rootName, fieldKey, message: errorMessage });
1617
+ } else if (error.keyword === "const") {
1618
+ fieldKey = cleanPropertyName(error.instancePath);
1619
+ message = m("inputSchema.validation.generic", { rootName, fieldKey, message: error.message });
1620
+ } else {
1621
+ fieldKey = cleanPropertyName(error.instancePath);
1622
+ message = m("inputSchema.validation.generic", { rootName, fieldKey, message: error.message });
1623
+ }
1624
+ return { fieldKey, message };
1625
+ }
1626
+ __name(parseAjvError, "parseAjvError");
1627
+ var validateAgainstSchemaOrThrow = /* @__PURE__ */ __name((validator, obj, inputSchema, rootName) => {
1628
+ if (validator.validate(inputSchema, obj)) return;
1629
+ const errorMessage = parseAjvError(validator.errors[0], rootName)?.message;
1630
+ throw new Error(`Input schema is not valid (${errorMessage})`);
1631
+ }, "validateAgainstSchemaOrThrow");
1632
+ function validateBasicStructure(validator, obj) {
1633
+ const schemaWithoutProperties = {
1634
+ ...schema_default,
1635
+ properties: { ...schema_default.properties, properties: { type: "object" } }
1636
+ };
1637
+ validateAgainstSchemaOrThrow(validator, obj, schemaWithoutProperties, "schema");
1638
+ }
1639
+ __name(validateBasicStructure, "validateBasicStructure");
1640
+ function validateField(validator, fieldSchema, fieldKey, isSubField = false) {
1641
+ const relevantDefinitions = isSubField ? subFieldDefinitions : fieldDefinitions;
1642
+ const matchingDefinitions = Object.values(relevantDefinitions).filter((definition2) => {
1643
+ return definition2.properties.type.enum ? definition2.properties.type.enum[0] === fieldSchema.type : Array.isArray(fieldSchema.type);
1644
+ });
1645
+ if (matchingDefinitions.length === 0) {
1646
+ const errorMessage = m("inputSchema.validation.noMatchingDefinition", { fieldKey });
1647
+ throw new Error(`Input schema is not valid (${errorMessage})`);
1648
+ }
1649
+ const enhanceDefinition = /* @__PURE__ */ __name((definition2) => {
1650
+ return {
1651
+ ...definition2,
1652
+ definitions
1653
+ };
1654
+ }, "enhanceDefinition");
1655
+ if (matchingDefinitions.length === 1) {
1656
+ validateAgainstSchemaOrThrow(validator, fieldSchema, enhanceDefinition(matchingDefinitions[0]), `schema.properties.${fieldKey}`);
1657
+ return;
1658
+ }
1659
+ if (fieldSchema.enum) {
1660
+ const definition2 = matchingDefinitions.filter((item) => !!item.properties.enum).pop();
1661
+ if (!definition2) throw new Error('Input schema validation failed to find "enum property" definition');
1662
+ validateAgainstSchemaOrThrow(validator, fieldSchema, enhanceDefinition(definition2), `schema.properties.${fieldKey}.enum`);
1663
+ return;
1664
+ }
1665
+ if (fieldSchema.resourceType) {
1666
+ const definition2 = matchingDefinitions.filter((item) => !!item.properties.resourceType).pop();
1667
+ if (!definition2) throw new Error('Input schema validation failed to find "resource property" definition');
1668
+ validateAgainstSchemaOrThrow(validator, fieldSchema, enhanceDefinition(definition2), `schema.properties.${fieldKey}`);
1669
+ return;
1670
+ }
1671
+ const definition = matchingDefinitions.filter((item) => !item.properties.enum && !item.properties.resourceType).pop();
1672
+ if (!definition) throw new Error('Input schema validation failed to find other than "enum property" definition');
1673
+ validateAgainstSchemaOrThrow(validator, fieldSchema, enhanceDefinition(definition), `schema.properties.${fieldKey}`);
1674
+ }
1675
+ __name(validateField, "validateField");
1676
+ function validateSubFields(validator, fieldSchema, fieldKey) {
1677
+ Object.entries(fieldSchema.properties).forEach(([subFieldKey, subFieldSchema]) => {
1678
+ if (subFieldSchema.type === "object" && subFieldSchema.properties) {
1679
+ validateSubFields(validator, subFieldSchema, `${fieldKey}.${subFieldKey}`);
1680
+ }
1681
+ if (subFieldSchema.type === "array" && subFieldSchema.items) {
1682
+ validateArrayField(validator, subFieldSchema, `${fieldKey}.${subFieldKey}`);
1683
+ }
1684
+ validateField(validator, subFieldSchema, `${fieldKey}.${subFieldKey}`, true);
1685
+ });
1686
+ }
1687
+ __name(validateSubFields, "validateSubFields");
1688
+ function validateArrayField(validator, fieldSchema, fieldKey) {
1689
+ const arraySchema = fieldSchema.items;
1690
+ if (!arraySchema) return;
1691
+ if (arraySchema.type === "object" && arraySchema.properties) {
1692
+ validateSubFields(validator, arraySchema, `${fieldKey}.items`);
1693
+ }
1694
+ if (arraySchema.type === "array" && arraySchema.items) {
1695
+ validateArrayField(validator, arraySchema, `${fieldKey}.items`);
1696
+ }
1697
+ }
1698
+ __name(validateArrayField, "validateArrayField");
1699
+ function validateProperties(inputSchema, validator) {
1700
+ Object.entries(inputSchema.properties).forEach(([fieldKey, fieldSchema]) => {
1701
+ if (fieldSchema.type === "object" && fieldSchema.properties) {
1702
+ validateSubFields(validator, fieldSchema, fieldKey);
1703
+ }
1704
+ if (fieldSchema.type === "array" && fieldSchema.items) {
1705
+ validateArrayField(validator, fieldSchema, fieldKey);
1706
+ }
1707
+ validateField(validator, fieldSchema, fieldKey);
1708
+ });
1709
+ }
1710
+ __name(validateProperties, "validateProperties");
1711
+ function validateExistenceOfRequiredFields(inputSchema) {
1712
+ if (!inputSchema?.required?.length) return;
1713
+ Object.values(inputSchema?.required).forEach((fieldKey) => {
1714
+ if (inputSchema?.properties[fieldKey]) return;
1715
+ throw new Error(m("inputSchema.validation.missingRequiredField", { fieldKey }));
1716
+ });
1717
+ }
1718
+ __name(validateExistenceOfRequiredFields, "validateExistenceOfRequiredFields");
1719
+ function validateInputSchema(validator, inputSchema) {
1720
+ ensureAjvSupportsDraft2019(validator);
1721
+ validateBasicStructure(validator, inputSchema);
1722
+ validateProperties(inputSchema, validator);
1723
+ validateExistenceOfRequiredFields(inputSchema);
1724
+ validateAgainstSchemaOrThrow(validator, inputSchema, schema_default, "schema");
1725
+ }
1726
+ __name(validateInputSchema, "validateInputSchema");
896
1727
  // Annotate the CommonJS export names for ESM import in node:
897
1728
  0 && (module.exports = {
1729
+ ensureAjvSupportsDraft2019,
898
1730
  inputSchema,
899
1731
  m,
900
1732
  makeInputJsFieldsReadable,