@tinacms/graphql 0.59.2 → 0.59.3
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/CHANGELOG.md +11 -0
- package/dist/index.d.ts +4 -19
- package/dist/index.js +109 -551
- package/package.json +2 -7
- package/dist/database/bridge/filesystem.d.ts +0 -27
- package/dist/database/bridge/github.d.ts +0 -33
- package/dist/database/store/filesystem.d.ts +0 -28
- package/dist/database/store/github.d.ts +0 -37
- package/dist/database/store/level.d.ts +0 -29
- package/dist/database/store/memory.d.ts +0 -33
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# tina-graphql
|
|
2
2
|
|
|
3
|
+
## 0.59.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 34cd3a44a: Fix issue where frontmatter parser would return a Date object which would be cast to epoch format
|
|
8
|
+
- b006a5ab9: Added delete button to image field
|
|
9
|
+
- a324b9c37: Export utilities for working with the data layer
|
|
10
|
+
- 80732bd97: Create a @tinacms/datalayer package which houses the logic for data management for the GraphQL API. This simplifies the @tinacms/graphql package and allows for a clearer separation.
|
|
11
|
+
- 0bec208e2: validate the schema for `path` and `matches`
|
|
12
|
+
- 5c070a83f: feat: Add UI banner for when in localMode
|
|
13
|
+
|
|
3
14
|
## 0.59.2
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -13,28 +13,13 @@ limitations under the License.
|
|
|
13
13
|
export { indexDB } from './build';
|
|
14
14
|
export { resolve } from './resolve';
|
|
15
15
|
export { createDatabase } from './database';
|
|
16
|
-
export { GithubBridge } from './database/bridge/github';
|
|
17
|
-
export { GithubStore } from './database/store/github';
|
|
18
|
-
export { FilesystemBridge } from './database/bridge/filesystem';
|
|
19
|
-
export { FilesystemStore } from './database/store/filesystem';
|
|
20
|
-
export { MemoryStore } from './database/store/memory';
|
|
21
|
-
export { LevelStore } from './database/store/level';
|
|
22
|
-
export type { GithubManagerInit } from './database/bridge/github';
|
|
23
16
|
import type { Database } from './database';
|
|
17
|
+
export type { Store } from './database/store';
|
|
18
|
+
export type { Bridge } from './database/bridge';
|
|
19
|
+
export { stringifyFile, parseFile } from './database/util';
|
|
20
|
+
export { sequential } from './util';
|
|
24
21
|
export declare const buildSchema: (rootPath: string, database: Database) => Promise<import("graphql").GraphQLSchema>;
|
|
25
22
|
import type { TinaCloudSchema as TinaCloudSchemaBase, TinaCloudCollection as TinaCloudCollectionBase, TinaCloudTemplateBase as TinaTemplate, TinaFieldBase } from './types';
|
|
26
|
-
export declare const listBranches: ({ auth, owner, repo }: {
|
|
27
|
-
auth: any;
|
|
28
|
-
owner: any;
|
|
29
|
-
repo: any;
|
|
30
|
-
}) => Promise<import("@octokit/types").OctokitResponse<import("@octokit/types").ReposListBranchesResponseData>>;
|
|
31
|
-
export declare const createBranch: ({ auth, owner, repo, name, baseBranch }: {
|
|
32
|
-
auth: any;
|
|
33
|
-
owner: any;
|
|
34
|
-
repo: any;
|
|
35
|
-
name: any;
|
|
36
|
-
baseBranch: any;
|
|
37
|
-
}) => Promise<import("@octokit/types").OctokitResponse<import("@octokit/types").GitCreateRefResponseData>>;
|
|
38
23
|
export declare type TinaCloudSchema = TinaCloudSchemaBase<false>;
|
|
39
24
|
export declare type TinaSchema = TinaCloudSchema;
|
|
40
25
|
export declare type TinaCloudCollection = TinaCloudCollectionBase<false>;
|
package/dist/index.js
CHANGED
|
@@ -10032,8 +10032,8 @@ var require_to_markdown = __commonJS({
|
|
|
10032
10032
|
var require_core = __commonJS({
|
|
10033
10033
|
"pnp:/Users/jeffsee/code/tinacms/.yarn/cache/stringify-entities-npm-3.1.0-78dc656761-4d33442e56.zip/node_modules/stringify-entities/lib/core.js"(exports, module2) {
|
|
10034
10034
|
"use strict";
|
|
10035
|
-
module2.exports =
|
|
10036
|
-
function
|
|
10035
|
+
module2.exports = encode;
|
|
10036
|
+
function encode(value, options) {
|
|
10037
10037
|
value = value.replace(options.subset ? charactersToExpression2(options.subset) : /["&'<>`]/g, basic);
|
|
10038
10038
|
if (options.subset || options.escapeOnly) {
|
|
10039
10039
|
return value;
|
|
@@ -10239,12 +10239,12 @@ var require_to_markdown2 = __commonJS({
|
|
|
10239
10239
|
exports.fences = true;
|
|
10240
10240
|
exports.resourceLink = true;
|
|
10241
10241
|
mdxElement2.peek = peekElement2;
|
|
10242
|
-
var
|
|
10242
|
+
var encode = require_light();
|
|
10243
10243
|
var flow3 = require_container_flow();
|
|
10244
10244
|
var phrasing = require_container_phrasing();
|
|
10245
10245
|
var checkQuote2 = require_check_quote();
|
|
10246
10246
|
var eol2 = /\r?\n|\r/g;
|
|
10247
|
-
function mdxElement2(node,
|
|
10247
|
+
function mdxElement2(node, _6, context) {
|
|
10248
10248
|
var selfClosing = node.name && (!node.children || !node.children.length);
|
|
10249
10249
|
var quote = checkQuote2(context);
|
|
10250
10250
|
var exit2 = context.enter(node.type);
|
|
@@ -10265,7 +10265,7 @@ var require_to_markdown2 = __commonJS({
|
|
|
10265
10265
|
if (!attribute.name) {
|
|
10266
10266
|
throw new Error("Cannot serialize attribute w/o name");
|
|
10267
10267
|
}
|
|
10268
|
-
result = attribute.name + (attribute.value == null ? "" : "=" + (typeof attribute.value === "object" ? "{" + (attribute.value.value || "") + "}" : quote +
|
|
10268
|
+
result = attribute.name + (attribute.value == null ? "" : "=" + (typeof attribute.value === "object" ? "{" + (attribute.value.value || "") + "}" : quote + encode(attribute.value, { subset: [quote] }) + quote));
|
|
10269
10269
|
}
|
|
10270
10270
|
attributes.push(result);
|
|
10271
10271
|
}
|
|
@@ -10384,22 +10384,17 @@ var require_remark_mdx = __commonJS({
|
|
|
10384
10384
|
|
|
10385
10385
|
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/index.ts
|
|
10386
10386
|
__export(exports, {
|
|
10387
|
-
FilesystemBridge: () => FilesystemBridge,
|
|
10388
|
-
FilesystemStore: () => FilesystemStore,
|
|
10389
|
-
GithubBridge: () => GithubBridge,
|
|
10390
|
-
GithubStore: () => GithubStore,
|
|
10391
|
-
LevelStore: () => LevelStore,
|
|
10392
|
-
MemoryStore: () => MemoryStore,
|
|
10393
10387
|
buildSchema: () => buildSchema,
|
|
10394
|
-
createBranch: () => createBranch,
|
|
10395
10388
|
createDatabase: () => createDatabase,
|
|
10396
10389
|
indexDB: () => indexDB,
|
|
10397
|
-
|
|
10398
|
-
resolve: () => resolve
|
|
10390
|
+
parseFile: () => parseFile,
|
|
10391
|
+
resolve: () => resolve,
|
|
10392
|
+
sequential: () => sequential,
|
|
10393
|
+
stringifyFile: () => stringifyFile
|
|
10399
10394
|
});
|
|
10400
|
-
var
|
|
10401
|
-
var
|
|
10402
|
-
var
|
|
10395
|
+
var import_fs_extra2 = __toModule(require("fs-extra"));
|
|
10396
|
+
var import_path5 = __toModule(require("path"));
|
|
10397
|
+
var import_graphql5 = __toModule(require("graphql"));
|
|
10403
10398
|
|
|
10404
10399
|
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/build.ts
|
|
10405
10400
|
var import_lodash3 = __toModule(require("lodash"));
|
|
@@ -12282,10 +12277,46 @@ var FIELD_TYPES = [
|
|
|
12282
12277
|
var validateSchema = async (schema) => {
|
|
12283
12278
|
const schema2 = addNamespaceToSchema(import_lodash2.default.cloneDeep(schema));
|
|
12284
12279
|
const collections = await sequential(schema2.collections, async (collection) => validateCollection(collection));
|
|
12280
|
+
validationCollectionsPathAndMatch(collections);
|
|
12285
12281
|
return {
|
|
12286
12282
|
collections
|
|
12287
12283
|
};
|
|
12288
12284
|
};
|
|
12285
|
+
var validationCollectionsPathAndMatch = (collections) => {
|
|
12286
|
+
const paths = collections.map((x) => x.path);
|
|
12287
|
+
if (paths.length === new Set(paths).size) {
|
|
12288
|
+
return;
|
|
12289
|
+
}
|
|
12290
|
+
const noMatchCollections = collections.filter((x) => {
|
|
12291
|
+
return typeof (x == null ? void 0 : x.match) === "undefined";
|
|
12292
|
+
}).map((x) => x.path);
|
|
12293
|
+
if (noMatchCollections.length !== new Set(noMatchCollections).size) {
|
|
12294
|
+
throw new Error("path must be unique when no `match` is provided");
|
|
12295
|
+
}
|
|
12296
|
+
const hasMatchAndPath = collections.filter((x) => {
|
|
12297
|
+
return typeof x.path !== "undefined" && typeof x.match !== "undefined";
|
|
12298
|
+
}).map((x) => `${x.path}|${x.match}`);
|
|
12299
|
+
if (hasMatchAndPath.length !== new Set(hasMatchAndPath).size) {
|
|
12300
|
+
throw new Error("Both `match` and `path` can not be the same");
|
|
12301
|
+
}
|
|
12302
|
+
const groupbyPath = collections.reduce((r, a) => {
|
|
12303
|
+
r[a.path] = r[a.path] || [];
|
|
12304
|
+
r[a.path].push(a);
|
|
12305
|
+
return r;
|
|
12306
|
+
}, Object.create(null));
|
|
12307
|
+
Object.keys(groupbyPath).forEach((key2) => {
|
|
12308
|
+
const collectionsArr = groupbyPath[key2];
|
|
12309
|
+
if (collectionsArr.length === 1) {
|
|
12310
|
+
return;
|
|
12311
|
+
}
|
|
12312
|
+
const matches = collectionsArr.filter((x) => {
|
|
12313
|
+
return typeof x.match !== "undefined";
|
|
12314
|
+
});
|
|
12315
|
+
if (matches.length !== collections.length) {
|
|
12316
|
+
throw new Error("path must be unique when no `match` is provided");
|
|
12317
|
+
}
|
|
12318
|
+
});
|
|
12319
|
+
};
|
|
12289
12320
|
var validateCollection = async (collection) => {
|
|
12290
12321
|
let templates = [];
|
|
12291
12322
|
let fields = [];
|
|
@@ -12340,7 +12371,7 @@ var validateField = async (field) => {
|
|
|
12340
12371
|
|
|
12341
12372
|
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/package.json
|
|
12342
12373
|
var name = "@tinacms/graphql";
|
|
12343
|
-
var version = "0.59.
|
|
12374
|
+
var version = "0.59.3";
|
|
12344
12375
|
var main = "dist/index.js";
|
|
12345
12376
|
var typings = "dist/index.d.ts";
|
|
12346
12377
|
var files = [
|
|
@@ -12385,9 +12416,6 @@ var scripts = {
|
|
|
12385
12416
|
test: "jest"
|
|
12386
12417
|
};
|
|
12387
12418
|
var dependencies = {
|
|
12388
|
-
"@octokit/auth-app": "^2.6.0",
|
|
12389
|
-
"@octokit/graphql": "^4.5.6",
|
|
12390
|
-
"@octokit/rest": "18.0.6",
|
|
12391
12419
|
"body-parser": "^1.19.0",
|
|
12392
12420
|
cors: "^2.8.5",
|
|
12393
12421
|
dataloader: "^2.0.0",
|
|
@@ -12403,15 +12431,12 @@ var dependencies = {
|
|
|
12403
12431
|
"graphql-type-json": "^0.3.2",
|
|
12404
12432
|
"gray-matter": "^4.0.2",
|
|
12405
12433
|
"js-yaml": "^3.14.0",
|
|
12406
|
-
level: "^7.0.1",
|
|
12407
|
-
levelup: "^5.1.1",
|
|
12408
12434
|
lodash: "^4.17.20",
|
|
12409
12435
|
mdast: "^3.0.0",
|
|
12410
12436
|
"mdast-util-from-markdown": "^1.0.0",
|
|
12411
12437
|
"mdast-util-mdx": "^1.1.0",
|
|
12412
12438
|
"mdast-util-mdx-expression": "^1.1.0",
|
|
12413
12439
|
"mdast-util-to-markdown": "^1.2.1",
|
|
12414
|
-
memdown: "^6.1.1",
|
|
12415
12440
|
"micromark-extension-mdxjs": "^1.0.0",
|
|
12416
12441
|
mocha: "^9.1.1",
|
|
12417
12442
|
"normalize-path": "^3.0.0",
|
|
@@ -12437,9 +12462,10 @@ var publishConfig = {
|
|
|
12437
12462
|
};
|
|
12438
12463
|
var repository = {
|
|
12439
12464
|
url: "https://github.com/tinacms/tinacms.git",
|
|
12440
|
-
directory: "packages/
|
|
12465
|
+
directory: "packages/@tinacms/graphql"
|
|
12441
12466
|
};
|
|
12442
12467
|
var devDependencies = {
|
|
12468
|
+
"@tinacms/datalayer": "workspace:*",
|
|
12443
12469
|
"@tinacms/scripts": "workspace:*",
|
|
12444
12470
|
"@types/cors": "^2.8.7",
|
|
12445
12471
|
"@types/estree": "^0.0.50",
|
|
@@ -13004,13 +13030,13 @@ var VFile = class {
|
|
|
13004
13030
|
get path() {
|
|
13005
13031
|
return this.history[this.history.length - 1];
|
|
13006
13032
|
}
|
|
13007
|
-
set path(
|
|
13008
|
-
if (isUrl(
|
|
13009
|
-
|
|
13033
|
+
set path(path6) {
|
|
13034
|
+
if (isUrl(path6)) {
|
|
13035
|
+
path6 = (0, import_url.fileURLToPath)(path6);
|
|
13010
13036
|
}
|
|
13011
|
-
assertNonEmpty(
|
|
13012
|
-
if (this.path !==
|
|
13013
|
-
this.history.push(
|
|
13037
|
+
assertNonEmpty(path6, "path");
|
|
13038
|
+
if (this.path !== path6) {
|
|
13039
|
+
this.history.push(path6);
|
|
13014
13040
|
}
|
|
13015
13041
|
}
|
|
13016
13042
|
get dirname() {
|
|
@@ -13086,8 +13112,8 @@ function assertNonEmpty(part, name2) {
|
|
|
13086
13112
|
throw new Error("`" + name2 + "` cannot be empty");
|
|
13087
13113
|
}
|
|
13088
13114
|
}
|
|
13089
|
-
function assertPath(
|
|
13090
|
-
if (!
|
|
13115
|
+
function assertPath(path6, name2) {
|
|
13116
|
+
if (!path6) {
|
|
13091
13117
|
throw new Error("Setting `" + name2 + "` requires `path` to be set too");
|
|
13092
13118
|
}
|
|
13093
13119
|
}
|
|
@@ -18864,7 +18890,7 @@ function createTokenizer(parser, initialize, from) {
|
|
|
18864
18890
|
function onsuccessfulconstruct(construct, info) {
|
|
18865
18891
|
addResult(construct, info.from);
|
|
18866
18892
|
}
|
|
18867
|
-
function onsuccessfulcheck(
|
|
18893
|
+
function onsuccessfulcheck(_6, info) {
|
|
18868
18894
|
info.restore();
|
|
18869
18895
|
}
|
|
18870
18896
|
function constructFactory(onreturn, fields) {
|
|
@@ -20552,13 +20578,13 @@ function indentLines(value, map3) {
|
|
|
20552
20578
|
}
|
|
20553
20579
|
|
|
20554
20580
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js
|
|
20555
|
-
function blockquote(node,
|
|
20581
|
+
function blockquote(node, _6, context) {
|
|
20556
20582
|
const exit2 = context.enter("blockquote");
|
|
20557
20583
|
const value = indentLines(containerFlow(node, context), map);
|
|
20558
20584
|
exit2();
|
|
20559
20585
|
return value;
|
|
20560
20586
|
}
|
|
20561
|
-
function map(line,
|
|
20587
|
+
function map(line, _6, blank) {
|
|
20562
20588
|
return ">" + (blank ? "" : " ") + line;
|
|
20563
20589
|
}
|
|
20564
20590
|
|
|
@@ -20583,7 +20609,7 @@ function listInScope(stack, list3, none) {
|
|
|
20583
20609
|
}
|
|
20584
20610
|
|
|
20585
20611
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/break.js
|
|
20586
|
-
function hardBreak(
|
|
20612
|
+
function hardBreak(_6, _1, context, safe2) {
|
|
20587
20613
|
let index2 = -1;
|
|
20588
20614
|
while (++index2 < context.unsafe.length) {
|
|
20589
20615
|
if (context.unsafe[index2].character === "\n" && patternInScope(context.stack, context.unsafe[index2])) {
|
|
@@ -20723,7 +20749,7 @@ function escapeBackslashes(value, after) {
|
|
|
20723
20749
|
}
|
|
20724
20750
|
|
|
20725
20751
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/code.js
|
|
20726
|
-
function code(node,
|
|
20752
|
+
function code(node, _6, context) {
|
|
20727
20753
|
const marker = checkFence(context);
|
|
20728
20754
|
const raw = node.value || "";
|
|
20729
20755
|
const suffix = marker === "`" ? "GraveAccent" : "Tilde";
|
|
@@ -20764,7 +20790,7 @@ function code(node, _8, context) {
|
|
|
20764
20790
|
exit2();
|
|
20765
20791
|
return value;
|
|
20766
20792
|
}
|
|
20767
|
-
function map2(line,
|
|
20793
|
+
function map2(line, _6, blank) {
|
|
20768
20794
|
return (blank ? "" : " ") + line;
|
|
20769
20795
|
}
|
|
20770
20796
|
|
|
@@ -20786,7 +20812,7 @@ function checkQuote(context) {
|
|
|
20786
20812
|
}
|
|
20787
20813
|
|
|
20788
20814
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/definition.js
|
|
20789
|
-
function definition2(node,
|
|
20815
|
+
function definition2(node, _6, context) {
|
|
20790
20816
|
const marker = checkQuote(context);
|
|
20791
20817
|
const suffix = marker === '"' ? "Quote" : "Apostrophe";
|
|
20792
20818
|
const exit2 = context.enter("definition");
|
|
@@ -20855,7 +20881,7 @@ function containerPhrasing(parent, context, safeOptions) {
|
|
|
20855
20881
|
|
|
20856
20882
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
|
|
20857
20883
|
emphasis.peek = emphasisPeek;
|
|
20858
|
-
function emphasis(node,
|
|
20884
|
+
function emphasis(node, _6, context) {
|
|
20859
20885
|
const marker = checkEmphasis(context);
|
|
20860
20886
|
const exit2 = context.enter("emphasis");
|
|
20861
20887
|
const value = containerPhrasing(node, context, {
|
|
@@ -20865,7 +20891,7 @@ function emphasis(node, _8, context) {
|
|
|
20865
20891
|
exit2();
|
|
20866
20892
|
return marker + value + marker;
|
|
20867
20893
|
}
|
|
20868
|
-
function emphasisPeek(
|
|
20894
|
+
function emphasisPeek(_6, _1, context) {
|
|
20869
20895
|
return context.options.emphasis || "*";
|
|
20870
20896
|
}
|
|
20871
20897
|
|
|
@@ -20882,7 +20908,7 @@ function formatHeadingAsSetext(node, context) {
|
|
|
20882
20908
|
}
|
|
20883
20909
|
|
|
20884
20910
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/heading.js
|
|
20885
|
-
function heading(node,
|
|
20911
|
+
function heading(node, _6, context) {
|
|
20886
20912
|
const rank = Math.max(Math.min(6, node.depth || 1), 1);
|
|
20887
20913
|
if (formatHeadingAsSetext(node, context)) {
|
|
20888
20914
|
const exit3 = context.enter("headingSetext");
|
|
@@ -20919,7 +20945,7 @@ function htmlPeek() {
|
|
|
20919
20945
|
|
|
20920
20946
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/image.js
|
|
20921
20947
|
image.peek = imagePeek;
|
|
20922
|
-
function image(node,
|
|
20948
|
+
function image(node, _6, context) {
|
|
20923
20949
|
const quote = checkQuote(context);
|
|
20924
20950
|
const suffix = quote === '"' ? "Quote" : "Apostrophe";
|
|
20925
20951
|
const exit2 = context.enter("image");
|
|
@@ -20952,7 +20978,7 @@ function imagePeek() {
|
|
|
20952
20978
|
|
|
20953
20979
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js
|
|
20954
20980
|
imageReference.peek = imageReferencePeek;
|
|
20955
|
-
function imageReference(node,
|
|
20981
|
+
function imageReference(node, _6, context) {
|
|
20956
20982
|
const type = node.referenceType;
|
|
20957
20983
|
const exit2 = context.enter("imageReference");
|
|
20958
20984
|
let subexit = context.enter("label");
|
|
@@ -20979,7 +21005,7 @@ function imageReferencePeek() {
|
|
|
20979
21005
|
|
|
20980
21006
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
|
|
20981
21007
|
inlineCode.peek = inlineCodePeek;
|
|
20982
|
-
function inlineCode(node,
|
|
21008
|
+
function inlineCode(node, _6, context) {
|
|
20983
21009
|
let value = node.value || "";
|
|
20984
21010
|
let sequence = "`";
|
|
20985
21011
|
let index2 = -1;
|
|
@@ -21017,7 +21043,7 @@ function formatLinkAsAutolink(node, context) {
|
|
|
21017
21043
|
|
|
21018
21044
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/link.js
|
|
21019
21045
|
link.peek = linkPeek;
|
|
21020
|
-
function link(node,
|
|
21046
|
+
function link(node, _6, context) {
|
|
21021
21047
|
const quote = checkQuote(context);
|
|
21022
21048
|
const suffix = quote === '"' ? "Quote" : "Apostrophe";
|
|
21023
21049
|
let exit2;
|
|
@@ -21056,13 +21082,13 @@ function link(node, _8, context) {
|
|
|
21056
21082
|
exit2();
|
|
21057
21083
|
return value;
|
|
21058
21084
|
}
|
|
21059
|
-
function linkPeek(node,
|
|
21085
|
+
function linkPeek(node, _6, context) {
|
|
21060
21086
|
return formatLinkAsAutolink(node, context) ? "<" : "[";
|
|
21061
21087
|
}
|
|
21062
21088
|
|
|
21063
21089
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js
|
|
21064
21090
|
linkReference.peek = linkReferencePeek;
|
|
21065
|
-
function linkReference(node,
|
|
21091
|
+
function linkReference(node, _6, context) {
|
|
21066
21092
|
const type = node.referenceType;
|
|
21067
21093
|
const exit2 = context.enter("linkReference");
|
|
21068
21094
|
let subexit = context.enter("label");
|
|
@@ -21220,7 +21246,7 @@ function listItem(node, parent, context) {
|
|
|
21220
21246
|
}
|
|
21221
21247
|
|
|
21222
21248
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js
|
|
21223
|
-
function paragraph(node,
|
|
21249
|
+
function paragraph(node, _6, context) {
|
|
21224
21250
|
const exit2 = context.enter("paragraph");
|
|
21225
21251
|
const subexit = context.enter("phrasing");
|
|
21226
21252
|
const value = containerPhrasing(node, context, { before: "\n", after: "\n" });
|
|
@@ -21230,7 +21256,7 @@ function paragraph(node, _8, context) {
|
|
|
21230
21256
|
}
|
|
21231
21257
|
|
|
21232
21258
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/root.js
|
|
21233
|
-
function root(node,
|
|
21259
|
+
function root(node, _6, context) {
|
|
21234
21260
|
return containerFlow(node, context);
|
|
21235
21261
|
}
|
|
21236
21262
|
|
|
@@ -21245,7 +21271,7 @@ function checkStrong(context) {
|
|
|
21245
21271
|
|
|
21246
21272
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/strong.js
|
|
21247
21273
|
strong.peek = strongPeek;
|
|
21248
|
-
function strong(node,
|
|
21274
|
+
function strong(node, _6, context) {
|
|
21249
21275
|
const marker = checkStrong(context);
|
|
21250
21276
|
const exit2 = context.enter("strong");
|
|
21251
21277
|
const value = containerPhrasing(node, context, {
|
|
@@ -21255,12 +21281,12 @@ function strong(node, _8, context) {
|
|
|
21255
21281
|
exit2();
|
|
21256
21282
|
return marker + marker + value + marker + marker;
|
|
21257
21283
|
}
|
|
21258
|
-
function strongPeek(
|
|
21284
|
+
function strongPeek(_6, _1, context) {
|
|
21259
21285
|
return context.options.strong || "*";
|
|
21260
21286
|
}
|
|
21261
21287
|
|
|
21262
21288
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/text.js
|
|
21263
|
-
function text3(node,
|
|
21289
|
+
function text3(node, _6, context, safeOptions) {
|
|
21264
21290
|
return safe(context, node.value, safeOptions);
|
|
21265
21291
|
}
|
|
21266
21292
|
|
|
@@ -21274,7 +21300,7 @@ function checkRuleRepetition(context) {
|
|
|
21274
21300
|
}
|
|
21275
21301
|
|
|
21276
21302
|
// pnp:/Users/jeffsee/code/tinacms/.yarn/cache/mdast-util-to-markdown-npm-1.2.3-e27fe7fcf9-d50b5c4a9f.zip/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js
|
|
21277
|
-
function thematicBreak2(
|
|
21303
|
+
function thematicBreak2(_6, _1, context) {
|
|
21278
21304
|
const value = (checkRule(context) + (context.options.ruleSpaces ? " " : "")).repeat(checkRuleRepetition(context));
|
|
21279
21305
|
return context.options.ruleSpaces ? value.slice(0, -1) : value;
|
|
21280
21306
|
}
|
|
@@ -21777,7 +21803,7 @@ var mdxJsxToMarkdown = {
|
|
|
21777
21803
|
fences: true,
|
|
21778
21804
|
resourceLink: true
|
|
21779
21805
|
};
|
|
21780
|
-
function mdxElement(node,
|
|
21806
|
+
function mdxElement(node, _6, context) {
|
|
21781
21807
|
const selfClosing = node.name && (!node.children || node.children.length === 0);
|
|
21782
21808
|
const quote = checkQuote(context);
|
|
21783
21809
|
const exit2 = context.enter(node.type);
|
|
@@ -21813,7 +21839,7 @@ function peekElement() {
|
|
|
21813
21839
|
}
|
|
21814
21840
|
function indent(value) {
|
|
21815
21841
|
return indentLines(value, map3);
|
|
21816
|
-
function map3(line,
|
|
21842
|
+
function map3(line, _6, blank) {
|
|
21817
21843
|
return (blank ? "" : " ") + line;
|
|
21818
21844
|
}
|
|
21819
21845
|
}
|
|
@@ -22594,9 +22620,15 @@ var Resolver = class {
|
|
|
22594
22620
|
assertShape(rawData, (yup3) => yup3.object());
|
|
22595
22621
|
const value = rawData[field.name];
|
|
22596
22622
|
switch (field.type) {
|
|
22623
|
+
case "datetime":
|
|
22624
|
+
if (value instanceof Date) {
|
|
22625
|
+
accumulator[field.name] = value.toISOString();
|
|
22626
|
+
} else {
|
|
22627
|
+
accumulator[field.name] = value;
|
|
22628
|
+
}
|
|
22629
|
+
break;
|
|
22597
22630
|
case "string":
|
|
22598
22631
|
case "boolean":
|
|
22599
|
-
case "datetime":
|
|
22600
22632
|
case "number":
|
|
22601
22633
|
case "reference":
|
|
22602
22634
|
case "image":
|
|
@@ -22689,7 +22721,8 @@ var Resolver = class {
|
|
|
22689
22721
|
}, field), extraFields);
|
|
22690
22722
|
case "image":
|
|
22691
22723
|
return __spreadValues(__spreadValues({
|
|
22692
|
-
component: "image"
|
|
22724
|
+
component: "image",
|
|
22725
|
+
clearable: true
|
|
22693
22726
|
}, field), extraFields);
|
|
22694
22727
|
case "string":
|
|
22695
22728
|
if (field.options) {
|
|
@@ -22824,7 +22857,7 @@ var resolve = async ({
|
|
|
22824
22857
|
const referencePathVisitor = () => {
|
|
22825
22858
|
return {
|
|
22826
22859
|
leave: {
|
|
22827
|
-
Field(node, key2, parent,
|
|
22860
|
+
Field(node, key2, parent, path6, ancestors) {
|
|
22828
22861
|
const type = typeInfo.getType();
|
|
22829
22862
|
if (type) {
|
|
22830
22863
|
const realType = (0, import_graphql3.getNamedType)(type);
|
|
@@ -22834,7 +22867,7 @@ var resolve = async ({
|
|
|
22834
22867
|
const p = [];
|
|
22835
22868
|
ancestors.forEach((item, index2) => {
|
|
22836
22869
|
var _a;
|
|
22837
|
-
const activePath =
|
|
22870
|
+
const activePath = path6[index2];
|
|
22838
22871
|
const result = item[activePath];
|
|
22839
22872
|
if ((_a = result == null ? void 0 : result.name) == null ? void 0 : _a.value) {
|
|
22840
22873
|
if (result.kind === "Field") {
|
|
@@ -23006,17 +23039,17 @@ var resolve = async ({
|
|
|
23006
23039
|
}
|
|
23007
23040
|
}
|
|
23008
23041
|
};
|
|
23009
|
-
var buildPath = (
|
|
23010
|
-
if (
|
|
23011
|
-
buildPath(
|
|
23042
|
+
var buildPath = (path6, accum) => {
|
|
23043
|
+
if (path6.prev) {
|
|
23044
|
+
buildPath(path6.prev, accum);
|
|
23012
23045
|
}
|
|
23013
|
-
accum.push(
|
|
23046
|
+
accum.push(path6.key);
|
|
23014
23047
|
return accum;
|
|
23015
23048
|
};
|
|
23016
|
-
var buildReferenceQuery = (fieldNode,
|
|
23049
|
+
var buildReferenceQuery = (fieldNode, path6) => {
|
|
23017
23050
|
if (fieldNode) {
|
|
23018
|
-
const p =
|
|
23019
|
-
const dataPath =
|
|
23051
|
+
const p = path6.map((item) => item === "data" ? "form" : item);
|
|
23052
|
+
const dataPath = path6;
|
|
23020
23053
|
const newNode = __spreadProps(__spreadValues({}, fieldNode), {
|
|
23021
23054
|
name: { kind: "Name", value: "node" },
|
|
23022
23055
|
arguments: [
|
|
@@ -23619,499 +23652,24 @@ var _indexAttribute = async ({
|
|
|
23619
23652
|
return fieldName;
|
|
23620
23653
|
};
|
|
23621
23654
|
|
|
23622
|
-
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/database/bridge/github.ts
|
|
23623
|
-
var import_lodash8 = __toModule(require("lodash"));
|
|
23624
|
-
var import_path5 = __toModule(require("path"));
|
|
23625
|
-
var import_rest = __toModule(require("@octokit/rest"));
|
|
23626
|
-
var import_graphql5 = __toModule(require("graphql"));
|
|
23627
|
-
var GithubBridge = class {
|
|
23628
|
-
constructor({ rootPath, accessToken, owner, repo, ref }) {
|
|
23629
|
-
this.rootPath = rootPath;
|
|
23630
|
-
this.repoConfig = {
|
|
23631
|
-
owner,
|
|
23632
|
-
repo,
|
|
23633
|
-
ref
|
|
23634
|
-
};
|
|
23635
|
-
this.appOctoKit = new import_rest.Octokit({
|
|
23636
|
-
auth: accessToken
|
|
23637
|
-
});
|
|
23638
|
-
}
|
|
23639
|
-
async readDir(filepath) {
|
|
23640
|
-
const fullPath = import_path5.default.join(this.rootPath, filepath);
|
|
23641
|
-
const repos = await this.appOctoKit.repos.getContent(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23642
|
-
path: fullPath
|
|
23643
|
-
})).then(async (response) => {
|
|
23644
|
-
if (Array.isArray(response.data)) {
|
|
23645
|
-
return await Promise.all(await response.data.map(async (d) => {
|
|
23646
|
-
if (d.type === "dir") {
|
|
23647
|
-
const nestedItems = await this.readDir(d.path);
|
|
23648
|
-
if (Array.isArray(nestedItems)) {
|
|
23649
|
-
return nestedItems.map((nestedItem) => {
|
|
23650
|
-
return import_path5.default.join(d.path, nestedItem);
|
|
23651
|
-
});
|
|
23652
|
-
} else {
|
|
23653
|
-
throw new Error(`Expected items to be an array of strings for readDir at ${d.path}`);
|
|
23654
|
-
}
|
|
23655
|
-
}
|
|
23656
|
-
return d.path;
|
|
23657
|
-
}));
|
|
23658
|
-
}
|
|
23659
|
-
throw new Error(`Expected to return an array from Github directory ${import_path5.default}`);
|
|
23660
|
-
});
|
|
23661
|
-
return import_lodash8.default.flatten(repos);
|
|
23662
|
-
}
|
|
23663
|
-
supportsBuilding() {
|
|
23664
|
-
return false;
|
|
23665
|
-
}
|
|
23666
|
-
async glob(pattern) {
|
|
23667
|
-
const results = await this.readDir(pattern);
|
|
23668
|
-
return results.map((item) => item.replace(this.rootPath, "").replace(/^\/|\/$/g, ""));
|
|
23669
|
-
}
|
|
23670
|
-
async get(filepath) {
|
|
23671
|
-
const realpath = import_path5.default.join(this.rootPath, filepath);
|
|
23672
|
-
return this.appOctoKit.repos.getContent(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23673
|
-
path: realpath
|
|
23674
|
-
})).then((response) => {
|
|
23675
|
-
return Buffer.from(response.data.content, "base64").toString();
|
|
23676
|
-
}).catch((e) => {
|
|
23677
|
-
if (e.status === 401) {
|
|
23678
|
-
throw new import_graphql5.GraphQLError(`Unauthorized request to Github Repository: '${this.repoConfig.owner}/${this.repoConfig.repo}', please ensure your access token is valid.`, null, null, null, null, e, { status: e.status });
|
|
23679
|
-
}
|
|
23680
|
-
throw new import_graphql5.GraphQLError(`Unable to find record '${filepath}' in Github Repository: '${this.repoConfig.owner}/${this.repoConfig.repo}', Ref: '${this.repoConfig.ref}'`, null, null, null, null, e, { status: e.status });
|
|
23681
|
-
});
|
|
23682
|
-
}
|
|
23683
|
-
async putConfig(filepath, data) {
|
|
23684
|
-
throw new Error(`Config files cannot be changed by the Github bridge`);
|
|
23685
|
-
}
|
|
23686
|
-
async put(filepath, data) {
|
|
23687
|
-
const realpath = import_path5.default.join(this.rootPath, filepath);
|
|
23688
|
-
let fileSha = void 0;
|
|
23689
|
-
try {
|
|
23690
|
-
const fileContent = await this.appOctoKit.repos.getContent(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23691
|
-
path: realpath
|
|
23692
|
-
}));
|
|
23693
|
-
fileSha = fileContent.data.sha;
|
|
23694
|
-
} catch (e) {
|
|
23695
|
-
console.log("No file exists, creating new one");
|
|
23696
|
-
}
|
|
23697
|
-
await this.appOctoKit.repos.createOrUpdateFileContents(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23698
|
-
branch: this.repoConfig.ref,
|
|
23699
|
-
path: realpath,
|
|
23700
|
-
message: "Update from GraphQL client",
|
|
23701
|
-
content: new Buffer(data).toString("base64"),
|
|
23702
|
-
sha: fileSha
|
|
23703
|
-
}));
|
|
23704
|
-
}
|
|
23705
|
-
};
|
|
23706
|
-
|
|
23707
|
-
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/database/store/github.ts
|
|
23708
|
-
var import_lodash9 = __toModule(require("lodash"));
|
|
23709
|
-
var import_path6 = __toModule(require("path"));
|
|
23710
|
-
var import_rest2 = __toModule(require("@octokit/rest"));
|
|
23711
|
-
var import_graphql6 = __toModule(require("graphql"));
|
|
23712
|
-
var GithubStore = class {
|
|
23713
|
-
async clear() {
|
|
23714
|
-
}
|
|
23715
|
-
async print() {
|
|
23716
|
-
}
|
|
23717
|
-
constructor({ rootPath, accessToken, owner, repo, ref }) {
|
|
23718
|
-
this.rootPath = rootPath;
|
|
23719
|
-
this.repoConfig = {
|
|
23720
|
-
owner,
|
|
23721
|
-
repo,
|
|
23722
|
-
ref
|
|
23723
|
-
};
|
|
23724
|
-
this.appOctoKit = new import_rest2.Octokit({
|
|
23725
|
-
auth: accessToken
|
|
23726
|
-
});
|
|
23727
|
-
}
|
|
23728
|
-
async query(queryStrings) {
|
|
23729
|
-
throw new Error(`Unable to perform query for GithubStore`);
|
|
23730
|
-
}
|
|
23731
|
-
supportsSeeding() {
|
|
23732
|
-
return false;
|
|
23733
|
-
}
|
|
23734
|
-
async seed() {
|
|
23735
|
-
throw new Error(`Seeding data is not possible for Github data store`);
|
|
23736
|
-
}
|
|
23737
|
-
async readDir(filepath) {
|
|
23738
|
-
const fullPath = import_path6.default.join(this.rootPath, filepath);
|
|
23739
|
-
const repos = await this.appOctoKit.repos.getContent(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23740
|
-
path: fullPath
|
|
23741
|
-
})).then(async (response) => {
|
|
23742
|
-
if (Array.isArray(response.data)) {
|
|
23743
|
-
return await Promise.all(await response.data.map(async (d) => {
|
|
23744
|
-
if (d.type === "dir") {
|
|
23745
|
-
const nestedItems = await this.readDir(d.path);
|
|
23746
|
-
if (Array.isArray(nestedItems)) {
|
|
23747
|
-
return nestedItems.map((nestedItem) => {
|
|
23748
|
-
return import_path6.default.join(d.path, nestedItem);
|
|
23749
|
-
});
|
|
23750
|
-
} else {
|
|
23751
|
-
throw new Error(`Expected items to be an array of strings for readDir at ${d.path}`);
|
|
23752
|
-
}
|
|
23753
|
-
}
|
|
23754
|
-
return d.path;
|
|
23755
|
-
}));
|
|
23756
|
-
}
|
|
23757
|
-
throw new Error(`Expected to return an array from Github directory ${import_path6.default}`);
|
|
23758
|
-
});
|
|
23759
|
-
return import_lodash9.default.flatten(repos);
|
|
23760
|
-
}
|
|
23761
|
-
async glob(pattern, callback) {
|
|
23762
|
-
const results = await this.readDir(pattern);
|
|
23763
|
-
const items = results.map((item) => item.replace(this.rootPath, "").replace(/^\/|\/$/g, ""));
|
|
23764
|
-
if (callback) {
|
|
23765
|
-
return sequential(items, async (item) => {
|
|
23766
|
-
return callback(item);
|
|
23767
|
-
});
|
|
23768
|
-
} else {
|
|
23769
|
-
return items;
|
|
23770
|
-
}
|
|
23771
|
-
}
|
|
23772
|
-
async get(filepath) {
|
|
23773
|
-
const realpath = import_path6.default.join(this.rootPath, filepath);
|
|
23774
|
-
return this.appOctoKit.repos.getContent(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23775
|
-
path: realpath
|
|
23776
|
-
})).then((response) => {
|
|
23777
|
-
const responseString = Buffer.from(response.data.content, "base64").toString();
|
|
23778
|
-
return parseFile(responseString, import_path6.default.extname(filepath), (yup3) => yup3.object());
|
|
23779
|
-
}).catch((e) => {
|
|
23780
|
-
if (e.status === 401) {
|
|
23781
|
-
throw new import_graphql6.GraphQLError(`Unauthorized request to Github Repository: '${this.repoConfig.owner}/${this.repoConfig.repo}', please ensure your access token is valid.`, null, null, null, null, e, { status: e.status });
|
|
23782
|
-
}
|
|
23783
|
-
throw new import_graphql6.GraphQLError(`Unable to find record '${filepath}' in Github Repository: '${this.repoConfig.owner}/${this.repoConfig.repo}', Ref: '${this.repoConfig.ref}'`, null, null, null, null, e, { status: e.status });
|
|
23784
|
-
});
|
|
23785
|
-
}
|
|
23786
|
-
supportsIndexing() {
|
|
23787
|
-
return false;
|
|
23788
|
-
}
|
|
23789
|
-
async put(filepath, data) {
|
|
23790
|
-
const realpath = import_path6.default.join(this.rootPath, filepath);
|
|
23791
|
-
let fileSha = void 0;
|
|
23792
|
-
try {
|
|
23793
|
-
const fileContent = await this.appOctoKit.repos.getContent(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23794
|
-
path: realpath
|
|
23795
|
-
}));
|
|
23796
|
-
fileSha = fileContent.data.sha;
|
|
23797
|
-
} catch (e) {
|
|
23798
|
-
console.log("No file exists, creating new one");
|
|
23799
|
-
}
|
|
23800
|
-
await this.appOctoKit.repos.createOrUpdateFileContents(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23801
|
-
branch: this.repoConfig.ref,
|
|
23802
|
-
path: realpath,
|
|
23803
|
-
message: "Update from GraphQL client",
|
|
23804
|
-
content: new Buffer(stringifyFile(data, import_path6.default.extname(filepath), false)).toString("base64"),
|
|
23805
|
-
sha: fileSha
|
|
23806
|
-
}));
|
|
23807
|
-
}
|
|
23808
|
-
};
|
|
23809
|
-
|
|
23810
|
-
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/database/bridge/filesystem.ts
|
|
23811
|
-
var import_fs_extra2 = __toModule(require("fs-extra"));
|
|
23812
|
-
var import_fast_glob = __toModule(require("fast-glob"));
|
|
23813
|
-
var import_path7 = __toModule(require("path"));
|
|
23814
|
-
var import_normalize_path = __toModule(require("normalize-path"));
|
|
23815
|
-
var FilesystemBridge = class {
|
|
23816
|
-
constructor(rootPath) {
|
|
23817
|
-
this.rootPath = rootPath || "";
|
|
23818
|
-
}
|
|
23819
|
-
async glob(pattern) {
|
|
23820
|
-
const basePath = import_path7.default.join(this.rootPath, ...pattern.split("/"));
|
|
23821
|
-
const items = await (0, import_fast_glob.default)(import_path7.default.join(basePath, "**", "/*").replace(/\\/g, "/"), {
|
|
23822
|
-
dot: true
|
|
23823
|
-
});
|
|
23824
|
-
const posixRootPath = (0, import_normalize_path.default)(this.rootPath);
|
|
23825
|
-
return items.map((item) => {
|
|
23826
|
-
return item.replace(posixRootPath, "").replace(/^\/|\/$/g, "");
|
|
23827
|
-
});
|
|
23828
|
-
}
|
|
23829
|
-
supportsBuilding() {
|
|
23830
|
-
return true;
|
|
23831
|
-
}
|
|
23832
|
-
async get(filepath) {
|
|
23833
|
-
return import_fs_extra2.default.readFileSync(import_path7.default.join(this.rootPath, filepath)).toString();
|
|
23834
|
-
}
|
|
23835
|
-
async putConfig(filepath, data) {
|
|
23836
|
-
await this.put(filepath, data);
|
|
23837
|
-
}
|
|
23838
|
-
async put(filepath, data) {
|
|
23839
|
-
await import_fs_extra2.default.outputFileSync(import_path7.default.join(this.rootPath, filepath), data);
|
|
23840
|
-
}
|
|
23841
|
-
};
|
|
23842
|
-
|
|
23843
|
-
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/database/store/filesystem.ts
|
|
23844
|
-
var import_fs_extra3 = __toModule(require("fs-extra"));
|
|
23845
|
-
var import_fast_glob2 = __toModule(require("fast-glob"));
|
|
23846
|
-
var import_path8 = __toModule(require("path"));
|
|
23847
|
-
var import_normalize_path2 = __toModule(require("normalize-path"));
|
|
23848
|
-
var FilesystemStore = class {
|
|
23849
|
-
async clear() {
|
|
23850
|
-
}
|
|
23851
|
-
async print() {
|
|
23852
|
-
}
|
|
23853
|
-
constructor({ rootPath }) {
|
|
23854
|
-
this.rootPath = rootPath || "";
|
|
23855
|
-
}
|
|
23856
|
-
async query(queryStrings) {
|
|
23857
|
-
throw new Error(`Unable to perform query for Filesystem store`);
|
|
23858
|
-
}
|
|
23859
|
-
async seed() {
|
|
23860
|
-
throw new Error(`Seeding data is not possible for Filesystem store`);
|
|
23861
|
-
}
|
|
23862
|
-
async get(filepath) {
|
|
23863
|
-
return parseFile(await import_fs_extra3.default.readFileSync(import_path8.default.join(this.rootPath, filepath)).toString(), import_path8.default.extname(filepath), (yup3) => yup3.object());
|
|
23864
|
-
}
|
|
23865
|
-
supportsSeeding() {
|
|
23866
|
-
return false;
|
|
23867
|
-
}
|
|
23868
|
-
supportsIndexing() {
|
|
23869
|
-
return false;
|
|
23870
|
-
}
|
|
23871
|
-
async glob(pattern, callback) {
|
|
23872
|
-
const basePath = import_path8.default.join(this.rootPath, ...pattern.split("/"));
|
|
23873
|
-
const itemsRaw = await (0, import_fast_glob2.default)(import_path8.default.join(basePath, "**", "/*").replace(/\\/g, "/"), {
|
|
23874
|
-
dot: true
|
|
23875
|
-
});
|
|
23876
|
-
const posixRootPath = (0, import_normalize_path2.default)(this.rootPath);
|
|
23877
|
-
const items = itemsRaw.map((item) => {
|
|
23878
|
-
return item.replace(posixRootPath, "").replace(/^\/|\/$/g, "");
|
|
23879
|
-
});
|
|
23880
|
-
if (callback) {
|
|
23881
|
-
return sequential(items, async (item) => {
|
|
23882
|
-
return callback(item);
|
|
23883
|
-
});
|
|
23884
|
-
} else {
|
|
23885
|
-
return items;
|
|
23886
|
-
}
|
|
23887
|
-
}
|
|
23888
|
-
async put(filepath, data) {
|
|
23889
|
-
await import_fs_extra3.default.outputFileSync(import_path8.default.join(this.rootPath, filepath), stringifyFile(data, import_path8.default.extname(filepath), false));
|
|
23890
|
-
}
|
|
23891
|
-
};
|
|
23892
|
-
|
|
23893
|
-
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/database/store/memory.ts
|
|
23894
|
-
var MemoryStore = class {
|
|
23895
|
-
constructor(rootPath, object2 = {}) {
|
|
23896
|
-
this.map = object2;
|
|
23897
|
-
this.rootPath = rootPath || "";
|
|
23898
|
-
this.db = {
|
|
23899
|
-
get: async (filepath) => {
|
|
23900
|
-
return this.map[filepath];
|
|
23901
|
-
},
|
|
23902
|
-
put: async (filepath, content3) => {
|
|
23903
|
-
this.map[filepath] = content3;
|
|
23904
|
-
await this.print();
|
|
23905
|
-
}
|
|
23906
|
-
};
|
|
23907
|
-
}
|
|
23908
|
-
async query(queryStrings, hydrator) {
|
|
23909
|
-
const resultSets = await sequential(queryStrings, async (queryString) => {
|
|
23910
|
-
const res = await this.get(queryString);
|
|
23911
|
-
return res || [];
|
|
23912
|
-
});
|
|
23913
|
-
let items = [];
|
|
23914
|
-
if (resultSets.length > 0) {
|
|
23915
|
-
items = resultSets.reduce((p, c) => p.filter((e) => c.includes(e)));
|
|
23916
|
-
}
|
|
23917
|
-
return sequential(items, async (documentString) => {
|
|
23918
|
-
return hydrator(documentString);
|
|
23919
|
-
});
|
|
23920
|
-
}
|
|
23921
|
-
async seed(filepath, data) {
|
|
23922
|
-
await this.put(filepath, data);
|
|
23923
|
-
}
|
|
23924
|
-
supportsSeeding() {
|
|
23925
|
-
return true;
|
|
23926
|
-
}
|
|
23927
|
-
supportsIndexing() {
|
|
23928
|
-
return true;
|
|
23929
|
-
}
|
|
23930
|
-
async print() {
|
|
23931
|
-
}
|
|
23932
|
-
async clear() {
|
|
23933
|
-
this.map = {};
|
|
23934
|
-
}
|
|
23935
|
-
async glob(pattern, callback) {
|
|
23936
|
-
const strings = Object.keys(this.map).filter((key2) => {
|
|
23937
|
-
if (key2.startsWith(pattern)) {
|
|
23938
|
-
return true;
|
|
23939
|
-
} else {
|
|
23940
|
-
return false;
|
|
23941
|
-
}
|
|
23942
|
-
});
|
|
23943
|
-
if (callback) {
|
|
23944
|
-
return sequential(strings, async (item) => {
|
|
23945
|
-
return callback(item);
|
|
23946
|
-
});
|
|
23947
|
-
} else {
|
|
23948
|
-
return strings;
|
|
23949
|
-
}
|
|
23950
|
-
}
|
|
23951
|
-
async get(filepath) {
|
|
23952
|
-
const content3 = await this.db.get(filepath);
|
|
23953
|
-
return content3;
|
|
23954
|
-
}
|
|
23955
|
-
async put(filepath, data) {
|
|
23956
|
-
await this.db.put(filepath, data);
|
|
23957
|
-
}
|
|
23958
|
-
};
|
|
23959
|
-
|
|
23960
|
-
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/database/store/level.ts
|
|
23961
|
-
var import_path9 = __toModule(require("path"));
|
|
23962
|
-
var import_level = __toModule(require("level"));
|
|
23963
|
-
var import_levelup = __toModule(require("levelup"));
|
|
23964
|
-
var import_memdown = __toModule(require("memdown"));
|
|
23965
|
-
var import_encoding_down = __toModule(require("encoding-down"));
|
|
23966
|
-
var LevelStore = class {
|
|
23967
|
-
constructor(rootPath, useMemory = false) {
|
|
23968
|
-
this.rootPath = rootPath || "";
|
|
23969
|
-
if (useMemory) {
|
|
23970
|
-
const db = (0, import_levelup.default)((0, import_encoding_down.default)((0, import_memdown.default)(), { valueEncoding: "json" }));
|
|
23971
|
-
this.db = db;
|
|
23972
|
-
} else {
|
|
23973
|
-
const db = (0, import_level.default)(import_path9.default.join(rootPath, ".tina/__generated__/db"), {
|
|
23974
|
-
valueEncoding: "json"
|
|
23975
|
-
});
|
|
23976
|
-
this.db = db;
|
|
23977
|
-
}
|
|
23978
|
-
}
|
|
23979
|
-
async query(queryStrings, hydrator) {
|
|
23980
|
-
const resultSets = await sequential(queryStrings, async (queryString) => {
|
|
23981
|
-
let strings = [];
|
|
23982
|
-
const p = new Promise((resolve2, reject) => {
|
|
23983
|
-
this.db.createReadStream({
|
|
23984
|
-
gte: queryString,
|
|
23985
|
-
lte: queryString + "\xFF"
|
|
23986
|
-
}).on("data", (data) => {
|
|
23987
|
-
strings = [...strings, ...data.value];
|
|
23988
|
-
}).on("error", (message) => {
|
|
23989
|
-
reject(message);
|
|
23990
|
-
}).on("end", function() {
|
|
23991
|
-
resolve2();
|
|
23992
|
-
});
|
|
23993
|
-
});
|
|
23994
|
-
await p;
|
|
23995
|
-
return strings || [];
|
|
23996
|
-
});
|
|
23997
|
-
let items = [];
|
|
23998
|
-
if (resultSets.length > 0) {
|
|
23999
|
-
items = resultSets.reduce((p, c) => p.filter((e) => c.includes(e)));
|
|
24000
|
-
}
|
|
24001
|
-
return sequential(items, async (documentString) => {
|
|
24002
|
-
return hydrator(documentString);
|
|
24003
|
-
});
|
|
24004
|
-
}
|
|
24005
|
-
async seed(filepath, data) {
|
|
24006
|
-
await this.put(filepath, data);
|
|
24007
|
-
}
|
|
24008
|
-
supportsSeeding() {
|
|
24009
|
-
return true;
|
|
24010
|
-
}
|
|
24011
|
-
supportsIndexing() {
|
|
24012
|
-
return true;
|
|
24013
|
-
}
|
|
24014
|
-
async print() {
|
|
24015
|
-
this.db.createReadStream().on("data", function(data) {
|
|
24016
|
-
console.log(data.key, "=", data.value);
|
|
24017
|
-
}).on("error", function(err) {
|
|
24018
|
-
console.log("Oh my!", err);
|
|
24019
|
-
}).on("close", function() {
|
|
24020
|
-
console.log("Stream closed");
|
|
24021
|
-
}).on("end", function() {
|
|
24022
|
-
console.log("Stream ended");
|
|
24023
|
-
});
|
|
24024
|
-
}
|
|
24025
|
-
async open() {
|
|
24026
|
-
await this.db.open();
|
|
24027
|
-
}
|
|
24028
|
-
async clear() {
|
|
24029
|
-
await this.db.clear();
|
|
24030
|
-
}
|
|
24031
|
-
async glob(pattern, callback) {
|
|
24032
|
-
const strings = [];
|
|
24033
|
-
const p = new Promise((resolve2, reject) => {
|
|
24034
|
-
this.db.createKeyStream({
|
|
24035
|
-
gte: pattern,
|
|
24036
|
-
lte: pattern + "\xFF"
|
|
24037
|
-
}).on("data", (data) => {
|
|
24038
|
-
strings.push(data);
|
|
24039
|
-
}).on("error", (message) => {
|
|
24040
|
-
reject(message);
|
|
24041
|
-
}).on("end", function() {
|
|
24042
|
-
resolve2();
|
|
24043
|
-
});
|
|
24044
|
-
});
|
|
24045
|
-
await p;
|
|
24046
|
-
if (callback) {
|
|
24047
|
-
return sequential(strings, async (item) => {
|
|
24048
|
-
return callback(item);
|
|
24049
|
-
});
|
|
24050
|
-
} else {
|
|
24051
|
-
return strings;
|
|
24052
|
-
}
|
|
24053
|
-
}
|
|
24054
|
-
async get(filepath) {
|
|
24055
|
-
try {
|
|
24056
|
-
const content3 = await this.db.get(filepath);
|
|
24057
|
-
return content3;
|
|
24058
|
-
} catch (e) {
|
|
24059
|
-
return void 0;
|
|
24060
|
-
}
|
|
24061
|
-
}
|
|
24062
|
-
async put(filepath, data) {
|
|
24063
|
-
await this.db.put(filepath, data);
|
|
24064
|
-
}
|
|
24065
|
-
};
|
|
24066
|
-
|
|
24067
23655
|
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/index.ts
|
|
24068
|
-
var import_rest3 = __toModule(require("@octokit/rest"));
|
|
24069
23656
|
var buildSchema = async (rootPath, database) => {
|
|
24070
|
-
const tempConfig =
|
|
24071
|
-
const config = await
|
|
24072
|
-
await
|
|
23657
|
+
const tempConfig = import_path5.default.join(rootPath, ".tina", "__generated__", "config");
|
|
23658
|
+
const config = await import_fs_extra2.default.readFileSync(import_path5.default.join(tempConfig, "schema.json")).toString();
|
|
23659
|
+
await import_fs_extra2.default.rmdir(tempConfig, { recursive: true });
|
|
24073
23660
|
await indexDB({ database, config: JSON.parse(config) });
|
|
24074
23661
|
const gqlAst = await database.getGraphQLSchemaFromBridge();
|
|
24075
|
-
return (0,
|
|
24076
|
-
};
|
|
24077
|
-
var listBranches = async ({ auth, owner, repo }) => {
|
|
24078
|
-
const appOctoKit = new import_rest3.Octokit({ auth });
|
|
24079
|
-
const branchList = await appOctoKit.repos.listBranches({
|
|
24080
|
-
owner,
|
|
24081
|
-
repo,
|
|
24082
|
-
per_page: 100
|
|
24083
|
-
});
|
|
24084
|
-
return branchList;
|
|
24085
|
-
};
|
|
24086
|
-
var createBranch = async ({ auth, owner, repo, name: name2, baseBranch }) => {
|
|
24087
|
-
const appOctoKit = new import_rest3.Octokit({ auth });
|
|
24088
|
-
const currentBranch = await appOctoKit.repos.getBranch({
|
|
24089
|
-
owner,
|
|
24090
|
-
repo,
|
|
24091
|
-
branch: baseBranch
|
|
24092
|
-
});
|
|
24093
|
-
const newBranch = await appOctoKit.git.createRef({
|
|
24094
|
-
owner,
|
|
24095
|
-
repo,
|
|
24096
|
-
ref: `refs/heads/${name2}`,
|
|
24097
|
-
sha: currentBranch.data.commit.sha
|
|
24098
|
-
});
|
|
24099
|
-
return newBranch;
|
|
23662
|
+
return (0, import_graphql5.buildASTSchema)(gqlAst);
|
|
24100
23663
|
};
|
|
24101
23664
|
// Annotate the CommonJS export names for ESM import in node:
|
|
24102
23665
|
0 && (module.exports = {
|
|
24103
|
-
FilesystemBridge,
|
|
24104
|
-
FilesystemStore,
|
|
24105
|
-
GithubBridge,
|
|
24106
|
-
GithubStore,
|
|
24107
|
-
LevelStore,
|
|
24108
|
-
MemoryStore,
|
|
24109
23666
|
buildSchema,
|
|
24110
|
-
createBranch,
|
|
24111
23667
|
createDatabase,
|
|
24112
23668
|
indexDB,
|
|
24113
|
-
|
|
24114
|
-
resolve
|
|
23669
|
+
parseFile,
|
|
23670
|
+
resolve,
|
|
23671
|
+
sequential,
|
|
23672
|
+
stringifyFile
|
|
24115
23673
|
});
|
|
24116
23674
|
/*!
|
|
24117
23675
|
* Determine if an object is a Buffer
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/graphql",
|
|
3
|
-
"version": "0.59.
|
|
3
|
+
"version": "0.59.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -45,9 +45,6 @@
|
|
|
45
45
|
"test": "jest"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@octokit/auth-app": "^2.6.0",
|
|
49
|
-
"@octokit/graphql": "^4.5.6",
|
|
50
|
-
"@octokit/rest": "18.0.6",
|
|
51
48
|
"body-parser": "^1.19.0",
|
|
52
49
|
"cors": "^2.8.5",
|
|
53
50
|
"dataloader": "^2.0.0",
|
|
@@ -63,15 +60,12 @@
|
|
|
63
60
|
"graphql-type-json": "^0.3.2",
|
|
64
61
|
"gray-matter": "^4.0.2",
|
|
65
62
|
"js-yaml": "^3.14.0",
|
|
66
|
-
"level": "^7.0.1",
|
|
67
|
-
"levelup": "^5.1.1",
|
|
68
63
|
"lodash": "^4.17.20",
|
|
69
64
|
"mdast": "^3.0.0",
|
|
70
65
|
"mdast-util-from-markdown": "^1.0.0",
|
|
71
66
|
"mdast-util-mdx": "^1.1.0",
|
|
72
67
|
"mdast-util-mdx-expression": "^1.1.0",
|
|
73
68
|
"mdast-util-to-markdown": "^1.2.1",
|
|
74
|
-
"memdown": "^6.1.1",
|
|
75
69
|
"micromark-extension-mdxjs": "^1.0.0",
|
|
76
70
|
"mocha": "^9.1.1",
|
|
77
71
|
"normalize-path": "^3.0.0",
|
|
@@ -100,6 +94,7 @@
|
|
|
100
94
|
"directory": "packages/tina-graphql"
|
|
101
95
|
},
|
|
102
96
|
"devDependencies": {
|
|
97
|
+
"@tinacms/datalayer": "0.0.1",
|
|
103
98
|
"@tinacms/scripts": "0.50.4",
|
|
104
99
|
"@types/cors": "^2.8.7",
|
|
105
100
|
"@types/estree": "^0.0.50",
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Copyright 2021 Forestry.io Holdings, Inc.
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
12
|
-
*/
|
|
13
|
-
import type { Bridge } from './index';
|
|
14
|
-
/**
|
|
15
|
-
* This is the bridge from whatever datasource we need for I/O.
|
|
16
|
-
* The basic example here is for the filesystem, one is needed
|
|
17
|
-
* for Github has well.
|
|
18
|
-
*/
|
|
19
|
-
export declare class FilesystemBridge implements Bridge {
|
|
20
|
-
rootPath: string;
|
|
21
|
-
constructor(rootPath: string);
|
|
22
|
-
glob(pattern: string): Promise<string[]>;
|
|
23
|
-
supportsBuilding(): boolean;
|
|
24
|
-
get(filepath: string): Promise<string>;
|
|
25
|
-
putConfig(filepath: string, data: string): Promise<void>;
|
|
26
|
-
put(filepath: string, data: string): Promise<void>;
|
|
27
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Copyright 2021 Forestry.io Holdings, Inc.
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
12
|
-
*/
|
|
13
|
-
import { Octokit } from '@octokit/rest';
|
|
14
|
-
import { Bridge } from '.';
|
|
15
|
-
export declare type GithubManagerInit = {
|
|
16
|
-
rootPath: string;
|
|
17
|
-
accessToken: string;
|
|
18
|
-
owner: string;
|
|
19
|
-
repo: string;
|
|
20
|
-
ref: string;
|
|
21
|
-
};
|
|
22
|
-
export declare class GithubBridge implements Bridge {
|
|
23
|
-
rootPath: string;
|
|
24
|
-
repoConfig: Pick<GithubManagerInit, 'owner' | 'ref' | 'repo'>;
|
|
25
|
-
appOctoKit: Octokit;
|
|
26
|
-
constructor({ rootPath, accessToken, owner, repo, ref }: GithubManagerInit);
|
|
27
|
-
private readDir;
|
|
28
|
-
supportsBuilding(): boolean;
|
|
29
|
-
glob(pattern: string): Promise<string[]>;
|
|
30
|
-
get(filepath: string): Promise<string>;
|
|
31
|
-
putConfig(filepath: string, data: string): Promise<void>;
|
|
32
|
-
put(filepath: string, data: string): Promise<void>;
|
|
33
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Copyright 2021 Forestry.io Holdings, Inc.
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
12
|
-
*/
|
|
13
|
-
import { Store } from '.';
|
|
14
|
-
export declare class FilesystemStore implements Store {
|
|
15
|
-
rootPath: string;
|
|
16
|
-
clear(): Promise<void>;
|
|
17
|
-
print(): Promise<void>;
|
|
18
|
-
constructor({ rootPath }: {
|
|
19
|
-
rootPath?: string;
|
|
20
|
-
});
|
|
21
|
-
query(queryStrings: string[]): Promise<object[]>;
|
|
22
|
-
seed(): Promise<void>;
|
|
23
|
-
get<T extends object>(filepath: string): Promise<T>;
|
|
24
|
-
supportsSeeding(): boolean;
|
|
25
|
-
supportsIndexing(): boolean;
|
|
26
|
-
glob(pattern: string, callback: any): Promise<any[]>;
|
|
27
|
-
put(filepath: string, data: object): Promise<void>;
|
|
28
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Copyright 2021 Forestry.io Holdings, Inc.
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
12
|
-
*/
|
|
13
|
-
import { Octokit } from '@octokit/rest';
|
|
14
|
-
import { Store } from '.';
|
|
15
|
-
export declare type GithubManagerInit = {
|
|
16
|
-
rootPath: string;
|
|
17
|
-
accessToken: string;
|
|
18
|
-
owner: string;
|
|
19
|
-
repo: string;
|
|
20
|
-
ref: string;
|
|
21
|
-
};
|
|
22
|
-
export declare class GithubStore implements Store {
|
|
23
|
-
rootPath: string;
|
|
24
|
-
repoConfig: Pick<GithubManagerInit, 'owner' | 'ref' | 'repo'>;
|
|
25
|
-
appOctoKit: Octokit;
|
|
26
|
-
clear(): Promise<void>;
|
|
27
|
-
print(): Promise<void>;
|
|
28
|
-
constructor({ rootPath, accessToken, owner, repo, ref }: GithubManagerInit);
|
|
29
|
-
query(queryStrings: string[]): Promise<object[]>;
|
|
30
|
-
supportsSeeding(): boolean;
|
|
31
|
-
seed(): Promise<void>;
|
|
32
|
-
private readDir;
|
|
33
|
-
glob(pattern: string, callback: any): Promise<any[]>;
|
|
34
|
-
get(filepath: string): Promise<never>;
|
|
35
|
-
supportsIndexing(): boolean;
|
|
36
|
-
put(filepath: string, data: object): Promise<void>;
|
|
37
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Copyright 2021 Forestry.io Holdings, Inc.
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
12
|
-
*/
|
|
13
|
-
import type { Store } from './index';
|
|
14
|
-
import { LevelDB } from 'level';
|
|
15
|
-
export declare class LevelStore implements Store {
|
|
16
|
-
rootPath: any;
|
|
17
|
-
db: LevelDB;
|
|
18
|
-
constructor(rootPath: string, useMemory?: boolean);
|
|
19
|
-
query(queryStrings: string[], hydrator: any): Promise<any[]>;
|
|
20
|
-
seed(filepath: string, data: object): Promise<void>;
|
|
21
|
-
supportsSeeding(): boolean;
|
|
22
|
-
supportsIndexing(): boolean;
|
|
23
|
-
print(): Promise<void>;
|
|
24
|
-
open(): Promise<void>;
|
|
25
|
-
clear(): Promise<void>;
|
|
26
|
-
glob(pattern: string, callback: any): Promise<any[]>;
|
|
27
|
-
get(filepath: string): Promise<any>;
|
|
28
|
-
put(filepath: string, data: object): Promise<void>;
|
|
29
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Copyright 2021 Forestry.io Holdings, Inc.
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
12
|
-
*/
|
|
13
|
-
import type { Store } from './index';
|
|
14
|
-
/**
|
|
15
|
-
* This is the bridge from whatever datasource we need for I/O.
|
|
16
|
-
* The basic example here is for the filesystem, one is needed
|
|
17
|
-
* for Github has well.
|
|
18
|
-
*/
|
|
19
|
-
export declare class MemoryStore implements Store {
|
|
20
|
-
rootPath: any;
|
|
21
|
-
db: any;
|
|
22
|
-
private map;
|
|
23
|
-
constructor(rootPath: string, object?: object);
|
|
24
|
-
query(queryStrings: string[], hydrator: any): Promise<any[]>;
|
|
25
|
-
seed(filepath: string, data: object): Promise<void>;
|
|
26
|
-
supportsSeeding(): boolean;
|
|
27
|
-
supportsIndexing(): boolean;
|
|
28
|
-
print(): Promise<void>;
|
|
29
|
-
clear(): Promise<void>;
|
|
30
|
-
glob(pattern: string, callback: any): Promise<any[]>;
|
|
31
|
-
get(filepath: string): Promise<any>;
|
|
32
|
-
put(filepath: string, data: object): Promise<void>;
|
|
33
|
-
}
|