@tinacms/schema-tools 1.0.1 → 1.0.2
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/dist/index.es.js +2 -7
- package/dist/index.js +2 -7
- package/dist/types/SchemaTypes.d.ts +2 -1
- package/dist/types.d.ts +12 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -793,7 +793,7 @@ const TinaCloudSchemaZod = z.object({
|
|
|
793
793
|
collections: z.array(TinaCloudCollection),
|
|
794
794
|
config: tinaConfigZod.optional()
|
|
795
795
|
}).superRefine((val, ctx) => {
|
|
796
|
-
var _a, _b
|
|
796
|
+
var _a, _b;
|
|
797
797
|
const dups = findDuplicates((_a = val.collections) == null ? void 0 : _a.map((x) => x.name));
|
|
798
798
|
if (dups) {
|
|
799
799
|
ctx.addIssue({
|
|
@@ -802,12 +802,7 @@ const TinaCloudSchemaZod = z.object({
|
|
|
802
802
|
fatal: true
|
|
803
803
|
});
|
|
804
804
|
}
|
|
805
|
-
(_b = val == null ? void 0 : val.
|
|
806
|
-
if (!x.format) {
|
|
807
|
-
console.warn(`No format provided for collection ${x.name}, defaulting to .md`);
|
|
808
|
-
}
|
|
809
|
-
});
|
|
810
|
-
const media = (_c = val == null ? void 0 : val.config) == null ? void 0 : _c.media;
|
|
805
|
+
const media = (_b = val == null ? void 0 : val.config) == null ? void 0 : _b.media;
|
|
811
806
|
if (media && media.tina && media.loadCustomStore) {
|
|
812
807
|
ctx.addIssue({
|
|
813
808
|
code: z.ZodIssueCode.custom,
|
package/dist/index.js
CHANGED
|
@@ -820,7 +820,7 @@ ${JSON.stringify(val, null, 2)}
|
|
|
820
820
|
collections: z.z.array(TinaCloudCollection),
|
|
821
821
|
config: tinaConfigZod.optional()
|
|
822
822
|
}).superRefine((val, ctx) => {
|
|
823
|
-
var _a, _b
|
|
823
|
+
var _a, _b;
|
|
824
824
|
const dups = findDuplicates((_a = val.collections) == null ? void 0 : _a.map((x) => x.name));
|
|
825
825
|
if (dups) {
|
|
826
826
|
ctx.addIssue({
|
|
@@ -829,12 +829,7 @@ ${JSON.stringify(val, null, 2)}
|
|
|
829
829
|
fatal: true
|
|
830
830
|
});
|
|
831
831
|
}
|
|
832
|
-
(_b = val == null ? void 0 : val.
|
|
833
|
-
if (!x.format) {
|
|
834
|
-
console.warn(`No format provided for collection ${x.name}, defaulting to .md`);
|
|
835
|
-
}
|
|
836
|
-
});
|
|
837
|
-
const media = (_c = val == null ? void 0 : val.config) == null ? void 0 : _c.media;
|
|
832
|
+
const media = (_b = val == null ? void 0 : val.config) == null ? void 0 : _b.media;
|
|
838
833
|
if (media && media.tina && media.loadCustomStore) {
|
|
839
834
|
ctx.addIssue({
|
|
840
835
|
code: z.z.ZodIssueCode.custom,
|
|
@@ -12,6 +12,7 @@ limitations under the License.
|
|
|
12
12
|
*/
|
|
13
13
|
import type { FC } from 'react';
|
|
14
14
|
import { TinaSchema } from '../schema';
|
|
15
|
+
import { Config } from '../types';
|
|
15
16
|
import type { TinaCloudSchemaConfig } from './config';
|
|
16
17
|
export declare type UIField<F extends UIField = any, Shape = any> = {
|
|
17
18
|
label?: string;
|
|
@@ -31,7 +32,7 @@ export interface TinaCloudSchema<WithNamespace extends boolean, Store = any> {
|
|
|
31
32
|
/**
|
|
32
33
|
* @deprecated use `defineConfig` in a config.{js,ts} file instead
|
|
33
34
|
*/
|
|
34
|
-
config?:
|
|
35
|
+
config?: Config;
|
|
35
36
|
}
|
|
36
37
|
export declare type TinaCloudSchemaBase = TinaCloudSchema<false>;
|
|
37
38
|
export declare type TinaCloudSchemaEnriched = TinaCloudSchema<true>;
|
package/dist/types.d.ts
CHANGED
|
@@ -373,7 +373,19 @@ export interface Schema {
|
|
|
373
373
|
*/
|
|
374
374
|
collections: Collection[];
|
|
375
375
|
}
|
|
376
|
+
export declare type TokenObject = {
|
|
377
|
+
id_token: string;
|
|
378
|
+
access_token: string;
|
|
379
|
+
refresh_token: string;
|
|
380
|
+
};
|
|
376
381
|
export interface Config<CMSCallback = undefined, FormifyCallback = undefined, DocumentCreatorCallback = undefined, Store = undefined> {
|
|
382
|
+
admin?: {
|
|
383
|
+
auth?: {
|
|
384
|
+
onLogin?: (args: {
|
|
385
|
+
token: TokenObject;
|
|
386
|
+
}) => Promise<void>;
|
|
387
|
+
};
|
|
388
|
+
};
|
|
377
389
|
/**
|
|
378
390
|
* The Schema is used to define the shape of the content.
|
|
379
391
|
*
|