tinacms 1.5.8 → 1.5.10

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.
@@ -1,7 +1,8 @@
1
1
  import type { TinaCMS } from '@tinacms/toolkit';
2
- import type { TinaSchema } from '@tinacms/schema-tools';
2
+ import type { Collection, TinaSchema } from '@tinacms/schema-tools';
3
3
  import type { Client } from '../internalClient';
4
- import type { DocumentForm } from './types';
4
+ import type { CollectionResponse, DocumentForm } from './types';
5
+ import { SearchClient } from '@tinacms/search/dist/index-client';
5
6
  export interface FilterArgs {
6
7
  filterField: string;
7
8
  startsWith?: string;
@@ -13,12 +14,14 @@ export declare class TinaAdminApi {
13
14
  api: Client;
14
15
  useDataLayer: boolean;
15
16
  schema: TinaSchema;
17
+ searchClient?: SearchClient;
18
+ maxSearchIndexFieldLength: number;
16
19
  constructor(cms: TinaCMS);
17
20
  isAuthenticated(): Promise<boolean>;
18
21
  checkGraphqlSchema({ localSchema }: {
19
22
  localSchema: any;
20
23
  }): Promise<boolean>;
21
- fetchCollections(): import("@tinacms/schema-tools").Collection<true>[];
24
+ fetchCollections(): Collection<true>[];
22
25
  renameDocument({ collection, relativePath, newRelativePath }: {
23
26
  collection: any;
24
27
  relativePath: any;
@@ -28,10 +31,10 @@ export declare class TinaAdminApi {
28
31
  collection: string;
29
32
  relativePath: string;
30
33
  }): Promise<void>;
31
- fetchCollection(collectionName: string, includeDocuments: boolean, folder?: string, after?: string, sortKey?: string, order?: 'asc' | 'desc', filterArgs?: FilterArgs): Promise<any>;
32
- fetchDocument(collectionName: string, relativePath: string): Promise<{
34
+ fetchCollection(collectionName: string, includeDocuments: boolean, folder?: string, after?: string, sortKey?: string, order?: 'asc' | 'desc', filterArgs?: FilterArgs): Promise<Collection<false> | CollectionResponse>;
35
+ fetchDocument(collectionName: string, relativePath: string, values?: boolean): Promise<{
33
36
  document: DocumentForm;
34
37
  }>;
35
- createDocument(collectionName: string, relativePath: string, params: Object): Promise<unknown>;
36
- updateDocument(collectionName: string, relativePath: string, params: Object): Promise<unknown>;
38
+ createDocument(collection: Collection, relativePath: string, params: Object): Promise<unknown>;
39
+ updateDocument(collection: Collection, relativePath: string, params: Object): Promise<unknown>;
37
40
  }
@@ -3,19 +3,30 @@
3
3
  */
4
4
  /// <reference types="react" />
5
5
  import type { TinaCMS } from '@tinacms/toolkit';
6
+ import type { Collection } from '@tinacms/schema-tools';
6
7
  import { FilterArgs } from '../api';
7
8
  import type { CollectionResponse } from '../types';
8
9
  export declare const useGetCollection: (cms: TinaCMS, collectionName: string, includeDocuments: boolean, folder: {
9
10
  loading: boolean;
10
11
  fullyQualifiedName: string;
11
12
  }, after?: string, sortKey?: string, filterArgs?: FilterArgs) => {
12
- collection: CollectionResponse;
13
+ collection: Collection<false> | CollectionResponse;
13
14
  loading: boolean;
14
15
  error: Error;
15
16
  reFetchCollection: () => void;
16
- collectionExtra: import("@tinacms/schema-tools").Collection<true>;
17
+ collectionExtra: Collection<true>;
17
18
  };
18
- declare const GetCollection: ({ cms, collectionName, folder, includeDocuments, startCursor, sortKey, children, filterArgs, }: {
19
+ export declare const useSearchCollection: (cms: TinaCMS, collectionName: string, includeDocuments: boolean, folder: {
20
+ loading: boolean;
21
+ fullyQualifiedName: string;
22
+ }, after?: string, search?: string) => {
23
+ collection: Collection<false> | CollectionResponse;
24
+ loading: boolean;
25
+ error: Error;
26
+ reFetchCollection: () => void;
27
+ collectionExtra: Collection<true>;
28
+ };
29
+ declare const GetCollection: ({ cms, collectionName, folder, includeDocuments, startCursor, sortKey, children, filterArgs, search, }: {
19
30
  cms: TinaCMS;
20
31
  collectionName: string;
21
32
  folder: {
@@ -27,5 +38,6 @@ declare const GetCollection: ({ cms, collectionName, folder, includeDocuments, s
27
38
  sortKey?: string;
28
39
  children: any;
29
40
  filterArgs?: FilterArgs;
41
+ search?: string;
30
42
  }) => JSX.Element;
31
43
  export default GetCollection;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export interface TemplateResponse {
5
5
  name: string;
6
- label: string;
6
+ label?: string | boolean;
7
7
  fields: any[];
8
8
  }
9
9
  export interface DocumentNode {
@@ -40,7 +40,7 @@ export interface DocumentSys {
40
40
  export interface CollectionResponse {
41
41
  label: string;
42
42
  name: string;
43
- slug: string;
43
+ slug?: string;
44
44
  format?: string;
45
45
  templates?: TemplateResponse[];
46
46
  documents?: {
package/dist/index.d.ts CHANGED
@@ -53,5 +53,5 @@ export declare const defineLegacyConfig: (config: Omit<TinaCMSProviderDefaultPro
53
53
  interface MediaStoreClass {
54
54
  new (...args: any[]): MediaStore;
55
55
  }
56
- export declare const defineStaticConfig: (config: Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, MediaStoreClass>) => Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, MediaStoreClass>;
57
- export declare const defineConfig: (config: Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, MediaStoreClass>) => Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, MediaStoreClass>;
56
+ export declare const defineStaticConfig: (config: Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, MediaStoreClass, undefined>) => Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, MediaStoreClass, undefined>;
57
+ export declare const defineConfig: (config: Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, MediaStoreClass, undefined>) => Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, MediaStoreClass, undefined>;