@cloudcannon/configuration-types 0.0.33 → 0.0.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcannon/configuration-types",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "type": "module",
5
5
  "description": "Contains TypeScript declarations and generates JSONSchema files for the CloudCannon configuration file.",
6
6
  "author": "CloudCannon <support@cloudcannon.com>",
package/src/inputs.d.ts CHANGED
@@ -53,6 +53,13 @@ interface WithRequiredValidation {
53
53
  * By default, this key is false (i.e, CloudCannon does not require this Input to have a value).
54
54
  */
55
55
  required?: boolean;
56
+ /**
57
+ * This key defines the message that explains why an Input is required. This key requires you to
58
+ * define `options.required`.
59
+ *
60
+ * This key has no default.
61
+ */
62
+ required_message?: string;
56
63
  }
57
64
 
58
65
  interface WithTextValidation {
@@ -70,6 +77,13 @@ interface WithTextValidation {
70
77
  * To use this key in a Select Input, `options.allow_create` must be set to true.
71
78
  */
72
79
  max_length?: number;
80
+ /**
81
+ * This key defines the message that explains which maximum string length an Input will accept.
82
+ * This key requires you to define `options.max_length`.
83
+ *
84
+ * This key has no default.
85
+ */
86
+ max_length_message?: string;
73
87
  /**
74
88
  * This key defines the minimum string length, in characters, that CloudCannon will allow in an
75
89
  * Input. When configured, CloudCannon will warn you when an Input value is too short. If the
@@ -84,6 +98,13 @@ interface WithTextValidation {
84
98
  * To use this key in a Select Input, `options.allow_create` must be set to true.
85
99
  */
86
100
  min_length?: number;
101
+ /**
102
+ * This key defines the message that explains which minimum string length an Input will accept.
103
+ * This key requires you to define `options.min_length`.
104
+ *
105
+ * This key has no default.
106
+ */
107
+ min_length_message?: string;
87
108
  /**
88
109
  * This key defines a regular expression that the Input value must match. When configured,
89
110
  * CloudCannon will require you to enter a value that matches the REGEX pattern. If the Input
@@ -166,6 +187,13 @@ interface WithArrayValidation {
166
187
  * This key has no default.
167
188
  */
168
189
  max_items?: number;
190
+ /**
191
+ * This key defines the message that explains why an Input needs to have a maximum number of
192
+ * items. This key requires you to define `options.max_items`.
193
+ *
194
+ * This key has no default.
195
+ */
196
+ max_items_message?: string;
169
197
  /**
170
198
  * This key defines the minimum number of items CloudCannon will allow in an Input. When
171
199
  * configured, CloudCannon will prevent you from removing items from this Input below this value.
@@ -178,6 +206,13 @@ interface WithArrayValidation {
178
206
  * This key has no default.
179
207
  */
180
208
  min_items?: number;
209
+ /**
210
+ * This key defines the message that explains why an Input needs to have a minimum number of
211
+ * items. This key requires you to define `options.min_items`.
212
+ *
213
+ * This key has no default.
214
+ */
215
+ min_items_message?: string;
181
216
  /**
182
217
  * This key defines the JSON Path selector that CloudCannon should use to determine if the value
183
218
  * of an Input is unique. When configured, CloudCannon will require the value of the Input to be
@@ -190,6 +225,13 @@ interface WithArrayValidation {
190
225
  * This key has no default.
191
226
  */
192
227
  unique_on?: string;
228
+ /**
229
+ * This key defines the message that explains why an Input needs to be unique. This key requires
230
+ * you to define `options.unique_on`.
231
+ *
232
+ * This key has no default.
233
+ */
234
+ unique_on_message?: string;
193
235
  }
194
236
 
195
237
  export interface WithArrayControlOptions {
@@ -552,7 +594,7 @@ export interface RichTextInput extends BaseInput {
552
594
  options?: RichTextInputOptions;
553
595
  }
554
596
 
555
- export interface DateInputOptions extends WithEmptyTypeText {
597
+ export interface DateInputOptions extends WithEmptyTypeText, WithRequiredValidation {
556
598
  /**
557
599
  * Specifies the time zone that dates are displayed and edited in. Also changes the suffix the
558
600
  * date is persisted to the file with. Defaults to the global `timezone`.
@@ -572,6 +614,13 @@ export interface DateInputOptions extends WithEmptyTypeText {
572
614
  * This key has no default.
573
615
  */
574
616
  start_from?: Date;
617
+ /**
618
+ * This key defines the message that explains why an Input needs to have a start date. This key
619
+ * requires you to define `options.start_from`.
620
+ *
621
+ * This key has no default.
622
+ */
623
+ start_from_message?: string;
575
624
  /**
576
625
  * This key defines the date and time, exclusive, that CloudCannon will allow in an Input. When
577
626
  * configured, CloudCannon will prevent you from selecting a later date and time. If the Input
@@ -584,6 +633,13 @@ export interface DateInputOptions extends WithEmptyTypeText {
584
633
  * This key has no default.
585
634
  */
586
635
  end_before?: Date;
636
+ /**
637
+ * This key defines the message that explains why an Input needs to have an end date. This key
638
+ * requires you to define `options.end_before`.
639
+ *
640
+ * This key has no default.
641
+ */
642
+ end_before_message?: string;
587
643
  }
588
644
 
589
645
  export interface DateInput extends BaseInput {
@@ -620,6 +676,23 @@ export interface FileInputOptions
620
676
  * accepted.
621
677
  */
622
678
  accepts_mime_types?: MimeType[] | string;
679
+ /**
680
+ * This key defines the maximum file size, in kilobytes, that CloudCannon will allow in an Input.
681
+ * When configured, CloudCannon will prevent you from uploading a file larger than the specified
682
+ * size. If the Input already contains a file larger than the specified size, CloudCannon will
683
+ * require you to change it to a valid value to save your changes, or discard your unsaved
684
+ * changes.
685
+ *
686
+ * Value can be any positive integer.
687
+ */
688
+ max_file_size?: number;
689
+ /**
690
+ * This key defines the message that explains why an Input needs to have a maximum file size. This
691
+ * key requires you to define `options.max_file_size`.
692
+ *
693
+ * This key has no default.
694
+ */
695
+ max_file_size_message?: string;
623
696
  /**
624
697
  * If you have one or more DAMs connected to your site, you can use this key to list which asset
625
698
  * sources can be uploaded to and selected from.