@tinacms/graphql 0.0.0-20230719190441 → 0.0.0-20230720132005
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/database/index.d.ts +5 -5
- package/dist/index.d.ts +3 -2
- package/dist/index.js +26 -24
- package/dist/index.mjs +24 -23
- package/package.json +5 -5
package/dist/database/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare type IndexStatusEvent = {
|
|
|
10
10
|
declare type IndexStatusCallback = (event: IndexStatusEvent) => Promise<void>;
|
|
11
11
|
export declare type OnPutCallback = (key: string, value: any) => Promise<void>;
|
|
12
12
|
export declare type OnDeleteCallback = (key: string) => Promise<void>;
|
|
13
|
-
export
|
|
13
|
+
export interface DatabaseArgs {
|
|
14
14
|
bridge?: Bridge;
|
|
15
15
|
level: Level;
|
|
16
16
|
onPut?: (key: string, value: any) => Promise<void>;
|
|
@@ -18,8 +18,8 @@ export declare type CreateDatabase = {
|
|
|
18
18
|
tinaDirectory?: string;
|
|
19
19
|
indexStatusCallback?: IndexStatusCallback;
|
|
20
20
|
version?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export declare const
|
|
21
|
+
}
|
|
22
|
+
export declare const createDatabaseInternal: (config: DatabaseArgs) => Database;
|
|
23
23
|
/** Options for {@link Database.query} **/
|
|
24
24
|
export declare type QueryOptions = {
|
|
25
25
|
fileExtension?: string;
|
|
@@ -33,7 +33,7 @@ export declare type QueryOptions = {
|
|
|
33
33
|
folder?: string;
|
|
34
34
|
};
|
|
35
35
|
export declare class Database {
|
|
36
|
-
config:
|
|
36
|
+
config: DatabaseArgs;
|
|
37
37
|
bridge?: Bridge;
|
|
38
38
|
rootLevel: Level;
|
|
39
39
|
level: Level | undefined;
|
|
@@ -44,7 +44,7 @@ export declare class Database {
|
|
|
44
44
|
private tinaSchema;
|
|
45
45
|
private collectionIndexDefinitions;
|
|
46
46
|
private _lookup;
|
|
47
|
-
constructor(config:
|
|
47
|
+
constructor(config: DatabaseArgs);
|
|
48
48
|
private collectionForPath;
|
|
49
49
|
private getGeneratedFolder;
|
|
50
50
|
private updateDatabaseVersion;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,9 +3,10 @@ import { buildDotTinaFiles } from './build';
|
|
|
3
3
|
export { resolve } from './resolve';
|
|
4
4
|
export { transformDocumentIntoPayload } from './resolver';
|
|
5
5
|
export * from './resolver/error';
|
|
6
|
-
export { createDatabase } from './database';
|
|
7
6
|
export { TinaLevelClient } from './level/tinaLevel';
|
|
8
|
-
export type {
|
|
7
|
+
export type { Level } from './database/level';
|
|
8
|
+
export type { QueryOptions, OnDeleteCallback, OnPutCallback, DatabaseArgs, } from './database';
|
|
9
|
+
export { Database, createDatabaseInternal } from './database';
|
|
9
10
|
import type { Config } from '@tinacms/schema-tools';
|
|
10
11
|
export { getChangedFiles, getSha } from './git';
|
|
11
12
|
export { sequential, assertShape } from './util';
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
26
26
|
var src_exports = {};
|
|
27
27
|
__export(src_exports, {
|
|
28
28
|
AuditFileSystemBridge: () => AuditFileSystemBridge,
|
|
29
|
+
Database: () => Database,
|
|
29
30
|
FilesystemBridge: () => FilesystemBridge,
|
|
30
31
|
IsomorphicBridge: () => IsomorphicBridge,
|
|
31
32
|
TinaFetchError: () => TinaFetchError,
|
|
@@ -36,7 +37,7 @@ __export(src_exports, {
|
|
|
36
37
|
assertShape: () => assertShape,
|
|
37
38
|
buildDotTinaFiles: () => buildDotTinaFiles,
|
|
38
39
|
buildSchema: () => buildSchema,
|
|
39
|
-
|
|
40
|
+
createDatabaseInternal: () => createDatabaseInternal,
|
|
40
41
|
createSchema: () => createSchema,
|
|
41
42
|
getChangedFiles: () => getChangedFiles,
|
|
42
43
|
getSha: () => getSha,
|
|
@@ -5059,12 +5060,33 @@ var resolve = async ({
|
|
|
5059
5060
|
}
|
|
5060
5061
|
};
|
|
5061
5062
|
|
|
5063
|
+
// src/level/tinaLevel.ts
|
|
5064
|
+
var import_many_level = require("many-level");
|
|
5065
|
+
var import_readable_stream = require("readable-stream");
|
|
5066
|
+
var import_net = require("net");
|
|
5067
|
+
var TinaLevelClient = class extends import_many_level.ManyLevelGuest {
|
|
5068
|
+
constructor(port) {
|
|
5069
|
+
super();
|
|
5070
|
+
this._connected = false;
|
|
5071
|
+
this.port = port || 9e3;
|
|
5072
|
+
}
|
|
5073
|
+
openConnection() {
|
|
5074
|
+
if (this._connected)
|
|
5075
|
+
return;
|
|
5076
|
+
const socket = (0, import_net.connect)(this.port);
|
|
5077
|
+
(0, import_readable_stream.pipeline)(socket, this.createRpcStream(), socket, () => {
|
|
5078
|
+
this._connected = false;
|
|
5079
|
+
});
|
|
5080
|
+
this._connected = true;
|
|
5081
|
+
}
|
|
5082
|
+
};
|
|
5083
|
+
|
|
5062
5084
|
// src/database/index.ts
|
|
5063
5085
|
var import_path4 = __toESM(require("path"));
|
|
5064
5086
|
var import_graphql5 = require("graphql");
|
|
5065
5087
|
var import_micromatch2 = __toESM(require("micromatch"));
|
|
5066
5088
|
var import_js_sha12 = __toESM(require("js-sha1"));
|
|
5067
|
-
var
|
|
5089
|
+
var createDatabaseInternal = (config) => {
|
|
5068
5090
|
return new Database({
|
|
5069
5091
|
...config,
|
|
5070
5092
|
bridge: config.bridge,
|
|
@@ -6049,27 +6071,6 @@ var _deleteIndexContent = async (database, documentPaths, enqueueOps, collection
|
|
|
6049
6071
|
}
|
|
6050
6072
|
};
|
|
6051
6073
|
|
|
6052
|
-
// src/level/tinaLevel.ts
|
|
6053
|
-
var import_many_level = require("many-level");
|
|
6054
|
-
var import_readable_stream = require("readable-stream");
|
|
6055
|
-
var import_net = require("net");
|
|
6056
|
-
var TinaLevelClient = class extends import_many_level.ManyLevelGuest {
|
|
6057
|
-
constructor(port) {
|
|
6058
|
-
super();
|
|
6059
|
-
this._connected = false;
|
|
6060
|
-
this.port = port || 9e3;
|
|
6061
|
-
}
|
|
6062
|
-
openConnection() {
|
|
6063
|
-
if (this._connected)
|
|
6064
|
-
return;
|
|
6065
|
-
const socket = (0, import_net.connect)(this.port);
|
|
6066
|
-
(0, import_readable_stream.pipeline)(socket, this.createRpcStream(), socket, () => {
|
|
6067
|
-
this._connected = false;
|
|
6068
|
-
});
|
|
6069
|
-
this._connected = true;
|
|
6070
|
-
}
|
|
6071
|
-
};
|
|
6072
|
-
|
|
6073
6074
|
// src/git/index.ts
|
|
6074
6075
|
var import_isomorphic_git = __toESM(require("isomorphic-git"));
|
|
6075
6076
|
var import_fs_extra = __toESM(require("fs-extra"));
|
|
@@ -6601,6 +6602,7 @@ var buildSchema = async (config, flags) => {
|
|
|
6601
6602
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6602
6603
|
0 && (module.exports = {
|
|
6603
6604
|
AuditFileSystemBridge,
|
|
6605
|
+
Database,
|
|
6604
6606
|
FilesystemBridge,
|
|
6605
6607
|
IsomorphicBridge,
|
|
6606
6608
|
TinaFetchError,
|
|
@@ -6611,7 +6613,7 @@ var buildSchema = async (config, flags) => {
|
|
|
6611
6613
|
assertShape,
|
|
6612
6614
|
buildDotTinaFiles,
|
|
6613
6615
|
buildSchema,
|
|
6614
|
-
|
|
6616
|
+
createDatabaseInternal,
|
|
6615
6617
|
createSchema,
|
|
6616
6618
|
getChangedFiles,
|
|
6617
6619
|
getSha,
|
package/dist/index.mjs
CHANGED
|
@@ -4991,12 +4991,33 @@ var resolve = async ({
|
|
|
4991
4991
|
}
|
|
4992
4992
|
};
|
|
4993
4993
|
|
|
4994
|
+
// src/level/tinaLevel.ts
|
|
4995
|
+
import { ManyLevelGuest } from "many-level";
|
|
4996
|
+
import { pipeline } from "readable-stream";
|
|
4997
|
+
import { connect } from "net";
|
|
4998
|
+
var TinaLevelClient = class extends ManyLevelGuest {
|
|
4999
|
+
constructor(port) {
|
|
5000
|
+
super();
|
|
5001
|
+
this._connected = false;
|
|
5002
|
+
this.port = port || 9e3;
|
|
5003
|
+
}
|
|
5004
|
+
openConnection() {
|
|
5005
|
+
if (this._connected)
|
|
5006
|
+
return;
|
|
5007
|
+
const socket = connect(this.port);
|
|
5008
|
+
pipeline(socket, this.createRpcStream(), socket, () => {
|
|
5009
|
+
this._connected = false;
|
|
5010
|
+
});
|
|
5011
|
+
this._connected = true;
|
|
5012
|
+
}
|
|
5013
|
+
};
|
|
5014
|
+
|
|
4994
5015
|
// src/database/index.ts
|
|
4995
5016
|
import path4 from "path";
|
|
4996
5017
|
import { GraphQLError as GraphQLError4 } from "graphql";
|
|
4997
5018
|
import micromatch2 from "micromatch";
|
|
4998
5019
|
import sha2 from "js-sha1";
|
|
4999
|
-
var
|
|
5020
|
+
var createDatabaseInternal = (config) => {
|
|
5000
5021
|
return new Database({
|
|
5001
5022
|
...config,
|
|
5002
5023
|
bridge: config.bridge,
|
|
@@ -5979,27 +6000,6 @@ var _deleteIndexContent = async (database, documentPaths, enqueueOps, collection
|
|
|
5979
6000
|
}
|
|
5980
6001
|
};
|
|
5981
6002
|
|
|
5982
|
-
// src/level/tinaLevel.ts
|
|
5983
|
-
import { ManyLevelGuest } from "many-level";
|
|
5984
|
-
import { pipeline } from "readable-stream";
|
|
5985
|
-
import { connect } from "net";
|
|
5986
|
-
var TinaLevelClient = class extends ManyLevelGuest {
|
|
5987
|
-
constructor(port) {
|
|
5988
|
-
super();
|
|
5989
|
-
this._connected = false;
|
|
5990
|
-
this.port = port || 9e3;
|
|
5991
|
-
}
|
|
5992
|
-
openConnection() {
|
|
5993
|
-
if (this._connected)
|
|
5994
|
-
return;
|
|
5995
|
-
const socket = connect(this.port);
|
|
5996
|
-
pipeline(socket, this.createRpcStream(), socket, () => {
|
|
5997
|
-
this._connected = false;
|
|
5998
|
-
});
|
|
5999
|
-
this._connected = true;
|
|
6000
|
-
}
|
|
6001
|
-
};
|
|
6002
|
-
|
|
6003
6003
|
// src/git/index.ts
|
|
6004
6004
|
import git from "isomorphic-git";
|
|
6005
6005
|
import fs from "fs-extra";
|
|
@@ -6530,6 +6530,7 @@ var buildSchema = async (config, flags) => {
|
|
|
6530
6530
|
};
|
|
6531
6531
|
export {
|
|
6532
6532
|
AuditFileSystemBridge,
|
|
6533
|
+
Database,
|
|
6533
6534
|
FilesystemBridge,
|
|
6534
6535
|
IsomorphicBridge,
|
|
6535
6536
|
TinaFetchError,
|
|
@@ -6540,7 +6541,7 @@ export {
|
|
|
6540
6541
|
assertShape,
|
|
6541
6542
|
buildDotTinaFiles,
|
|
6542
6543
|
buildSchema,
|
|
6543
|
-
|
|
6544
|
+
createDatabaseInternal,
|
|
6544
6545
|
createSchema,
|
|
6545
6546
|
getChangedFiles,
|
|
6546
6547
|
getSha,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/graphql",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-20230720132005",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"normalize-path": "^3.0.0",
|
|
47
47
|
"readable-stream": "^4.3.0",
|
|
48
48
|
"yup": "^0.32.9",
|
|
49
|
-
"@tinacms/mdx": "0.0.0-
|
|
50
|
-
"@tinacms/schema-tools": "0.0.0-
|
|
49
|
+
"@tinacms/mdx": "0.0.0-20230720132005",
|
|
50
|
+
"@tinacms/schema-tools": "0.0.0-20230720132005"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"registry": "https://registry.npmjs.org"
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"memory-level": "^1.0.0",
|
|
81
81
|
"nodemon": "2.0.19",
|
|
82
82
|
"typescript": "4.3.5",
|
|
83
|
-
"@tinacms/schema-tools": "0.0.0-
|
|
84
|
-
"@tinacms/scripts": "0.0.0-
|
|
83
|
+
"@tinacms/schema-tools": "0.0.0-20230720132005",
|
|
84
|
+
"@tinacms/scripts": "0.0.0-20230720132005"
|
|
85
85
|
},
|
|
86
86
|
"scripts": {
|
|
87
87
|
"types": "pnpm tsc",
|