@cloudcannon/configuration-types 0.0.20 → 0.0.22

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.
@@ -4,63 +4,45 @@
4
4
  "additionalProperties": false,
5
5
  "definitions": {
6
6
  "AddOption": {
7
- "anyOf": [
8
- {
9
- "additionalProperties": false,
10
- "properties": {
11
- "base_path": {
12
- "description": "Enforces a path for new files to be created in, regardless of path the user is currently navigated to within the collection file list. Relative to the path of the collection defined in collection. Defaults to the path within the collection the user is currently navigated to.",
13
- "markdownDescription": "Enforces a path for new files to be created in, regardless of path the user is currently\nnavigated to within the collection file list. Relative to the path of the collection\ndefined in collection. Defaults to the path within the collection the user is currently\nnavigated to.",
14
- "type": "string"
15
- },
16
- "collection": {
17
- "description": "Sets which collection this action is creating a file in. This is used when matching the value for schema. Defaults to the containing collection these `add_options` are configured in.",
18
- "markdownDescription": "Sets which collection this action is creating a file in. This is used when matching the\nvalue for schema. Defaults to the containing collection these `add_options` are configured\nin.",
19
- "type": "string"
20
- },
21
- "default_content_file": {
22
- "description": "The path to a file used to populate the initial contents of a new file if no schemas are configured. We recommend using schemas, and this is ignored if a schema is available.",
23
- "markdownDescription": "The path to a file used to populate the initial contents of a new file if no schemas are\nconfigured. We recommend using schemas, and this is ignored if a schema is available.",
24
- "type": "string"
25
- },
26
- "editor": {
27
- "$ref": "#/definitions/EditorKey",
28
- "description": "The editor to open the new file in. Defaults to an appropriate editor for new file's type if possible. If no default editor can be calculated, or the editor does not support the new file type, a warning is shown in place of the editor.",
29
- "markdownDescription": "The editor to open the new file in. Defaults to an appropriate editor for new file's type\nif possible. If no default editor can be calculated, or the editor does not support the new\nfile type, a warning is shown in place of the editor."
30
- },
31
- "icon": {
32
- "$ref": "#/definitions/Icon",
33
- "description": "The icon next to the text in the menu item. Defaults to using icon from the matching schema if set, then falls back to add.",
34
- "markdownDescription": "The icon next to the text in the menu item. Defaults to using icon from the matching schema\nif set, then falls back to add."
35
- },
36
- "name": {
37
- "description": "The text displayed for the menu item. Defaults to using name from the matching schema if set.",
38
- "markdownDescription": "The text displayed for the menu item. Defaults to using name from the matching schema if\nset.",
39
- "type": "string"
40
- },
41
- "schema": {
42
- "description": "The schema that new files are created from with this action. This schema is not restricted to the containing collection, and is instead relative to the collection specified with collection. Defaults to default if schemas are configured for the collection.",
43
- "markdownDescription": "The schema that new files are created from with this action. This schema is not restricted\nto the containing collection, and is instead relative to the collection specified with\ncollection. Defaults to default if schemas are configured for the collection.",
44
- "type": "string"
45
- }
46
- },
47
- "type": "object"
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "base_path": {
10
+ "description": "Enforces a path for new files to be created in, regardless of path the user is currently navigated to within the collection file list. Relative to the path of the collection defined in collection. Defaults to the path within the collection the user is currently navigated to.",
11
+ "markdownDescription": "Enforces a path for new files to be created in, regardless of path the user is currently\nnavigated to within the collection file list. Relative to the path of the collection defined in\ncollection. Defaults to the path within the collection the user is currently navigated to.",
12
+ "type": "string"
48
13
  },
49
- {
50
- "additionalProperties": false,
51
- "properties": {
52
- "href": {
53
- "description": "The link that opens when the option is clicked. Can either be an external or internal link. If internal, the link is relative to the current site.",
54
- "markdownDescription": "The link that opens when the option is clicked. Can either be an external or internal link.\nIf internal, the link is relative to the current site.",
55
- "type": "string"
56
- }
57
- },
58
- "required": [
59
- "href"
60
- ],
61
- "type": "object"
14
+ "collection": {
15
+ "description": "Sets which collection this action is creating a file in. This is used when matching the value for schema. Defaults to the containing collection these `add_options` are configured in.",
16
+ "markdownDescription": "Sets which collection this action is creating a file in. This is used when matching the value\nfor schema. Defaults to the containing collection these `add_options` are configured in.",
17
+ "type": "string"
18
+ },
19
+ "default_content_file": {
20
+ "description": "The path to a file used to populate the initial contents of a new file if no schemas are configured. We recommend using schemas, and this is ignored if a schema is available.",
21
+ "markdownDescription": "The path to a file used to populate the initial contents of a new file if no schemas are\nconfigured. We recommend using schemas, and this is ignored if a schema is available.",
22
+ "type": "string"
23
+ },
24
+ "editor": {
25
+ "$ref": "#/definitions/EditorKey",
26
+ "description": "The editor to open the new file in. Defaults to an appropriate editor for new file's type if possible. If no default editor can be calculated, or the editor does not support the new file type, a warning is shown in place of the editor.",
27
+ "markdownDescription": "The editor to open the new file in. Defaults to an appropriate editor for new file's type if\npossible. If no default editor can be calculated, or the editor does not support the new file\ntype, a warning is shown in place of the editor."
28
+ },
29
+ "icon": {
30
+ "$ref": "#/definitions/Icon",
31
+ "description": "The icon next to the text in the menu item. Defaults to using icon from the matching schema if set, then falls back to add.",
32
+ "markdownDescription": "The icon next to the text in the menu item. Defaults to using icon from the matching schema if\nset, then falls back to add."
33
+ },
34
+ "name": {
35
+ "description": "The text displayed for the menu item. Defaults to using name from the matching schema if set.",
36
+ "markdownDescription": "The text displayed for the menu item. Defaults to using name from the matching schema if set.",
37
+ "type": "string"
38
+ },
39
+ "schema": {
40
+ "description": "The schema that new files are created from with this action. This schema is not restricted to the containing collection, and is instead relative to the collection specified with collection. Defaults to default if schemas are configured for the collection.",
41
+ "markdownDescription": "The schema that new files are created from with this action. This schema is not restricted to\nthe containing collection, and is instead relative to the collection specified with collection.\nDefaults to default if schemas are configured for the collection.",
42
+ "type": "string"
62
43
  }
63
- ]
44
+ },
45
+ "type": "object"
64
46
  },
65
47
  "ArrayInput": {
66
48
  "additionalProperties": false,
@@ -876,7 +858,14 @@
876
858
  "add_options": {
877
859
  "description": "Changes the options presented in the add menu in the collection file list. Defaults to an automatically generated list from _Schemas_, or uses the first file in the collection if no schemas are configured.",
878
860
  "items": {
879
- "$ref": "#/definitions/AddOption"
861
+ "anyOf": [
862
+ {
863
+ "$ref": "#/definitions/AddOption"
864
+ },
865
+ {
866
+ "$ref": "#/definitions/HrefAddOption"
867
+ }
868
+ ]
880
869
  },
881
870
  "markdownDescription": "Changes the options presented in the add menu in the collection file list. Defaults to an\nautomatically generated list from _Schemas_, or uses the first file in the collection if no\nschemas are configured.",
882
871
  "type": "array"
@@ -1614,6 +1603,31 @@
1614
1603
  },
1615
1604
  "type": "object"
1616
1605
  },
1606
+ "HrefAddOption": {
1607
+ "additionalProperties": false,
1608
+ "properties": {
1609
+ "href": {
1610
+ "description": "The link that opens when the option is clicked. Can either be an external or internal link. If internal, the link is relative to the current site.",
1611
+ "markdownDescription": "The link that opens when the option is clicked. Can either be an external or internal link. If\ninternal, the link is relative to the current site.",
1612
+ "type": "string"
1613
+ },
1614
+ "icon": {
1615
+ "$ref": "#/definitions/Icon",
1616
+ "default": "add",
1617
+ "description": "The icon next to the text in the menu item.",
1618
+ "markdownDescription": "The icon next to the text in the menu item."
1619
+ },
1620
+ "name": {
1621
+ "description": "The text displayed for the menu item.",
1622
+ "markdownDescription": "The text displayed for the menu item.",
1623
+ "type": "string"
1624
+ }
1625
+ },
1626
+ "required": [
1627
+ "href"
1628
+ ],
1629
+ "type": "object"
1630
+ },
1617
1631
  "Icon": {
1618
1632
  "enum": [
1619
1633
  "10k",
@@ -8413,7 +8427,7 @@
8413
8427
  "markdownDescription": "Options that are specific to this `type` of input."
8414
8428
  },
8415
8429
  "type": {
8416
- "const": "range",
8430
+ "const": "url",
8417
8431
  "description": "Sets an input type, which controls how this input appears and behaves.",
8418
8432
  "markdownDescription": "Sets an input type, which controls how this input appears and behaves.",
8419
8433
  "type": "string"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcannon/configuration-types",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "description": "Contains TypeScript declarations and generates JSONSchema files for the CloudCannon configuration file.",
5
5
  "author": "CloudCannon <support@cloudcannon.com>",
6
6
  "license": "MIT",
@@ -88,18 +88,25 @@ export interface ReaderConfiguration extends Configuration {
88
88
  output?: string;
89
89
  }
90
90
 
91
- export interface BuildCoupledCollectionConfig extends Omit<CollectionConfig, 'url'>, Filterable {
91
+ export interface BuildCoupledCollectionConfig
92
+ extends Omit<CollectionConfig, 'url' | 'path'>,
93
+ Filterable {
92
94
  /**
93
95
  * Overrides the default singular input key of the collection. This is used for naming conventions
94
96
  * for select and multiselect inputs.
95
97
  */
96
98
  singular_key?: string;
99
+ /**
100
+ * The top-most folder where the files in this collection are stored. It is relative to `source`.
101
+ */
102
+ path?: string;
97
103
  }
98
104
 
99
105
  interface BuildCoupledConfiguration
100
- extends Omit<Configuration, 'data_config'>,
106
+ extends Omit<Configuration, 'data_config' | 'collections_config'>,
101
107
  WithCollectionsConfigOverride {
102
108
  paths?: BuildCoupledPaths;
109
+ collections_config?: BuildCoupledCollectionConfig;
103
110
  }
104
111
 
105
112
  /**
@@ -853,7 +853,7 @@ export interface RangeInput extends BaseInput {
853
853
  export interface UrlInputOptions extends WithEmptyTypeText, WithPaths {}
854
854
 
855
855
  export interface UrlInput extends BaseInput {
856
- type: 'range';
856
+ type: 'url';
857
857
  /**
858
858
  * Options that are specific to this `type` of input.
859
859
  */
@@ -901,6 +901,14 @@ export interface DateInput extends BaseInput {
901
901
  options?: DateInputOptions;
902
902
  }
903
903
 
904
+ export interface TimeInput extends BaseInput {
905
+ type: 'time';
906
+ /**
907
+ * Options that are specific to Time inputs.
908
+ */
909
+ options?: WithEmptyTypeText;
910
+ }
911
+
904
912
  export interface FileInputOptions extends WithEmptyTypeText, WithPaths {
905
913
  /**
906
914
  * Restricts which file types are available to select or upload to this input. Accepted format is
@@ -1269,56 +1277,63 @@ export interface Preview
1269
1277
  gallery?: PreviewGallery;
1270
1278
  }
1271
1279
 
1272
- export type AddOption =
1273
- | {
1274
- /**
1275
- * The text displayed for the menu item. Defaults to using name from the matching schema if
1276
- * set.
1277
- */
1278
- name?: string;
1279
- /**
1280
- * The icon next to the text in the menu item. Defaults to using icon from the matching schema
1281
- * if set, then falls back to add.
1282
- */
1283
- icon?: Icon;
1284
- /**
1285
- * The editor to open the new file in. Defaults to an appropriate editor for new file's type
1286
- * if possible. If no default editor can be calculated, or the editor does not support the new
1287
- * file type, a warning is shown in place of the editor.
1288
- */
1289
- editor?: EditorKey;
1290
- /**
1291
- * Enforces a path for new files to be created in, regardless of path the user is currently
1292
- * navigated to within the collection file list. Relative to the path of the collection
1293
- * defined in collection. Defaults to the path within the collection the user is currently
1294
- * navigated to.
1295
- */
1296
- base_path?: string;
1297
- /**
1298
- * Sets which collection this action is creating a file in. This is used when matching the
1299
- * value for schema. Defaults to the containing collection these `add_options` are configured
1300
- * in.
1301
- */
1302
- collection?: string;
1303
- /**
1304
- * The schema that new files are created from with this action. This schema is not restricted
1305
- * to the containing collection, and is instead relative to the collection specified with
1306
- * collection. Defaults to default if schemas are configured for the collection.
1307
- */
1308
- schema?: string;
1309
- /**
1310
- * The path to a file used to populate the initial contents of a new file if no schemas are
1311
- * configured. We recommend using schemas, and this is ignored if a schema is available.
1312
- */
1313
- default_content_file?: string;
1314
- }
1315
- | {
1316
- /**
1317
- * The link that opens when the option is clicked. Can either be an external or internal link.
1318
- * If internal, the link is relative to the current site.
1319
- */
1320
- href: string;
1321
- };
1280
+ export type HrefAddOption = {
1281
+ /**
1282
+ * The text displayed for the menu item.
1283
+ */
1284
+ name?: string;
1285
+ /**
1286
+ * The icon next to the text in the menu item.
1287
+ *
1288
+ * @default add
1289
+ */
1290
+ icon?: Icon;
1291
+ /**
1292
+ * The link that opens when the option is clicked. Can either be an external or internal link. If
1293
+ * internal, the link is relative to the current site.
1294
+ */
1295
+ href: string;
1296
+ };
1297
+
1298
+ export type AddOption = {
1299
+ /**
1300
+ * The text displayed for the menu item. Defaults to using name from the matching schema if set.
1301
+ */
1302
+ name?: string;
1303
+ /**
1304
+ * The icon next to the text in the menu item. Defaults to using icon from the matching schema if
1305
+ * set, then falls back to add.
1306
+ */
1307
+ icon?: Icon;
1308
+ /**
1309
+ * The editor to open the new file in. Defaults to an appropriate editor for new file's type if
1310
+ * possible. If no default editor can be calculated, or the editor does not support the new file
1311
+ * type, a warning is shown in place of the editor.
1312
+ */
1313
+ editor?: EditorKey;
1314
+ /**
1315
+ * Enforces a path for new files to be created in, regardless of path the user is currently
1316
+ * navigated to within the collection file list. Relative to the path of the collection defined in
1317
+ * collection. Defaults to the path within the collection the user is currently navigated to.
1318
+ */
1319
+ base_path?: string;
1320
+ /**
1321
+ * Sets which collection this action is creating a file in. This is used when matching the value
1322
+ * for schema. Defaults to the containing collection these `add_options` are configured in.
1323
+ */
1324
+ collection?: string;
1325
+ /**
1326
+ * The schema that new files are created from with this action. This schema is not restricted to
1327
+ * the containing collection, and is instead relative to the collection specified with collection.
1328
+ * Defaults to default if schemas are configured for the collection.
1329
+ */
1330
+ schema?: string;
1331
+ /**
1332
+ * The path to a file used to populate the initial contents of a new file if no schemas are
1333
+ * configured. We recommend using schemas, and this is ignored if a schema is available.
1334
+ */
1335
+ default_content_file?: string;
1336
+ };
1322
1337
 
1323
1338
  interface WithPreview {
1324
1339
  /**
@@ -1488,7 +1503,7 @@ export interface CollectionConfig extends Cascade, WithPreview {
1488
1503
  * automatically generated list from _Schemas_, or uses the first file in the collection if no
1489
1504
  * schemas are configured.
1490
1505
  */
1491
- add_options?: AddOption[];
1506
+ add_options?: (AddOption | HrefAddOption)[];
1492
1507
  /**
1493
1508
  * The create path definition to control where new files are saved to inside this collection.
1494
1509
  * Defaults to [relative_base_path]/{title|slugify}.md.