@tinacms/graphql 0.0.0-00d7b85-20251222014449
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/LICENSE +176 -0
- package/README.md +144 -0
- package/dist/ast-builder/index.d.ts +179 -0
- package/dist/auth/utils.d.ts +22 -0
- package/dist/build.d.ts +16 -0
- package/dist/builder/index.d.ts +268 -0
- package/dist/builder/static-definitions.d.ts +4 -0
- package/dist/database/alias-utils.d.ts +3 -0
- package/dist/database/bridge/filesystem.d.ts +21 -0
- package/dist/database/bridge/index.d.ts +12 -0
- package/dist/database/bridge/isomorphic.d.ts +94 -0
- package/dist/database/datalayer.d.ts +80 -0
- package/dist/database/index.d.ts +203 -0
- package/dist/database/level.d.ts +28 -0
- package/dist/database/util.d.ts +33 -0
- package/dist/error.d.ts +4 -0
- package/dist/git/index.d.ts +23 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +8216 -0
- package/dist/level/tinaLevel.d.ts +7 -0
- package/dist/mdx/index.d.ts +3 -0
- package/dist/resolve.d.ts +21 -0
- package/dist/resolver/auth-fields.d.ts +31 -0
- package/dist/resolver/error.d.ts +39 -0
- package/dist/resolver/filter-utils.d.ts +13 -0
- package/dist/resolver/index.d.ts +387 -0
- package/dist/resolver/media-utils.d.ts +21 -0
- package/dist/schema/createSchema.d.ts +5 -0
- package/dist/schema/validate.d.ts +8 -0
- package/dist/sdkBuilder/index.d.ts +5 -0
- package/dist/spec/setup.d.ts +32 -0
- package/dist/types.d.ts +10 -0
- package/dist/util.d.ts +21 -0
- package/package.json +84 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
|
|
3
|
+
*/
|
|
4
|
+
import { AbstractLevel, AbstractSublevel, AbstractSublevelOptions } from 'abstract-level';
|
|
5
|
+
export type Level = AbstractLevel<Buffer | Uint8Array | string, string, Record<string, any>>;
|
|
6
|
+
export type PutOp = {
|
|
7
|
+
type: 'put';
|
|
8
|
+
key: string;
|
|
9
|
+
value: Record<string, any>;
|
|
10
|
+
sublevel?: AbstractSublevel<Level, Buffer | Uint8Array | string, string, Record<string, any>>;
|
|
11
|
+
};
|
|
12
|
+
export type DelOp = {
|
|
13
|
+
type: 'del';
|
|
14
|
+
key: string;
|
|
15
|
+
sublevel?: AbstractSublevel<Level, Buffer | Uint8Array | string, string, Record<string, Record<string, any>>>;
|
|
16
|
+
};
|
|
17
|
+
export type BatchOp = PutOp | DelOp;
|
|
18
|
+
export declare const ARRAY_ITEM_VALUE_SEPARATOR = ",";
|
|
19
|
+
export declare const INDEX_KEY_FIELD_SEPARATOR = "\u001D";
|
|
20
|
+
export declare const CONTENT_ROOT_PREFIX = "~";
|
|
21
|
+
export declare const SUBLEVEL_OPTIONS: AbstractSublevelOptions<string, Record<string, any>>;
|
|
22
|
+
export declare class LevelWrapper {
|
|
23
|
+
private level;
|
|
24
|
+
constructor(level: Level);
|
|
25
|
+
}
|
|
26
|
+
export declare class LevelProxy {
|
|
27
|
+
constructor(level: Level);
|
|
28
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Collection, CollectionTemplateable, TinaSchema, normalizePath } from '@tinacms/schema-tools';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
import { ContentFormat, ContentFrontmatterFormat } from '@tinacms/schema-tools';
|
|
4
|
+
import { Bridge } from './bridge';
|
|
5
|
+
export { normalizePath };
|
|
6
|
+
export declare const stringifyFile: (content: object, format: ContentFormat | string, // FIXME
|
|
7
|
+
/** For non-polymorphic documents we don't need the template key */
|
|
8
|
+
keepTemplateKey: boolean, markdownParseConfig?: {
|
|
9
|
+
frontmatterFormat?: ContentFrontmatterFormat;
|
|
10
|
+
frontmatterDelimiters?: [string, string] | string;
|
|
11
|
+
}) => string;
|
|
12
|
+
export declare const parseFile: <T extends object>(content: string, format: ContentFormat | string, // FIXME
|
|
13
|
+
yupSchema: (args: typeof yup) => yup.ObjectSchema<any>, markdownParseConfig?: {
|
|
14
|
+
frontmatterFormat?: ContentFrontmatterFormat;
|
|
15
|
+
frontmatterDelimiters?: [string, string] | string;
|
|
16
|
+
}) => T;
|
|
17
|
+
export declare const atob: (b64Encoded: string) => string;
|
|
18
|
+
export declare const btoa: (string: string) => string;
|
|
19
|
+
export declare const scanAllContent: (tinaSchema: TinaSchema, bridge: Bridge, callback: (collection: Collection<true>, contentPaths: string[]) => Promise<void>) => Promise<string[]>;
|
|
20
|
+
export declare const scanContentByPaths: (tinaSchema: TinaSchema, documentPaths: string[], callback: (collection: Collection<true> | undefined, documentPaths: string[]) => Promise<void>) => Promise<void>;
|
|
21
|
+
export declare const partitionPathsByCollection: (tinaSchema: TinaSchema, documentPaths: string[]) => Promise<{
|
|
22
|
+
pathsByCollection: Record<string, string[]>;
|
|
23
|
+
nonCollectionPaths: string[];
|
|
24
|
+
collections: Record<string, Collection<true>>;
|
|
25
|
+
}>;
|
|
26
|
+
/** TODO help needed with name of this function **/
|
|
27
|
+
export declare const transformDocument: <T extends object>(filepath: string, contentObject: any, tinaSchema: TinaSchema) => T;
|
|
28
|
+
export declare function hasOwnProperty<X extends {}, Y extends PropertyKey>(obj: X, prop: Y): obj is X & Record<Y, unknown>;
|
|
29
|
+
export declare const getTemplateForFile: (templateInfo: CollectionTemplateable, data: {
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}) => import("@tinacms/schema-tools").Template<true>;
|
|
32
|
+
/** TODO help needed with name of this function **/
|
|
33
|
+
export declare const loadAndParseWithAliases: (bridge: Bridge, filepath: string, collection?: Collection<true>, templateInfo?: CollectionTemplateable) => Promise<object>;
|
package/dist/error.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ASTNode, GraphQLError, GraphQLErrorExtensions, Source } from 'graphql';
|
|
2
|
+
export declare class NotFoundError extends GraphQLError {
|
|
3
|
+
constructor(message: string, nodes?: ASTNode | readonly ASTNode[], source?: Source, positions?: readonly number[], path?: readonly (string | number)[], originalError?: Error, extensions?: GraphQLErrorExtensions);
|
|
4
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CallbackFsClient, PromiseFsClient } from 'isomorphic-git';
|
|
2
|
+
export declare const getSha: ({ fs, dir, }: {
|
|
3
|
+
fs: CallbackFsClient | PromiseFsClient;
|
|
4
|
+
dir: string;
|
|
5
|
+
}) => Promise<string>;
|
|
6
|
+
export declare const getChangedFiles: ({ fs, dir, from, to, pathFilter, }: {
|
|
7
|
+
fs: CallbackFsClient | PromiseFsClient;
|
|
8
|
+
dir: string;
|
|
9
|
+
from: string;
|
|
10
|
+
to: string;
|
|
11
|
+
pathFilter: Record<string, {
|
|
12
|
+
matches?: string[];
|
|
13
|
+
}>;
|
|
14
|
+
}) => Promise<{
|
|
15
|
+
added: any[];
|
|
16
|
+
modified: any[];
|
|
17
|
+
deleted: any[];
|
|
18
|
+
}>;
|
|
19
|
+
export declare const shaExists: ({ fs, dir, sha, }: {
|
|
20
|
+
fs: CallbackFsClient | PromiseFsClient;
|
|
21
|
+
dir: string;
|
|
22
|
+
sha: string;
|
|
23
|
+
}) => Promise<boolean>;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Schema, Collection, Template as TinaTemplate } from '@tinacms/schema-tools';
|
|
2
|
+
import { buildDotTinaFiles } from './build';
|
|
3
|
+
export { resolve } from './resolve';
|
|
4
|
+
export { transformDocumentIntoPayload } from './resolver';
|
|
5
|
+
export * from './resolver/error';
|
|
6
|
+
export { TinaLevelClient } from './level/tinaLevel';
|
|
7
|
+
export type { Level } from './database/level';
|
|
8
|
+
export type { QueryOptions, OnDeleteCallback, OnPutCallback, DatabaseArgs, GitProvider, CreateDatabase, } from './database';
|
|
9
|
+
export { Database, createDatabaseInternal, createDatabase, createLocalDatabase, } from './database';
|
|
10
|
+
import type { Config } from '@tinacms/schema-tools';
|
|
11
|
+
export { getChangedFiles, getSha, shaExists } from './git';
|
|
12
|
+
export * from './auth/utils';
|
|
13
|
+
export { sequential, assertShape } from './util';
|
|
14
|
+
export { loadAndParseWithAliases, stringifyFile, parseFile, scanAllContent, scanContentByPaths, transformDocument, } from './database/util';
|
|
15
|
+
export { createSchema } from './schema/createSchema';
|
|
16
|
+
export { buildDotTinaFiles };
|
|
17
|
+
export type DummyType = unknown;
|
|
18
|
+
export declare const buildSchema: (config: Config, flags?: string[]) => Promise<{
|
|
19
|
+
graphQLSchema: import("graphql").DocumentNode;
|
|
20
|
+
tinaSchema: import("@tinacms/schema-tools").TinaSchema;
|
|
21
|
+
lookup: Record<string, import("./database").LookupMapType>;
|
|
22
|
+
fragDoc: string;
|
|
23
|
+
queryDoc: string;
|
|
24
|
+
}>;
|
|
25
|
+
export type TinaSchema = Schema;
|
|
26
|
+
export type { TinaTemplate, Schema, Collection };
|
|
27
|
+
export { FilesystemBridge, AuditFileSystemBridge, } from './database/bridge/filesystem';
|
|
28
|
+
export { IsomorphicBridge } from './database/bridge/isomorphic';
|
|
29
|
+
export type { Bridge } from './database/bridge';
|