@tinacms/schema-tools 0.1.3 → 0.1.5

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.
@@ -20,6 +20,9 @@ export declare type UIField<F extends UIField = any, Shape = any> = {
20
20
  parse?: (value: Shape, name: string, field: F) => any;
21
21
  format?: (value: Shape, name: string, field: F) => any;
22
22
  validate?(value: Shape, allValues: any, meta: any, field: UIField<F, Shape>): string | object | undefined | void;
23
+ /**
24
+ * @deprecated use `defaultItem` at the collection level instead
25
+ */
23
26
  defaultValue?: Shape;
24
27
  };
25
28
  export interface TinaCloudSchema<WithNamespace extends boolean, Store = any> {
@@ -56,12 +59,24 @@ declare type Document = {
56
59
  extension: string;
57
60
  };
58
61
  };
62
+ export declare type TinaIndex = {
63
+ name: string;
64
+ fields: {
65
+ name: string;
66
+ }[];
67
+ };
59
68
  interface BaseCollection {
60
69
  label?: string;
61
70
  name: string;
62
71
  path: string;
72
+ defaultItem?: () => unknown | unknown;
73
+ indexes?: TinaIndex[];
63
74
  format?: FormatType;
64
75
  ui?: {
76
+ filename?: {
77
+ slugify?: (values: unknown) => string;
78
+ disabled?: boolean;
79
+ };
65
80
  /**
66
81
  * Forms for this collection will be editable from the global sidebar rather than the form panel
67
82
  */
@@ -117,11 +132,12 @@ export declare type TinaFieldEnriched = TinaFieldInner<true> & {
117
132
  */
118
133
  parentTypename?: string;
119
134
  };
120
- interface TinaField {
135
+ export interface TinaField {
121
136
  name: string;
122
137
  label?: string;
123
138
  description?: string;
124
139
  required?: boolean;
140
+ indexed?: boolean;
125
141
  /**
126
142
  * Any items passed to the UI field will be passed to the underlying field.
127
143
  * NOTE: only serializable values are supported, so functions like `validate`
@@ -44,7 +44,7 @@ export declare type TinaCMSConfig<CMSCallback = undefined, FormifyCallback = und
44
44
  */
45
45
  referenceDepth?: number;
46
46
  };
47
- build?: {
47
+ build: {
48
48
  /**
49
49
  * The folder where your application stores assets, eg. `"public"`
50
50
  */
@@ -37,4 +37,13 @@ export interface TinaCloudSchemaConfig<Store = any> {
37
37
  mediaRoot: string;
38
38
  };
39
39
  };
40
+ /**
41
+ * Used to override the default Tina Cloud API URL
42
+ */
43
+ tinaioConfig?: {
44
+ assetsApiUrlOverride?: string;
45
+ frontendUrlOverride?: string;
46
+ identityApiUrlOverride?: string;
47
+ contentApiUrlOverride?: string;
48
+ };
40
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/schema-tools",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "exports": {