tinacms 2.7.7 → 2.7.9
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/admin/components/Page.d.ts +3 -9
- package/dist/admin/components/Sidebar.d.ts +0 -3
- package/dist/admin/components/ui/tooltip.d.ts +7 -0
- package/dist/admin/pages/CollectionCreatePage.d.ts +1 -1
- package/dist/admin/pages/CollectionListPage.d.ts +2 -2
- package/dist/admin/pages/DashboardPage.d.ts +0 -3
- package/dist/admin/pages/ScreenPage.d.ts +0 -3
- package/dist/client.js +0 -1
- package/dist/client.mjs +0 -1
- package/dist/index.js +10969 -10976
- package/dist/index.mjs +11076 -11084
- package/dist/node-cache-5e8db9f0.mjs +0 -1
- package/dist/react.d.ts +13 -6
- package/dist/react.js +58 -53
- package/dist/react.mjs +58 -53
- package/dist/rich-text/index.js +0 -1
- package/dist/rich-text/index.mjs +0 -1
- package/dist/rich-text/prism.js +0 -1
- package/dist/rich-text/prism.mjs +0 -1
- package/dist/toolkit/components/media/media-item.d.ts +1 -1
- package/dist/toolkit/components/ui/breadcrumb.d.ts +11 -0
- package/dist/toolkit/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/toolkit/fields/components/password-field.d.ts +1 -1
- package/dist/toolkit/fields/components/reference/components/button.d.ts +1 -1
- package/dist/toolkit/fields/components/reference/components/popover.d.ts +1 -1
- package/dist/toolkit/fields/components/reference/model/reference-link-props.d.ts +2 -0
- package/dist/toolkit/fields/components/select.d.ts +2 -2
- package/dist/toolkit/fields/components/text-field.d.ts +1 -1
- package/dist/toolkit/fields/plugins/group-field-plugin.d.ts +1 -1
- package/dist/toolkit/fields/plugins/list-field-meta.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/index.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/transforms/is-url.d.ts +1 -2
- package/dist/toolkit/form-builder/fields-builder.d.ts +1 -1
- package/dist/toolkit/form-builder/form-builder.d.ts +15 -5
- package/dist/toolkit/forms/field.d.ts +3 -0
- package/dist/toolkit/forms/form.d.ts +22 -3
- package/dist/toolkit/git-client/git-client.d.ts +25 -2
- package/dist/toolkit/git-client/git-file.d.ts +18 -0
- package/dist/toolkit/git-client/git-media-store.d.ts +13 -0
- package/dist/toolkit/git-client/use-git-file.d.ts +4 -0
- package/dist/toolkit/icons/Tina.d.ts +0 -5
- package/dist/toolkit/index.d.ts +1 -1
- package/dist/toolkit/plugin-branch-switcher/branch-button.d.ts +1 -0
- package/dist/toolkit/plugin-branch-switcher/index.d.ts +0 -1
- package/dist/toolkit/react-sidebar/components/alert.d.ts +5 -0
- package/dist/toolkit/react-sidebar/components/form-list.d.ts +1 -1
- package/dist/toolkit/react-sidebar/components/nav.d.ts +5 -3
- package/dist/toolkit/react-sidebar/components/resize-handle.d.ts +0 -5
- package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +3 -7
- package/dist/toolkit/react-sidebar/components/sidebar.d.ts +0 -7
- package/dist/toolkit/react-sidebar/components/sync-status.d.ts +5 -8
- package/dist/toolkit/react-sidebar/index.d.ts +1 -1
- package/dist/toolkit/styles/button.d.ts +2 -2
- package/dist/toolkit/tina-state.d.ts +11 -0
- package/dist/utils/cn.d.ts +2 -0
- package/package.json +6 -6
- package/dist/client.js.map +0 -1
- package/dist/client.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/node-cache-5e8db9f0.mjs.map +0 -1
- package/dist/react.js.map +0 -1
- package/dist/react.mjs.map +0 -1
- package/dist/rich-text/index.js.map +0 -1
- package/dist/rich-text/index.mjs.map +0 -1
- package/dist/rich-text/prism.js.map +0 -1
- package/dist/rich-text/prism.mjs.map +0 -1
- package/dist/toolkit/plugin-branch-switcher/branch-banner.d.ts +0 -2
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated as the API is clunky and hard to use. Mutations should now be
|
|
3
|
+
* done via Graphql. This will be removed by July 2025.
|
|
4
|
+
*/
|
|
1
5
|
export declare class GitClient {
|
|
2
6
|
private baseUrl;
|
|
3
7
|
constructor(baseUrl: string);
|
|
@@ -29,6 +33,9 @@ export declare class GitClient {
|
|
|
29
33
|
* @deprecated
|
|
30
34
|
*/
|
|
31
35
|
isAuthenticated(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated
|
|
38
|
+
*/
|
|
32
39
|
commit(data: {
|
|
33
40
|
files: string[];
|
|
34
41
|
message?: string;
|
|
@@ -36,15 +43,17 @@ export declare class GitClient {
|
|
|
36
43
|
email?: string;
|
|
37
44
|
}): Promise<Response>;
|
|
38
45
|
/**
|
|
39
|
-
*
|
|
40
46
|
* TODO: Add return type.
|
|
41
47
|
* TODO: Remove `catch`
|
|
48
|
+
*
|
|
49
|
+
* @deprecated
|
|
42
50
|
*/
|
|
43
51
|
push(): Promise<any>;
|
|
44
52
|
/**
|
|
45
|
-
*
|
|
46
53
|
* TODO: Add return type.
|
|
47
54
|
* TODO: Remove `catch`
|
|
55
|
+
*
|
|
56
|
+
* @deprecated
|
|
48
57
|
*/
|
|
49
58
|
writeToDisk(data: {
|
|
50
59
|
fileRelativePath: string;
|
|
@@ -53,6 +62,8 @@ export declare class GitClient {
|
|
|
53
62
|
/**
|
|
54
63
|
* Uploads a File to disk
|
|
55
64
|
* TODO: Remove `catch`
|
|
65
|
+
*
|
|
66
|
+
* @deprecated
|
|
56
67
|
*/
|
|
57
68
|
writeMediaToDisk(data: {
|
|
58
69
|
directory: string;
|
|
@@ -62,31 +73,43 @@ export declare class GitClient {
|
|
|
62
73
|
* TODO: rename `data.relPath` to `data.fileRelativePath`
|
|
63
74
|
* TODO: Add return type.
|
|
64
75
|
* TODO: Remove `catch`
|
|
76
|
+
*
|
|
77
|
+
* @deprecated
|
|
65
78
|
*/
|
|
66
79
|
deleteFromDisk(data: {
|
|
67
80
|
relPath: string;
|
|
68
81
|
}): Promise<any>;
|
|
69
82
|
/**
|
|
70
83
|
* Resets the given files.
|
|
84
|
+
*
|
|
85
|
+
* @deprecated
|
|
71
86
|
*/
|
|
72
87
|
reset(data: {
|
|
73
88
|
files: string[];
|
|
74
89
|
}): Promise<Response>;
|
|
75
90
|
/**
|
|
76
91
|
* Get the contents of a file or directory on disk.
|
|
92
|
+
*
|
|
93
|
+
* @deprecated
|
|
77
94
|
*/
|
|
78
95
|
getFile(fileRelativePath: string): Promise<any>;
|
|
79
96
|
/**
|
|
80
97
|
* Get the contents of a file for the most recent commit.
|
|
98
|
+
*
|
|
99
|
+
* @deprecated
|
|
81
100
|
*/
|
|
82
101
|
show(fileRelativePath: string): Promise<any>;
|
|
83
102
|
/**
|
|
84
103
|
* Get information about a local branch by name, or the current branch if no
|
|
85
104
|
* name is specified.
|
|
105
|
+
*
|
|
106
|
+
* @deprecated
|
|
86
107
|
*/
|
|
87
108
|
branch(name?: string): Promise<any>;
|
|
88
109
|
/**
|
|
89
110
|
* Get a list of the names of all local branches.
|
|
111
|
+
*
|
|
112
|
+
* @deprecated
|
|
90
113
|
*/
|
|
91
114
|
branches(): Promise<any>;
|
|
92
115
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { CMS } from '../core';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated as the API is clunky and hard to use. Mutations should now be
|
|
4
|
+
* done via Graphql. This will be removed by July 2025.
|
|
5
|
+
*/
|
|
2
6
|
export declare class GitFile {
|
|
3
7
|
private cms;
|
|
4
8
|
relativePath: string;
|
|
@@ -7,10 +11,24 @@ export declare class GitFile {
|
|
|
7
11
|
constructor(cms: CMS, relativePath: string, format: (file: any) => string, parse: (content: string) => any);
|
|
8
12
|
/**
|
|
9
13
|
* Load the contents of this file at HEAD
|
|
14
|
+
*
|
|
15
|
+
* @deprecated
|
|
10
16
|
*/
|
|
11
17
|
show: () => Promise<any>;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated
|
|
20
|
+
*/
|
|
12
21
|
commit: () => Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated
|
|
24
|
+
*/
|
|
13
25
|
reset: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated
|
|
28
|
+
*/
|
|
14
29
|
write: (values: any) => void;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated
|
|
32
|
+
*/
|
|
15
33
|
private get git();
|
|
16
34
|
}
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import { MediaStore, MediaUploadOptions, Media, MediaListOptions, MediaList } from '../core';
|
|
2
2
|
import { GitClient } from './git-client';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated as the API is clunky and hard to use. Mutations should now be
|
|
5
|
+
* done via Graphql. This will be removed by July 2025.
|
|
6
|
+
*/
|
|
3
7
|
export declare class GitMediaStore implements MediaStore {
|
|
4
8
|
private client;
|
|
5
9
|
accept: string;
|
|
6
10
|
constructor(client: GitClient);
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated
|
|
13
|
+
*/
|
|
7
14
|
persist(files: MediaUploadOptions[]): Promise<Media[]>;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated
|
|
17
|
+
*/
|
|
8
18
|
list(options?: MediaListOptions): Promise<MediaList>;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated
|
|
21
|
+
*/
|
|
9
22
|
delete(media: Media): Promise<void>;
|
|
10
23
|
}
|
|
11
24
|
export declare const nextOffset: (offset: number, limit: number, count: number) => number;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { GitFile } from './git-file';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated as the API is clunky and hard to use. Mutations should now be
|
|
4
|
+
* done via Graphql. This will be removed by July 2025.
|
|
5
|
+
*/
|
|
2
6
|
export declare function useGitFile(relativePath: string, format: (file: any) => string, parse: (content: string) => any): GitFile;
|
package/dist/toolkit/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type { TinaState } from './tina-state';
|
|
|
19
19
|
export * from './forms';
|
|
20
20
|
export * from './icons';
|
|
21
21
|
export * from './react-dismissible';
|
|
22
|
-
export { Nav, LocalWarning, BillingWarning,
|
|
22
|
+
export { Nav, LocalWarning, BillingWarning, SyncStatusButton, } from './react-sidebar';
|
|
23
23
|
export { useCMS } from './react-core';
|
|
24
24
|
/**
|
|
25
25
|
* Custom `tinacms` things
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { ScreenPlugin } from '../../react-screens';
|
|
3
1
|
import type { CloudConfigPlugin } from '../../react-cloud-config';
|
|
2
|
+
import type { ScreenPlugin } from '../../react-screens';
|
|
3
|
+
import * as React from 'react';
|
|
4
4
|
interface NavCollection {
|
|
5
5
|
label?: string;
|
|
6
6
|
name: string;
|
|
@@ -8,6 +8,8 @@ interface NavCollection {
|
|
|
8
8
|
}
|
|
9
9
|
interface NavProps {
|
|
10
10
|
isLocalMode: boolean;
|
|
11
|
+
showHamburger?: boolean;
|
|
12
|
+
toggleMenu: () => void;
|
|
11
13
|
children?: any;
|
|
12
14
|
className?: string;
|
|
13
15
|
userName?: string;
|
|
@@ -38,5 +40,5 @@ interface NavProps {
|
|
|
38
40
|
};
|
|
39
41
|
}>;
|
|
40
42
|
}
|
|
41
|
-
export declare const Nav: ({ isLocalMode, className, children, showCollections, collectionsInfo, screens, cloudConfigs, contentCreators, sidebarWidth, RenderNavSite, RenderNavCloud, RenderNavCollection, AuthRenderNavCollection, ...props }: NavProps) => React.JSX.Element;
|
|
43
|
+
export declare const Nav: ({ isLocalMode, showHamburger, toggleMenu, className, children, showCollections, collectionsInfo, screens, cloudConfigs, contentCreators, sidebarWidth, RenderNavSite, RenderNavCloud, RenderNavCollection, AuthRenderNavCollection, ...props }: NavProps) => React.JSX.Element;
|
|
42
44
|
export {};
|
|
@@ -4,13 +4,6 @@ export interface FormsViewProps {
|
|
|
4
4
|
loadingPlaceholder?: React.FC;
|
|
5
5
|
}
|
|
6
6
|
export declare const FormsView: ({ loadingPlaceholder }?: FormsViewProps) => React.JSX.Element;
|
|
7
|
-
export interface MultiformFormHeaderProps {
|
|
8
|
-
activeForm: {
|
|
9
|
-
activeFieldName?: string;
|
|
10
|
-
tinaForm: Form;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export declare const MultiformFormHeader: ({ activeForm, }: MultiformFormHeaderProps) => React.JSX.Element;
|
|
14
7
|
export interface FormHeaderProps {
|
|
15
8
|
activeForm: {
|
|
16
9
|
activeFieldName?: string;
|
|
@@ -18,3 +11,6 @@ export interface FormHeaderProps {
|
|
|
18
11
|
};
|
|
19
12
|
}
|
|
20
13
|
export declare const FormHeader: ({ activeForm }: FormHeaderProps) => React.JSX.Element;
|
|
14
|
+
export declare const FormBreadcrumbs: ({ rootBreadcrumbName, ...props }: {
|
|
15
|
+
rootBreadcrumbName?: string;
|
|
16
|
+
} & React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
@@ -3,7 +3,6 @@ import type { SidebarState, SidebarStateOptions } from '../sidebar';
|
|
|
3
3
|
export declare const SidebarContext: React.Context<any>;
|
|
4
4
|
export declare const minPreviewWidth = 440;
|
|
5
5
|
export declare const minSidebarWidth = 360;
|
|
6
|
-
export declare const navBreakpoint = 1279;
|
|
7
6
|
export interface SidebarProviderProps {
|
|
8
7
|
sidebar: SidebarState;
|
|
9
8
|
resizingSidebar: boolean;
|
|
@@ -13,9 +12,3 @@ export interface SidebarProviderProps {
|
|
|
13
12
|
defaultState?: SidebarStateOptions['defaultState'];
|
|
14
13
|
}
|
|
15
14
|
export declare function SidebarProvider({ position, resizingSidebar, setResizingSidebar, defaultWidth, sidebar, }: SidebarProviderProps): React.JSX.Element;
|
|
16
|
-
export declare const updateBodyDisplacement: ({ position, displayState, sidebarWidth, resizingSidebar, }: {
|
|
17
|
-
position?: string;
|
|
18
|
-
displayState: any;
|
|
19
|
-
sidebarWidth: any;
|
|
20
|
-
resizingSidebar: any;
|
|
21
|
-
}) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { TinaCMS } from '../../tina-cms';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
export declare const useGetEvents: (cms: TinaCMS, cursor?: string, existingEvents?: {
|
|
4
4
|
message: string;
|
|
5
5
|
id: string;
|
|
@@ -18,14 +18,11 @@ export declare const useGetEvents: (cms: TinaCMS, cursor?: string, existingEvent
|
|
|
18
18
|
loading: boolean;
|
|
19
19
|
error: Error;
|
|
20
20
|
};
|
|
21
|
-
export declare const SyncErrorWidget: ({ cms }: {
|
|
22
|
-
cms: any;
|
|
23
|
-
}) => React.JSX.Element;
|
|
24
21
|
export declare const SyncStatusModal: ({ closeEventsModal, cms }: {
|
|
25
22
|
closeEventsModal: any;
|
|
26
23
|
cms: any;
|
|
27
24
|
}) => React.JSX.Element;
|
|
28
|
-
export declare const
|
|
29
|
-
cms:
|
|
30
|
-
setEventsOpen:
|
|
31
|
-
}) => React.JSX.Element;
|
|
25
|
+
export declare const SyncStatusButton: ({ cms, setEventsOpen, ...buttonProps }: {
|
|
26
|
+
cms: TinaCMS;
|
|
27
|
+
setEventsOpen: (open: boolean) => void;
|
|
28
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement>) => React.JSX.Element;
|
|
@@ -2,4 +2,4 @@ export * from './sidebar';
|
|
|
2
2
|
export { SidebarProvider } from './components/sidebar';
|
|
3
3
|
export { Nav } from './components/nav';
|
|
4
4
|
export { LocalWarning, BillingWarning } from './components/local-warning';
|
|
5
|
-
export {
|
|
5
|
+
export { SyncStatusButton } from './components/sync-status';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
-
variant?: 'primary' | 'secondary' | 'white' | 'ghost' | 'danger';
|
|
3
|
+
variant?: 'primary' | 'secondary' | 'white' | 'ghost' | 'danger' | 'custom';
|
|
4
4
|
as?: React.ElementType;
|
|
5
5
|
href?: string;
|
|
6
6
|
target?: string;
|
|
7
7
|
size?: 'small' | 'medium' | 'custom';
|
|
8
8
|
busy?: boolean;
|
|
9
|
-
rounded?: 'full' | 'left' | 'right' | 'custom';
|
|
9
|
+
rounded?: 'full' | 'left' | 'right' | 'custom' | 'none';
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
className?: string;
|
|
12
12
|
children?: React.ReactNode;
|
|
@@ -15,6 +15,12 @@ type FormList = {
|
|
|
15
15
|
items: FormListItem[];
|
|
16
16
|
formIds: string[];
|
|
17
17
|
};
|
|
18
|
+
type Breadcrumb = {
|
|
19
|
+
label: string;
|
|
20
|
+
formId: string;
|
|
21
|
+
formName: string;
|
|
22
|
+
namespace: string[];
|
|
23
|
+
};
|
|
18
24
|
export type TinaAction = {
|
|
19
25
|
type: 'forms:add';
|
|
20
26
|
value: Form;
|
|
@@ -63,6 +69,7 @@ export type TinaAction = {
|
|
|
63
69
|
value: boolean;
|
|
64
70
|
};
|
|
65
71
|
export interface TinaState {
|
|
72
|
+
breadcrumbs: Breadcrumb[];
|
|
66
73
|
activeFormId: string | null;
|
|
67
74
|
/**
|
|
68
75
|
* Forms are wrapped here because we need `activeFieldName` to be reactive, so adding it as a propery
|
|
@@ -85,4 +92,8 @@ export interface TinaState {
|
|
|
85
92
|
}
|
|
86
93
|
export declare const initialState: (cms: TinaCMS) => TinaState;
|
|
87
94
|
export declare function tinaReducer(state: TinaState, action: TinaAction): TinaState;
|
|
95
|
+
export declare function calculateBreadcrumbs(forms: {
|
|
96
|
+
activeFieldName?: string | null;
|
|
97
|
+
tinaForm: Form;
|
|
98
|
+
}[], activeFormId: string, activeFieldName?: string): Breadcrumb[];
|
|
88
99
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinacms",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.9",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@radix-ui/react-separator": "^1.1.2",
|
|
75
75
|
"@radix-ui/react-slot": "^1.1.2",
|
|
76
76
|
"@radix-ui/react-toolbar": "^1.1.2",
|
|
77
|
-
"@radix-ui/react-tooltip": "^1.
|
|
77
|
+
"@radix-ui/react-tooltip": "^1.2.6",
|
|
78
78
|
"@react-hook/window-size": "^3.1.1",
|
|
79
79
|
"@udecode/cn": "^33.0.0",
|
|
80
80
|
"@udecode/plate": "^36.5.9",
|
|
@@ -129,9 +129,9 @@
|
|
|
129
129
|
"webfontloader": "1.6.28",
|
|
130
130
|
"yup": "^1.6.1",
|
|
131
131
|
"zod": "^3.24.2",
|
|
132
|
-
"@tinacms/mdx": "1.
|
|
133
|
-
"@tinacms/schema-tools": "1.
|
|
134
|
-
"@tinacms/search": "1.0.
|
|
132
|
+
"@tinacms/mdx": "1.7.0",
|
|
133
|
+
"@tinacms/schema-tools": "1.8.0",
|
|
134
|
+
"@tinacms/search": "1.0.46"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
137
|
"@graphql-tools/utils": "^10.8.1",
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"typescript": "^5.7.3",
|
|
165
165
|
"vite": "^5.4.14",
|
|
166
166
|
"vitest": "^2.1.9",
|
|
167
|
-
"@tinacms/scripts": "1.3.
|
|
167
|
+
"@tinacms/scripts": "1.3.5"
|
|
168
168
|
},
|
|
169
169
|
"peerDependencies": {
|
|
170
170
|
"react": ">=16.14.0",
|
package/dist/client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":["../src/unifiedClient/index.ts","../src/cache/node-cache.ts"],"sourcesContent":["import type { Config } from '@tinacms/schema-tools';\nimport AsyncLock from 'async-lock';\nimport type { GraphQLError } from 'graphql';\nimport type { Cache } from '../cache/index';\n\nexport const TINA_HOST = 'content.tinajs.io';\nexport interface TinaClientArgs<GenQueries = Record<string, unknown>> {\n url: string;\n token?: string;\n queries: (client: TinaClient<GenQueries>) => GenQueries;\n errorPolicy?: Config['client']['errorPolicy'];\n cacheDir?: string;\n}\nexport type TinaClientRequestArgs = {\n variables?: Record<string, any>;\n query: string;\n errorPolicy?: 'throw' | 'include';\n} & Partial<Omit<TinaClientArgs, 'queries'>>;\n\nexport type TinaClientURLParts = {\n host: string;\n clientId: string;\n branch: string;\n isLocalClient: boolean;\n};\n\n/**\n * Replaces the part of a URL after 'github/' with a specified replacement string.\n *\n * @param {string} url The original URL.\n * @param {string} replacement The string to replace the part after 'github/'.\n * @returns {string} The modified URL, or the original URL if 'github/' is not found.\n */\nfunction replaceGithubPathSplit(url: string, replacement: string) {\n const parts = url.split('github/');\n if (parts.length > 1 && replacement) {\n return parts[0] + 'github/' + replacement;\n } else {\n return url;\n }\n}\n\nexport class TinaClient<GenQueries> {\n public apiUrl: string;\n public readonlyToken?: string;\n public queries: GenQueries;\n public errorPolicy: Config['client']['errorPolicy'];\n initialized = false;\n cacheLock: AsyncLock | undefined;\n cacheDir: string;\n cache: Cache;\n\n constructor({\n token,\n url,\n queries,\n errorPolicy,\n cacheDir,\n }: TinaClientArgs<GenQueries>) {\n this.apiUrl = url;\n this.readonlyToken = token?.trim();\n this.queries = queries(this);\n this.errorPolicy = errorPolicy || 'throw';\n this.cacheDir = cacheDir || '';\n }\n\n async init() {\n if (this.initialized) {\n return;\n }\n try {\n if (\n this.cacheDir &&\n typeof window === 'undefined' &&\n typeof require !== 'undefined'\n ) {\n const { NodeCache } = await import('../cache/node-cache');\n this.cache = await NodeCache(this.cacheDir);\n this.cacheLock = new AsyncLock();\n }\n } catch (e) {\n console.error(e);\n }\n this.initialized = true;\n }\n\n public async request<DataType extends Record<string, any> = any>(\n { errorPolicy, ...args }: TinaClientRequestArgs,\n options: { fetchOptions?: Parameters<typeof fetch>[1] }\n ) {\n await this.init();\n const errorPolicyDefined = errorPolicy || this.errorPolicy;\n const headers = new Headers();\n if (this.readonlyToken) {\n headers.append('X-API-KEY', this.readonlyToken);\n }\n headers.append('Content-Type', 'application/json');\n if (options?.fetchOptions) {\n if (options?.fetchOptions?.headers) {\n Object.entries(options.fetchOptions.headers).forEach(([key, value]) => {\n headers.append(key, value);\n });\n }\n }\n const { headers: _, ...providedFetchOptions } = options?.fetchOptions || {};\n\n const bodyString = JSON.stringify({\n query: args.query,\n variables: args?.variables || {},\n });\n\n const optionsObject: Parameters<typeof fetch>[1] = {\n method: 'POST',\n headers,\n body: bodyString,\n redirect: 'follow',\n ...providedFetchOptions,\n };\n\n // Look for the header and change to use this branch instead of the build time generated branch.\n // This comes from the clients fetch options:\n //client.queries.collection({}, {\n // fetchOptions: {\n // headers: {\n // 'x-branch': cookieStore.get('x-branch')?.value,\n // },\n // },\n //})\n const draftBranch = headers.get('x-branch');\n const url = replaceGithubPathSplit(args?.url || this.apiUrl, draftBranch);\n\n let key = '';\n let result: {\n data: DataType;\n errors: GraphQLError[] | null;\n query: string;\n };\n if (this.cache) {\n key = this.cache.makeKey(bodyString);\n await this.cacheLock.acquire(key, async () => {\n result = await this.cache.get(key);\n if (!result) {\n result = await requestFromServer<DataType>(\n url,\n args.query,\n optionsObject,\n errorPolicyDefined\n );\n await this.cache.set(key, result);\n }\n });\n } else {\n result = await requestFromServer<DataType>(\n url,\n args.query,\n optionsObject,\n errorPolicyDefined\n );\n }\n\n return result;\n }\n}\n\nasync function requestFromServer<DataType extends Record<string, any> = any>(\n url: string,\n query: string,\n optionsObject: RequestInit,\n errorPolicyDefined: 'throw' | 'include'\n) {\n const res = await fetch(url, optionsObject);\n if (!res.ok) {\n let additionalInfo = '';\n if (res.status === 401) {\n additionalInfo =\n 'Please check that your client ID, URL and read only token are configured properly.';\n }\n\n throw new Error(\n `Server responded with status code ${res.status}, ${res.statusText}. ${\n additionalInfo ? additionalInfo : ''\n } Please see our FAQ for more information: https://tina.io/docs/errors/faq/`\n );\n }\n const json = await res.json();\n if (json.errors && errorPolicyDefined === 'throw') {\n throw new Error(\n `Unable to fetch, please see our FAQ for more information: https://tina.io/docs/errors/faq/\n Errors: \\n\\t${json.errors.map((error) => error.message).join('\\n')}`\n );\n }\n const result = {\n data: json?.data as DataType,\n errors: (json?.errors || null) as GraphQLError[] | null,\n query,\n };\n return result;\n}\n\nexport function createClient<GenQueries>(args: TinaClientArgs<GenQueries>) {\n const client = new TinaClient<ReturnType<typeof args.queries>>(args);\n return client;\n}\n","import type { Cache } from './index';\n\n// Create the cache directory if it doesn't exist.\n// Returns the path of the cache directory.\nexport const makeCacheDir = async (\n dir: string,\n fs: any,\n path: any,\n os: any\n) => {\n const pathParts = dir.split(path.sep).filter(Boolean);\n const cacheHash = pathParts[pathParts.length - 1];\n const rootUser = pathParts[0];\n let cacheDir = dir;\n\n // Check if the root directory exists. If not, create the cache in the tmp directory.\n if (!fs.existsSync(path.join(path.sep, rootUser))) {\n cacheDir = path.join(os.tmpdir(), cacheHash);\n }\n\n try {\n fs.mkdirSync(cacheDir, { recursive: true });\n } catch (error) {\n throw new Error(`Failed to create cache directory: ${error.message}`);\n }\n\n return cacheDir;\n};\n\nexport const NodeCache = async (dir: string): Promise<Cache> => {\n // TODO: These will need to be changed from using require to import when we eventually move to ESM\n const fs = require('node:fs');\n const path = require('node:path');\n const os = require('node:os');\n\n const { createHash } = require('node:crypto');\n const cacheDir = await makeCacheDir(dir, fs, path, os);\n\n return {\n makeKey: (key: any) => {\n const input =\n key && key instanceof Object ? JSON.stringify(key) : key || '';\n return createHash('sha256').update(input).digest('hex');\n },\n get: async (key: string) => {\n let readValue: object | undefined;\n\n const cacheFilename = `${cacheDir}/${key}`;\n try {\n const data = await fs.promises.readFile(cacheFilename, 'utf-8');\n readValue = JSON.parse(data);\n } catch (e) {\n if (e.code !== 'ENOENT') {\n console.error(\n `Failed to read cache file to ${cacheFilename}: ${e.message}`\n );\n }\n }\n\n return readValue;\n },\n set: async (key: string, value: any) => {\n const cacheFilename = `${cacheDir}/${key}`;\n try {\n await fs.promises.writeFile(cacheFilename, JSON.stringify(value), {\n encoding: 'utf-8',\n flag: 'wx', // Don't overwrite existing caches\n });\n } catch (e) {\n if (e.code !== 'EEXIST') {\n console.error(\n `Failed to write cache file to ${cacheFilename}: ${e.message}`\n );\n }\n }\n },\n };\n};\n"],"names":["NodeCache","key"],"mappings":";;;;AAKa,QAAA,YAAY;AA4BzB,WAAS,uBAAuB,KAAa,aAAqB;AAC1D,UAAA,QAAQ,IAAI,MAAM,SAAS;AAC7B,QAAA,MAAM,SAAS,KAAK,aAAa;AAC5B,aAAA,MAAM,CAAC,IAAI,YAAY;AAAA,IAAA,OACzB;AACE,aAAA;AAAA,IACT;AAAA,EACF;AAAA,EAEO,MAAM,WAAuB;AAAA,IAUlC,YAAY;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,GAC6B;AAXjB,WAAA,cAAA;AAYZ,WAAK,SAAS;AACT,WAAA,gBAAgB,+BAAO;AACvB,WAAA,UAAU,QAAQ,IAAI;AAC3B,WAAK,cAAc,eAAe;AAClC,WAAK,WAAW,YAAY;AAAA,IAC9B;AAAA,IAEA,MAAM,OAAO;AACX,UAAI,KAAK,aAAa;AACpB;AAAA,MACF;AACI,UAAA;AACF,YACE,KAAK,YACL,OAAO,WAAW,eAClB,OAAO,YAAY,aACnB;AACA,gBAAM,EAAE,WAAAA,eAAc,MAAM;AAC5B,eAAK,QAAQ,MAAMA,WAAU,KAAK,QAAQ;AACrC,eAAA,YAAY,IAAI;QACvB;AAAA,eACO,GAAG;AACV,gBAAQ,MAAM,CAAC;AAAA,MACjB;AACA,WAAK,cAAc;AAAA,IACrB;AAAA,IAEA,MAAa,QACX,EAAE,aAAa,GAAG,KAAA,GAClB,SACA;;AACA,YAAM,KAAK;AACL,YAAA,qBAAqB,eAAe,KAAK;AACzC,YAAA,UAAU,IAAI;AACpB,UAAI,KAAK,eAAe;AACd,gBAAA,OAAO,aAAa,KAAK,aAAa;AAAA,MAChD;AACQ,cAA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AS;AAE5B,UAAM,EAAE,WAAA,IAAe,QAAQ,aAAa;AAC5C,UAAM,WAAW,MAAM,aAAa,KAAK,IAAI,MAAM,EAAE;AAE9C,WAAA;AAAA,MACL,SAAS,CAAC,QAAa;AACf,cAAA,QACJ,OAAO,eAAe,SAAS,KAAK,UAAU,GAAG,IAAI,OAAO;AAC9D,eAAO,WAAW,QAAQ,EAAE,OAAO,KAAK,EAAE,OAAO,KAAK;AAAA,MACxD;AAAA,MACA,KAAK,OAAO,QAAgB;AACtB,YAAA;AAEJ,cAAM,gBAAgB,GAAG,QAAQ,IAAI,GAAG;AACpC,YAAA;AACF,gBAAM,OAAO,MAAM,GAAG,SAAS,SAAS,eAAe,OAAO;AAClD,sBAAA,KAAK,MAAM,IAAI;AAAA,iBACpB,GAAG;AACN,cAAA,EAAE,SAAS,UAAU;AACf,oBAAA;AAAA,cACN,gCAAgC,aAAa,KAAK,EAAE,OAAO;AAAA,YAAA;AAAA,UAE/D;AAAA,QACF;AAEO,eAAA;AAAA,MACT;AAAA,MACA,KAAK,OAAO,KAAa,UAAe;AACtC,cAAM,gBAAgB,GAAG,QAAQ,IAAI,GAAG;AACpC,YAAA;AACF,gBAAM,GAAG,SAAS,UAAU,eAAe,KAAK,UAAU,KAAK,GAAG;AAAA,YAChE,UAAU;AAAA,YACV,MAAM;AAAA;AAAA,UAAA,CACP;AAAA,iBACM,GAAG;AACN,cAAA,EAAE,SAAS,UAAU;AACf,oBAAA;AAAA,cACN,iCAAiC,aAAa,KAAK,EAAE,OAAO;AAAA,YAAA;AAAA,UAEhE;AAAA,QACF;AAAA,MACF;AAAA,IAAA;AAAA,EAEJ;;;;;;;;;;;"}
|
package/dist/client.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.mjs","sources":["../src/unifiedClient/index.ts"],"sourcesContent":["import type { Config } from '@tinacms/schema-tools';\nimport AsyncLock from 'async-lock';\nimport type { GraphQLError } from 'graphql';\nimport type { Cache } from '../cache/index';\n\nexport const TINA_HOST = 'content.tinajs.io';\nexport interface TinaClientArgs<GenQueries = Record<string, unknown>> {\n url: string;\n token?: string;\n queries: (client: TinaClient<GenQueries>) => GenQueries;\n errorPolicy?: Config['client']['errorPolicy'];\n cacheDir?: string;\n}\nexport type TinaClientRequestArgs = {\n variables?: Record<string, any>;\n query: string;\n errorPolicy?: 'throw' | 'include';\n} & Partial<Omit<TinaClientArgs, 'queries'>>;\n\nexport type TinaClientURLParts = {\n host: string;\n clientId: string;\n branch: string;\n isLocalClient: boolean;\n};\n\n/**\n * Replaces the part of a URL after 'github/' with a specified replacement string.\n *\n * @param {string} url The original URL.\n * @param {string} replacement The string to replace the part after 'github/'.\n * @returns {string} The modified URL, or the original URL if 'github/' is not found.\n */\nfunction replaceGithubPathSplit(url: string, replacement: string) {\n const parts = url.split('github/');\n if (parts.length > 1 && replacement) {\n return parts[0] + 'github/' + replacement;\n } else {\n return url;\n }\n}\n\nexport class TinaClient<GenQueries> {\n public apiUrl: string;\n public readonlyToken?: string;\n public queries: GenQueries;\n public errorPolicy: Config['client']['errorPolicy'];\n initialized = false;\n cacheLock: AsyncLock | undefined;\n cacheDir: string;\n cache: Cache;\n\n constructor({\n token,\n url,\n queries,\n errorPolicy,\n cacheDir,\n }: TinaClientArgs<GenQueries>) {\n this.apiUrl = url;\n this.readonlyToken = token?.trim();\n this.queries = queries(this);\n this.errorPolicy = errorPolicy || 'throw';\n this.cacheDir = cacheDir || '';\n }\n\n async init() {\n if (this.initialized) {\n return;\n }\n try {\n if (\n this.cacheDir &&\n typeof window === 'undefined' &&\n typeof require !== 'undefined'\n ) {\n const { NodeCache } = await import('../cache/node-cache');\n this.cache = await NodeCache(this.cacheDir);\n this.cacheLock = new AsyncLock();\n }\n } catch (e) {\n console.error(e);\n }\n this.initialized = true;\n }\n\n public async request<DataType extends Record<string, any> = any>(\n { errorPolicy, ...args }: TinaClientRequestArgs,\n options: { fetchOptions?: Parameters<typeof fetch>[1] }\n ) {\n await this.init();\n const errorPolicyDefined = errorPolicy || this.errorPolicy;\n const headers = new Headers();\n if (this.readonlyToken) {\n headers.append('X-API-KEY', this.readonlyToken);\n }\n headers.append('Content-Type', 'application/json');\n if (options?.fetchOptions) {\n if (options?.fetchOptions?.headers) {\n Object.entries(options.fetchOptions.headers).forEach(([key, value]) => {\n headers.append(key, value);\n });\n }\n }\n const { headers: _, ...providedFetchOptions } = options?.fetchOptions || {};\n\n const bodyString = JSON.stringify({\n query: args.query,\n variables: args?.variables || {},\n });\n\n const optionsObject: Parameters<typeof fetch>[1] = {\n method: 'POST',\n headers,\n body: bodyString,\n redirect: 'follow',\n ...providedFetchOptions,\n };\n\n // Look for the header and change to use this branch instead of the build time generated branch.\n // This comes from the clients fetch options:\n //client.queries.collection({}, {\n // fetchOptions: {\n // headers: {\n // 'x-branch': cookieStore.get('x-branch')?.value,\n // },\n // },\n //})\n const draftBranch = headers.get('x-branch');\n const url = replaceGithubPathSplit(args?.url || this.apiUrl, draftBranch);\n\n let key = '';\n let result: {\n data: DataType;\n errors: GraphQLError[] | null;\n query: string;\n };\n if (this.cache) {\n key = this.cache.makeKey(bodyString);\n await this.cacheLock.acquire(key, async () => {\n result = await this.cache.get(key);\n if (!result) {\n result = await requestFromServer<DataType>(\n url,\n args.query,\n optionsObject,\n errorPolicyDefined\n );\n await this.cache.set(key, result);\n }\n });\n } else {\n result = await requestFromServer<DataType>(\n url,\n args.query,\n optionsObject,\n errorPolicyDefined\n );\n }\n\n return result;\n }\n}\n\nasync function requestFromServer<DataType extends Record<string, any> = any>(\n url: string,\n query: string,\n optionsObject: RequestInit,\n errorPolicyDefined: 'throw' | 'include'\n) {\n const res = await fetch(url, optionsObject);\n if (!res.ok) {\n let additionalInfo = '';\n if (res.status === 401) {\n additionalInfo =\n 'Please check that your client ID, URL and read only token are configured properly.';\n }\n\n throw new Error(\n `Server responded with status code ${res.status}, ${res.statusText}. ${\n additionalInfo ? additionalInfo : ''\n } Please see our FAQ for more information: https://tina.io/docs/errors/faq/`\n );\n }\n const json = await res.json();\n if (json.errors && errorPolicyDefined === 'throw') {\n throw new Error(\n `Unable to fetch, please see our FAQ for more information: https://tina.io/docs/errors/faq/\n Errors: \\n\\t${json.errors.map((error) => error.message).join('\\n')}`\n );\n }\n const result = {\n data: json?.data as DataType,\n errors: (json?.errors || null) as GraphQLError[] | null,\n query,\n };\n return result;\n}\n\nexport function createClient<GenQueries>(args: TinaClientArgs<GenQueries>) {\n const client = new TinaClient<ReturnType<typeof args.queries>>(args);\n return client;\n}\n"],"names":["key"],"mappings":";AAKO,MAAM,YAAY;AA4BzB,SAAS,uBAAuB,KAAa,aAAqB;AAC1D,QAAA,QAAQ,IAAI,MAAM,SAAS;AAC7B,MAAA,MAAM,SAAS,KAAK,aAAa;AAC5B,WAAA,MAAM,CAAC,IAAI,YAAY;AAAA,EAAA,OACzB;AACE,WAAA;AAAA,EACT;AACF;AAEO,MAAM,WAAuB;AAAA,EAUlC,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,GAC6B;AAXjB,SAAA,cAAA;AAYZ,SAAK,SAAS;AACT,SAAA,gBAAgB,+BAAO;AACvB,SAAA,UAAU,QAAQ,IAAI;AAC3B,SAAK,cAAc,eAAe;AAClC,SAAK,WAAW,YAAY;AAAA,EAC9B;AAAA,EAEA,MAAM,OAAO;AACX,QAAI,KAAK,aAAa;AACpB;AAAA,IACF;AACI,QAAA;AACF,UACE,KAAK,YACL,OAAO,WAAW,eAClB,OAAO,YAAY,aACnB;AACA,cAAM,EAAE,UAAA,IAAc,MAAM,OAAO,2BAAqB;AACxD,aAAK,QAAQ,MAAM,UAAU,KAAK,QAAQ;AACrC,aAAA,YAAY,IAAI;MACvB;AAAA,aACO,GAAG;AACV,cAAQ,MAAM,CAAC;AAAA,IACjB;AACA,SAAK,cAAc;AAAA,EACrB;AAAA,EAEA,MAAa,QACX,EAAE,aAAa,GAAG,KAAA,GAClB,SACA;;AACA,UA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