@tinacms/graphql 0.58.1 → 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 +39 -0
- package/dist/build.d.ts +2 -1
- package/dist/index.d.ts +4 -19
- package/dist/index.js +440 -717
- package/dist/schema/index.d.ts +23 -3
- package/package.json +3 -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/dist/index.js
CHANGED
|
@@ -39,8 +39,8 @@ var __commonJS = (cb, mod) => function __require() {
|
|
|
39
39
|
};
|
|
40
40
|
var __export = (target, all2) => {
|
|
41
41
|
__markAsModule(target);
|
|
42
|
-
for (var
|
|
43
|
-
__defProp(target,
|
|
42
|
+
for (var name2 in all2)
|
|
43
|
+
__defProp(target, name2, { get: all2[name2], enumerable: true });
|
|
44
44
|
};
|
|
45
45
|
var __reExport = (target, module2, desc) => {
|
|
46
46
|
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
@@ -173,18 +173,18 @@ var require_extend = __commonJS({
|
|
|
173
173
|
target[options.name] = options.newValue;
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
|
-
var getProperty = function getProperty2(obj,
|
|
177
|
-
if (
|
|
178
|
-
if (!hasOwn.call(obj,
|
|
176
|
+
var getProperty = function getProperty2(obj, name2) {
|
|
177
|
+
if (name2 === "__proto__") {
|
|
178
|
+
if (!hasOwn.call(obj, name2)) {
|
|
179
179
|
return void 0;
|
|
180
180
|
} else if (gOPD) {
|
|
181
|
-
return gOPD(obj,
|
|
181
|
+
return gOPD(obj, name2).value;
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
return obj[
|
|
184
|
+
return obj[name2];
|
|
185
185
|
};
|
|
186
186
|
module2.exports = function extend2() {
|
|
187
|
-
var options,
|
|
187
|
+
var options, name2, src, copy, copyIsArray, clone;
|
|
188
188
|
var target = arguments[0];
|
|
189
189
|
var i = 1;
|
|
190
190
|
var length = arguments.length;
|
|
@@ -200,9 +200,9 @@ var require_extend = __commonJS({
|
|
|
200
200
|
for (; i < length; ++i) {
|
|
201
201
|
options = arguments[i];
|
|
202
202
|
if (options != null) {
|
|
203
|
-
for (
|
|
204
|
-
src = getProperty(target,
|
|
205
|
-
copy = getProperty(options,
|
|
203
|
+
for (name2 in options) {
|
|
204
|
+
src = getProperty(target, name2);
|
|
205
|
+
copy = getProperty(options, name2);
|
|
206
206
|
if (target !== copy) {
|
|
207
207
|
if (deep && copy && (isPlainObject2(copy) || (copyIsArray = isArray(copy)))) {
|
|
208
208
|
if (copyIsArray) {
|
|
@@ -211,9 +211,9 @@ var require_extend = __commonJS({
|
|
|
211
211
|
} else {
|
|
212
212
|
clone = src && isPlainObject2(src) ? src : {};
|
|
213
213
|
}
|
|
214
|
-
setProperty(target, { name, newValue: extend2(deep, clone, copy) });
|
|
214
|
+
setProperty(target, { name: name2, newValue: extend2(deep, clone, copy) });
|
|
215
215
|
} else if (typeof copy !== "undefined") {
|
|
216
|
-
setProperty(target, { name, newValue: copy });
|
|
216
|
+
setProperty(target, { name: name2, newValue: copy });
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
}
|
|
@@ -860,7 +860,7 @@ var require_estree_util_is_identifier_name = __commonJS({
|
|
|
860
860
|
"use strict";
|
|
861
861
|
exports.start = start;
|
|
862
862
|
exports.cont = cont;
|
|
863
|
-
exports.name =
|
|
863
|
+
exports.name = name2;
|
|
864
864
|
var id = require_regex();
|
|
865
865
|
function start(code2) {
|
|
866
866
|
return id.start.test(String.fromCharCode(code2));
|
|
@@ -869,10 +869,10 @@ var require_estree_util_is_identifier_name = __commonJS({
|
|
|
869
869
|
var character = String.fromCharCode(code2);
|
|
870
870
|
return id.start.test(character) || id.cont.test(character);
|
|
871
871
|
}
|
|
872
|
-
function
|
|
872
|
+
function name2(name3) {
|
|
873
873
|
var index2 = -1;
|
|
874
|
-
while (++index2 <
|
|
875
|
-
if (!(index2 ? cont : start)(
|
|
874
|
+
while (++index2 < name3.length) {
|
|
875
|
+
if (!(index2 ? cont : start)(name3.charCodeAt(index2)))
|
|
876
876
|
return false;
|
|
877
877
|
}
|
|
878
878
|
return index2 > 0;
|
|
@@ -1482,16 +1482,16 @@ var require_acorn = __commonJS({
|
|
|
1482
1482
|
this.binop = conf.binop || null;
|
|
1483
1483
|
this.updateContext = null;
|
|
1484
1484
|
};
|
|
1485
|
-
function binop(
|
|
1486
|
-
return new TokenType(
|
|
1485
|
+
function binop(name2, prec) {
|
|
1486
|
+
return new TokenType(name2, { beforeExpr: true, binop: prec });
|
|
1487
1487
|
}
|
|
1488
1488
|
var beforeExpr = { beforeExpr: true }, startsExpr = { startsExpr: true };
|
|
1489
1489
|
var keywords$1 = {};
|
|
1490
|
-
function kw(
|
|
1490
|
+
function kw(name2, options) {
|
|
1491
1491
|
if (options === void 0)
|
|
1492
1492
|
options = {};
|
|
1493
|
-
options.keyword =
|
|
1494
|
-
return keywords$1[
|
|
1493
|
+
options.keyword = name2;
|
|
1494
|
+
return keywords$1[name2] = new TokenType(name2, options);
|
|
1495
1495
|
}
|
|
1496
1496
|
var types = {
|
|
1497
1497
|
num: new TokenType("num", startsExpr),
|
|
@@ -1840,18 +1840,18 @@ var require_acorn = __commonJS({
|
|
|
1840
1840
|
return false;
|
|
1841
1841
|
}
|
|
1842
1842
|
};
|
|
1843
|
-
pp.isContextual = function(
|
|
1844
|
-
return this.type === types.name && this.value ===
|
|
1843
|
+
pp.isContextual = function(name2) {
|
|
1844
|
+
return this.type === types.name && this.value === name2 && !this.containsEsc;
|
|
1845
1845
|
};
|
|
1846
|
-
pp.eatContextual = function(
|
|
1847
|
-
if (!this.isContextual(
|
|
1846
|
+
pp.eatContextual = function(name2) {
|
|
1847
|
+
if (!this.isContextual(name2)) {
|
|
1848
1848
|
return false;
|
|
1849
1849
|
}
|
|
1850
1850
|
this.next();
|
|
1851
1851
|
return true;
|
|
1852
1852
|
};
|
|
1853
|
-
pp.expectContextual = function(
|
|
1854
|
-
if (!this.eatContextual(
|
|
1853
|
+
pp.expectContextual = function(name2) {
|
|
1854
|
+
if (!this.eatContextual(name2)) {
|
|
1855
1855
|
this.unexpected();
|
|
1856
1856
|
}
|
|
1857
1857
|
};
|
|
@@ -1945,8 +1945,8 @@ var require_acorn = __commonJS({
|
|
|
1945
1945
|
}
|
|
1946
1946
|
if (this.inModule) {
|
|
1947
1947
|
for (var i = 0, list3 = Object.keys(this.undefinedExports); i < list3.length; i += 1) {
|
|
1948
|
-
var
|
|
1949
|
-
this.raiseRecoverable(this.undefinedExports[
|
|
1948
|
+
var name2 = list3[i];
|
|
1949
|
+
this.raiseRecoverable(this.undefinedExports[name2].start, "Export '" + name2 + "' is not defined");
|
|
1950
1950
|
}
|
|
1951
1951
|
}
|
|
1952
1952
|
this.adaptDirectivePrologue(node.body);
|
|
@@ -2668,26 +2668,26 @@ var require_acorn = __commonJS({
|
|
|
2668
2668
|
}
|
|
2669
2669
|
};
|
|
2670
2670
|
function isPrivateNameConflicted(privateNameMap, element) {
|
|
2671
|
-
var
|
|
2672
|
-
var curr = privateNameMap[
|
|
2671
|
+
var name2 = element.key.name;
|
|
2672
|
+
var curr = privateNameMap[name2];
|
|
2673
2673
|
var next = "true";
|
|
2674
2674
|
if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) {
|
|
2675
2675
|
next = (element.static ? "s" : "i") + element.kind;
|
|
2676
2676
|
}
|
|
2677
2677
|
if (curr === "iget" && next === "iset" || curr === "iset" && next === "iget" || curr === "sget" && next === "sset" || curr === "sset" && next === "sget") {
|
|
2678
|
-
privateNameMap[
|
|
2678
|
+
privateNameMap[name2] = "true";
|
|
2679
2679
|
return false;
|
|
2680
2680
|
} else if (!curr) {
|
|
2681
|
-
privateNameMap[
|
|
2681
|
+
privateNameMap[name2] = next;
|
|
2682
2682
|
return false;
|
|
2683
2683
|
} else {
|
|
2684
2684
|
return true;
|
|
2685
2685
|
}
|
|
2686
2686
|
}
|
|
2687
|
-
function checkKeyName(node,
|
|
2687
|
+
function checkKeyName(node, name2) {
|
|
2688
2688
|
var computed = node.computed;
|
|
2689
2689
|
var key2 = node.key;
|
|
2690
|
-
return !computed && (key2.type === "Identifier" && key2.name ===
|
|
2690
|
+
return !computed && (key2.type === "Identifier" && key2.name === name2 || key2.type === "Literal" && key2.value === name2);
|
|
2691
2691
|
}
|
|
2692
2692
|
pp$1.parseExport = function(node, exports3) {
|
|
2693
2693
|
this.next();
|
|
@@ -2756,14 +2756,14 @@ var require_acorn = __commonJS({
|
|
|
2756
2756
|
}
|
|
2757
2757
|
return this.finishNode(node, "ExportNamedDeclaration");
|
|
2758
2758
|
};
|
|
2759
|
-
pp$1.checkExport = function(exports3,
|
|
2759
|
+
pp$1.checkExport = function(exports3, name2, pos) {
|
|
2760
2760
|
if (!exports3) {
|
|
2761
2761
|
return;
|
|
2762
2762
|
}
|
|
2763
|
-
if (has(exports3,
|
|
2764
|
-
this.raiseRecoverable(pos, "Duplicate export '" +
|
|
2763
|
+
if (has(exports3, name2)) {
|
|
2764
|
+
this.raiseRecoverable(pos, "Duplicate export '" + name2 + "'");
|
|
2765
2765
|
}
|
|
2766
|
-
exports3[
|
|
2766
|
+
exports3[name2] = true;
|
|
2767
2767
|
};
|
|
2768
2768
|
pp$1.checkPatternExport = function(exports3, pat) {
|
|
2769
2769
|
var type = pat.type;
|
|
@@ -3272,20 +3272,20 @@ var require_acorn = __commonJS({
|
|
|
3272
3272
|
return;
|
|
3273
3273
|
}
|
|
3274
3274
|
var key2 = prop.key;
|
|
3275
|
-
var
|
|
3275
|
+
var name2;
|
|
3276
3276
|
switch (key2.type) {
|
|
3277
3277
|
case "Identifier":
|
|
3278
|
-
|
|
3278
|
+
name2 = key2.name;
|
|
3279
3279
|
break;
|
|
3280
3280
|
case "Literal":
|
|
3281
|
-
|
|
3281
|
+
name2 = String(key2.value);
|
|
3282
3282
|
break;
|
|
3283
3283
|
default:
|
|
3284
3284
|
return;
|
|
3285
3285
|
}
|
|
3286
3286
|
var kind = prop.kind;
|
|
3287
3287
|
if (this.options.ecmaVersion >= 6) {
|
|
3288
|
-
if (
|
|
3288
|
+
if (name2 === "__proto__" && kind === "init") {
|
|
3289
3289
|
if (propHash.proto) {
|
|
3290
3290
|
if (refDestructuringErrors) {
|
|
3291
3291
|
if (refDestructuringErrors.doubleProto < 0) {
|
|
@@ -3299,8 +3299,8 @@ var require_acorn = __commonJS({
|
|
|
3299
3299
|
}
|
|
3300
3300
|
return;
|
|
3301
3301
|
}
|
|
3302
|
-
|
|
3303
|
-
var other = propHash[
|
|
3302
|
+
name2 = "$" + name2;
|
|
3303
|
+
var other = propHash[name2];
|
|
3304
3304
|
if (other) {
|
|
3305
3305
|
var redefinition;
|
|
3306
3306
|
if (kind === "init") {
|
|
@@ -3312,7 +3312,7 @@ var require_acorn = __commonJS({
|
|
|
3312
3312
|
this.raiseRecoverable(key2.start, "Redefinition of property");
|
|
3313
3313
|
}
|
|
3314
3314
|
} else {
|
|
3315
|
-
other = propHash[
|
|
3315
|
+
other = propHash[name2] = {
|
|
3316
3316
|
init: false,
|
|
3317
3317
|
get: false,
|
|
3318
3318
|
set: false
|
|
@@ -4166,31 +4166,31 @@ var require_acorn = __commonJS({
|
|
|
4166
4166
|
pp$4.checkUnreserved = function(ref2) {
|
|
4167
4167
|
var start = ref2.start;
|
|
4168
4168
|
var end = ref2.end;
|
|
4169
|
-
var
|
|
4170
|
-
if (this.inGenerator &&
|
|
4169
|
+
var name2 = ref2.name;
|
|
4170
|
+
if (this.inGenerator && name2 === "yield") {
|
|
4171
4171
|
this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator");
|
|
4172
4172
|
}
|
|
4173
|
-
if (this.inAsync &&
|
|
4173
|
+
if (this.inAsync && name2 === "await") {
|
|
4174
4174
|
this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function");
|
|
4175
4175
|
}
|
|
4176
|
-
if (this.currentThisScope().inClassFieldInit &&
|
|
4176
|
+
if (this.currentThisScope().inClassFieldInit && name2 === "arguments") {
|
|
4177
4177
|
this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer");
|
|
4178
4178
|
}
|
|
4179
|
-
if (this.inClassStaticBlock && (
|
|
4180
|
-
this.raise(start, "Cannot use " +
|
|
4179
|
+
if (this.inClassStaticBlock && (name2 === "arguments" || name2 === "await")) {
|
|
4180
|
+
this.raise(start, "Cannot use " + name2 + " in class static initialization block");
|
|
4181
4181
|
}
|
|
4182
|
-
if (this.keywords.test(
|
|
4183
|
-
this.raise(start, "Unexpected keyword '" +
|
|
4182
|
+
if (this.keywords.test(name2)) {
|
|
4183
|
+
this.raise(start, "Unexpected keyword '" + name2 + "'");
|
|
4184
4184
|
}
|
|
4185
4185
|
if (this.options.ecmaVersion < 6 && this.input.slice(start, end).indexOf("\\") !== -1) {
|
|
4186
4186
|
return;
|
|
4187
4187
|
}
|
|
4188
4188
|
var re = this.strict ? this.reservedWordsStrict : this.reservedWords;
|
|
4189
|
-
if (re.test(
|
|
4190
|
-
if (!this.inAsync &&
|
|
4189
|
+
if (re.test(name2)) {
|
|
4190
|
+
if (!this.inAsync && name2 === "await") {
|
|
4191
4191
|
this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function");
|
|
4192
4192
|
}
|
|
4193
|
-
this.raiseRecoverable(start, "The keyword '" +
|
|
4193
|
+
this.raiseRecoverable(start, "The keyword '" + name2 + "' is reserved");
|
|
4194
4194
|
}
|
|
4195
4195
|
};
|
|
4196
4196
|
pp$4.parseIdent = function(liberal, isBinding) {
|
|
@@ -4288,36 +4288,36 @@ var require_acorn = __commonJS({
|
|
|
4288
4288
|
pp$6.treatFunctionsAsVarInScope = function(scope) {
|
|
4289
4289
|
return scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_TOP;
|
|
4290
4290
|
};
|
|
4291
|
-
pp$6.declareName = function(
|
|
4291
|
+
pp$6.declareName = function(name2, bindingType, pos) {
|
|
4292
4292
|
var redeclared = false;
|
|
4293
4293
|
if (bindingType === BIND_LEXICAL) {
|
|
4294
4294
|
var scope = this.currentScope();
|
|
4295
|
-
redeclared = scope.lexical.indexOf(
|
|
4296
|
-
scope.lexical.push(
|
|
4295
|
+
redeclared = scope.lexical.indexOf(name2) > -1 || scope.functions.indexOf(name2) > -1 || scope.var.indexOf(name2) > -1;
|
|
4296
|
+
scope.lexical.push(name2);
|
|
4297
4297
|
if (this.inModule && scope.flags & SCOPE_TOP) {
|
|
4298
|
-
delete this.undefinedExports[
|
|
4298
|
+
delete this.undefinedExports[name2];
|
|
4299
4299
|
}
|
|
4300
4300
|
} else if (bindingType === BIND_SIMPLE_CATCH) {
|
|
4301
4301
|
var scope$1 = this.currentScope();
|
|
4302
|
-
scope$1.lexical.push(
|
|
4302
|
+
scope$1.lexical.push(name2);
|
|
4303
4303
|
} else if (bindingType === BIND_FUNCTION) {
|
|
4304
4304
|
var scope$2 = this.currentScope();
|
|
4305
4305
|
if (this.treatFunctionsAsVar) {
|
|
4306
|
-
redeclared = scope$2.lexical.indexOf(
|
|
4306
|
+
redeclared = scope$2.lexical.indexOf(name2) > -1;
|
|
4307
4307
|
} else {
|
|
4308
|
-
redeclared = scope$2.lexical.indexOf(
|
|
4308
|
+
redeclared = scope$2.lexical.indexOf(name2) > -1 || scope$2.var.indexOf(name2) > -1;
|
|
4309
4309
|
}
|
|
4310
|
-
scope$2.functions.push(
|
|
4310
|
+
scope$2.functions.push(name2);
|
|
4311
4311
|
} else {
|
|
4312
4312
|
for (var i = this.scopeStack.length - 1; i >= 0; --i) {
|
|
4313
4313
|
var scope$3 = this.scopeStack[i];
|
|
4314
|
-
if (scope$3.lexical.indexOf(
|
|
4314
|
+
if (scope$3.lexical.indexOf(name2) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH && scope$3.lexical[0] === name2) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name2) > -1) {
|
|
4315
4315
|
redeclared = true;
|
|
4316
4316
|
break;
|
|
4317
4317
|
}
|
|
4318
|
-
scope$3.var.push(
|
|
4318
|
+
scope$3.var.push(name2);
|
|
4319
4319
|
if (this.inModule && scope$3.flags & SCOPE_TOP) {
|
|
4320
|
-
delete this.undefinedExports[
|
|
4320
|
+
delete this.undefinedExports[name2];
|
|
4321
4321
|
}
|
|
4322
4322
|
if (scope$3.flags & SCOPE_VAR) {
|
|
4323
4323
|
break;
|
|
@@ -4325,7 +4325,7 @@ var require_acorn = __commonJS({
|
|
|
4325
4325
|
}
|
|
4326
4326
|
}
|
|
4327
4327
|
if (redeclared) {
|
|
4328
|
-
this.raiseRecoverable(pos, "Identifier '" +
|
|
4328
|
+
this.raiseRecoverable(pos, "Identifier '" + name2 + "' has already been declared");
|
|
4329
4329
|
}
|
|
4330
4330
|
};
|
|
4331
4331
|
pp$6.checkLocalExport = function(id) {
|
|
@@ -4568,8 +4568,8 @@ var require_acorn = __commonJS({
|
|
|
4568
4568
|
state.raise("Invalid escape");
|
|
4569
4569
|
}
|
|
4570
4570
|
for (var i = 0, list3 = state.backReferenceNames; i < list3.length; i += 1) {
|
|
4571
|
-
var
|
|
4572
|
-
if (state.groupNames.indexOf(
|
|
4571
|
+
var name2 = list3[i];
|
|
4572
|
+
if (state.groupNames.indexOf(name2) === -1) {
|
|
4573
4573
|
state.raise("Invalid named capture referenced");
|
|
4574
4574
|
}
|
|
4575
4575
|
}
|
|
@@ -5008,10 +5008,10 @@ var require_acorn = __commonJS({
|
|
|
5008
5008
|
pp$8.regexp_eatUnicodePropertyValueExpression = function(state) {
|
|
5009
5009
|
var start = state.pos;
|
|
5010
5010
|
if (this.regexp_eatUnicodePropertyName(state) && state.eat(61)) {
|
|
5011
|
-
var
|
|
5011
|
+
var name2 = state.lastStringValue;
|
|
5012
5012
|
if (this.regexp_eatUnicodePropertyValue(state)) {
|
|
5013
5013
|
var value = state.lastStringValue;
|
|
5014
|
-
this.regexp_validateUnicodePropertyNameAndValue(state,
|
|
5014
|
+
this.regexp_validateUnicodePropertyNameAndValue(state, name2, value);
|
|
5015
5015
|
return true;
|
|
5016
5016
|
}
|
|
5017
5017
|
}
|
|
@@ -5023,11 +5023,11 @@ var require_acorn = __commonJS({
|
|
|
5023
5023
|
}
|
|
5024
5024
|
return false;
|
|
5025
5025
|
};
|
|
5026
|
-
pp$8.regexp_validateUnicodePropertyNameAndValue = function(state,
|
|
5027
|
-
if (!has(state.unicodeProperties.nonBinary,
|
|
5026
|
+
pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name2, value) {
|
|
5027
|
+
if (!has(state.unicodeProperties.nonBinary, name2)) {
|
|
5028
5028
|
state.raise("Invalid property name");
|
|
5029
5029
|
}
|
|
5030
|
-
if (!state.unicodeProperties.nonBinary[
|
|
5030
|
+
if (!state.unicodeProperties.nonBinary[name2].test(value)) {
|
|
5031
5031
|
state.raise("Invalid property value");
|
|
5032
5032
|
}
|
|
5033
5033
|
};
|
|
@@ -6028,10 +6028,10 @@ var require_acorn = __commonJS({
|
|
|
6028
6028
|
}
|
|
6029
6029
|
return this.finishToken(type, word);
|
|
6030
6030
|
};
|
|
6031
|
-
var
|
|
6031
|
+
var version2 = "8.5.0";
|
|
6032
6032
|
Parser.acorn = {
|
|
6033
6033
|
Parser,
|
|
6034
|
-
version,
|
|
6034
|
+
version: version2,
|
|
6035
6035
|
defaultOptions,
|
|
6036
6036
|
Position,
|
|
6037
6037
|
SourceLocation,
|
|
@@ -6080,7 +6080,7 @@ var require_acorn = __commonJS({
|
|
|
6080
6080
|
exports2.tokContexts = types$1;
|
|
6081
6081
|
exports2.tokTypes = types;
|
|
6082
6082
|
exports2.tokenizer = tokenizer;
|
|
6083
|
-
exports2.version =
|
|
6083
|
+
exports2.version = version2;
|
|
6084
6084
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
6085
6085
|
});
|
|
6086
6086
|
}
|
|
@@ -6565,11 +6565,11 @@ var require_acorn_jsx = __commonJS({
|
|
|
6565
6565
|
}
|
|
6566
6566
|
jsx_parseNamespacedName() {
|
|
6567
6567
|
let startPos = this.start, startLoc = this.startLoc;
|
|
6568
|
-
let
|
|
6568
|
+
let name2 = this.jsx_parseIdentifier();
|
|
6569
6569
|
if (!options.allowNamespaces || !this.eat(tt.colon))
|
|
6570
|
-
return
|
|
6570
|
+
return name2;
|
|
6571
6571
|
var node = this.startNodeAt(startPos, startLoc);
|
|
6572
|
-
node.namespace =
|
|
6572
|
+
node.namespace = name2;
|
|
6573
6573
|
node.name = this.jsx_parseIdentifier();
|
|
6574
6574
|
return this.finishNode(node, "JSXNamespacedName");
|
|
6575
6575
|
}
|
|
@@ -9497,14 +9497,14 @@ var require_parse_entities = __commonJS({
|
|
|
9497
9497
|
var uppercaseX = 88;
|
|
9498
9498
|
var lowercaseX = 120;
|
|
9499
9499
|
var replacementCharacter = 65533;
|
|
9500
|
-
var
|
|
9500
|
+
var name2 = "named";
|
|
9501
9501
|
var hexa = "hexadecimal";
|
|
9502
9502
|
var deci = "decimal";
|
|
9503
9503
|
var bases = {};
|
|
9504
9504
|
bases[hexa] = 16;
|
|
9505
9505
|
bases[deci] = 10;
|
|
9506
9506
|
var tests = {};
|
|
9507
|
-
tests[
|
|
9507
|
+
tests[name2] = alphanumerical;
|
|
9508
9508
|
tests[deci] = decimal;
|
|
9509
9509
|
tests[hexa] = hexadecimal;
|
|
9510
9510
|
var namedNotTerminated = 1;
|
|
@@ -9608,7 +9608,7 @@ var require_parse_entities = __commonJS({
|
|
|
9608
9608
|
type = deci;
|
|
9609
9609
|
}
|
|
9610
9610
|
} else {
|
|
9611
|
-
type =
|
|
9611
|
+
type = name2;
|
|
9612
9612
|
}
|
|
9613
9613
|
entityCharacters = "";
|
|
9614
9614
|
entity = "";
|
|
@@ -9621,7 +9621,7 @@ var require_parse_entities = __commonJS({
|
|
|
9621
9621
|
break;
|
|
9622
9622
|
}
|
|
9623
9623
|
characters2 += fromCharCode2(following);
|
|
9624
|
-
if (type ===
|
|
9624
|
+
if (type === name2 && own9.call(legacy, characters2)) {
|
|
9625
9625
|
entityCharacters = characters2;
|
|
9626
9626
|
entity = legacy[characters2];
|
|
9627
9627
|
}
|
|
@@ -9629,7 +9629,7 @@ var require_parse_entities = __commonJS({
|
|
|
9629
9629
|
terminated = value.charCodeAt(end) === semicolon;
|
|
9630
9630
|
if (terminated) {
|
|
9631
9631
|
end++;
|
|
9632
|
-
namedEntity = type ===
|
|
9632
|
+
namedEntity = type === name2 ? decodeEntity2(characters2) : false;
|
|
9633
9633
|
if (namedEntity) {
|
|
9634
9634
|
entityCharacters = characters2;
|
|
9635
9635
|
entity = namedEntity;
|
|
@@ -9638,10 +9638,10 @@ var require_parse_entities = __commonJS({
|
|
|
9638
9638
|
diff = 1 + end - start;
|
|
9639
9639
|
if (!terminated && !nonTerminated) {
|
|
9640
9640
|
} else if (!characters2) {
|
|
9641
|
-
if (type !==
|
|
9641
|
+
if (type !== name2) {
|
|
9642
9642
|
warning(numericEmpty, diff);
|
|
9643
9643
|
}
|
|
9644
|
-
} else if (type ===
|
|
9644
|
+
} else if (type === name2) {
|
|
9645
9645
|
if (terminated && !entity) {
|
|
9646
9646
|
warning(namedUnknown, 1);
|
|
9647
9647
|
} else {
|
|
@@ -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"));
|
|
@@ -10478,11 +10473,11 @@ var SysFieldDefinition = {
|
|
|
10478
10473
|
};
|
|
10479
10474
|
var astBuilder = {
|
|
10480
10475
|
FormFieldBuilder: ({
|
|
10481
|
-
name,
|
|
10476
|
+
name: name2,
|
|
10482
10477
|
additionalFields
|
|
10483
10478
|
}) => {
|
|
10484
10479
|
return astBuilder.ObjectTypeDefinition({
|
|
10485
|
-
name,
|
|
10480
|
+
name: name2,
|
|
10486
10481
|
interfaces: [astBuilder.NamedType({ name: "FormField" })],
|
|
10487
10482
|
fields: [
|
|
10488
10483
|
astBuilder.FieldDefinition({
|
|
@@ -10505,14 +10500,14 @@ var astBuilder = {
|
|
|
10505
10500
|
});
|
|
10506
10501
|
},
|
|
10507
10502
|
ScalarTypeDefinition: ({
|
|
10508
|
-
name,
|
|
10503
|
+
name: name2,
|
|
10509
10504
|
description
|
|
10510
10505
|
}) => {
|
|
10511
10506
|
return {
|
|
10512
10507
|
kind: "ScalarTypeDefinition",
|
|
10513
10508
|
name: {
|
|
10514
10509
|
kind: "Name",
|
|
10515
|
-
value:
|
|
10510
|
+
value: name2
|
|
10516
10511
|
},
|
|
10517
10512
|
description: {
|
|
10518
10513
|
kind: "StringValue",
|
|
@@ -10522,7 +10517,7 @@ var astBuilder = {
|
|
|
10522
10517
|
};
|
|
10523
10518
|
},
|
|
10524
10519
|
InputValueDefinition: ({
|
|
10525
|
-
name,
|
|
10520
|
+
name: name2,
|
|
10526
10521
|
type,
|
|
10527
10522
|
list: list3,
|
|
10528
10523
|
required
|
|
@@ -10539,7 +10534,7 @@ var astBuilder = {
|
|
|
10539
10534
|
kind: "InputValueDefinition",
|
|
10540
10535
|
name: {
|
|
10541
10536
|
kind: "Name",
|
|
10542
|
-
value:
|
|
10537
|
+
value: name2
|
|
10543
10538
|
}
|
|
10544
10539
|
};
|
|
10545
10540
|
if (list3) {
|
|
@@ -10596,17 +10591,17 @@ var astBuilder = {
|
|
|
10596
10591
|
};
|
|
10597
10592
|
},
|
|
10598
10593
|
FieldNodeDefinition: ({
|
|
10599
|
-
name,
|
|
10594
|
+
name: name2,
|
|
10600
10595
|
type,
|
|
10601
10596
|
args = [],
|
|
10602
10597
|
list: list3,
|
|
10603
10598
|
required
|
|
10604
10599
|
}) => ({
|
|
10605
|
-
name: { kind: "Name", value:
|
|
10600
|
+
name: { kind: "Name", value: name2 },
|
|
10606
10601
|
kind: "Field"
|
|
10607
10602
|
}),
|
|
10608
10603
|
FieldDefinition: ({
|
|
10609
|
-
name,
|
|
10604
|
+
name: name2,
|
|
10610
10605
|
type,
|
|
10611
10606
|
args = [],
|
|
10612
10607
|
list: list3,
|
|
@@ -10624,7 +10619,7 @@ var astBuilder = {
|
|
|
10624
10619
|
kind: "FieldDefinition",
|
|
10625
10620
|
name: {
|
|
10626
10621
|
kind: "Name",
|
|
10627
|
-
value:
|
|
10622
|
+
value: name2
|
|
10628
10623
|
},
|
|
10629
10624
|
arguments: args
|
|
10630
10625
|
};
|
|
@@ -10667,7 +10662,7 @@ var astBuilder = {
|
|
|
10667
10662
|
return res;
|
|
10668
10663
|
},
|
|
10669
10664
|
InterfaceTypeDefinition: ({
|
|
10670
|
-
name,
|
|
10665
|
+
name: name2,
|
|
10671
10666
|
fields,
|
|
10672
10667
|
description = ""
|
|
10673
10668
|
}) => {
|
|
@@ -10676,7 +10671,7 @@ var astBuilder = {
|
|
|
10676
10671
|
description: { kind: "StringValue", value: description },
|
|
10677
10672
|
name: {
|
|
10678
10673
|
kind: "Name",
|
|
10679
|
-
value:
|
|
10674
|
+
value: name2
|
|
10680
10675
|
},
|
|
10681
10676
|
interfaces: [],
|
|
10682
10677
|
directives: [],
|
|
@@ -10684,45 +10679,45 @@ var astBuilder = {
|
|
|
10684
10679
|
};
|
|
10685
10680
|
},
|
|
10686
10681
|
InputObjectTypeDefinition: ({
|
|
10687
|
-
name,
|
|
10682
|
+
name: name2,
|
|
10688
10683
|
fields
|
|
10689
10684
|
}) => ({
|
|
10690
10685
|
kind: "InputObjectTypeDefinition",
|
|
10691
10686
|
name: {
|
|
10692
10687
|
kind: "Name",
|
|
10693
|
-
value:
|
|
10688
|
+
value: name2
|
|
10694
10689
|
},
|
|
10695
10690
|
fields
|
|
10696
10691
|
}),
|
|
10697
10692
|
UnionTypeDefinition: ({
|
|
10698
|
-
name,
|
|
10693
|
+
name: name2,
|
|
10699
10694
|
types
|
|
10700
10695
|
}) => ({
|
|
10701
10696
|
kind: "UnionTypeDefinition",
|
|
10702
10697
|
name: {
|
|
10703
10698
|
kind: "Name",
|
|
10704
|
-
value:
|
|
10699
|
+
value: name2
|
|
10705
10700
|
},
|
|
10706
10701
|
directives: [],
|
|
10707
|
-
types: types.map((
|
|
10702
|
+
types: types.map((name3) => ({
|
|
10708
10703
|
kind: "NamedType",
|
|
10709
10704
|
name: {
|
|
10710
10705
|
kind: "Name",
|
|
10711
|
-
value:
|
|
10706
|
+
value: name3
|
|
10712
10707
|
}
|
|
10713
10708
|
}))
|
|
10714
10709
|
}),
|
|
10715
|
-
NamedType: ({ name }) => {
|
|
10710
|
+
NamedType: ({ name: name2 }) => {
|
|
10716
10711
|
return {
|
|
10717
10712
|
kind: "NamedType",
|
|
10718
10713
|
name: {
|
|
10719
10714
|
kind: "Name",
|
|
10720
|
-
value:
|
|
10715
|
+
value: name2
|
|
10721
10716
|
}
|
|
10722
10717
|
};
|
|
10723
10718
|
},
|
|
10724
10719
|
ObjectTypeDefinition: ({
|
|
10725
|
-
name,
|
|
10720
|
+
name: name2,
|
|
10726
10721
|
fields,
|
|
10727
10722
|
interfaces = [],
|
|
10728
10723
|
directives = [],
|
|
@@ -10733,16 +10728,16 @@ var astBuilder = {
|
|
|
10733
10728
|
directives,
|
|
10734
10729
|
name: {
|
|
10735
10730
|
kind: "Name",
|
|
10736
|
-
value:
|
|
10731
|
+
value: name2
|
|
10737
10732
|
},
|
|
10738
10733
|
fields
|
|
10739
10734
|
}),
|
|
10740
10735
|
FieldWithSelectionSetDefinition: ({
|
|
10741
|
-
name,
|
|
10736
|
+
name: name2,
|
|
10742
10737
|
selections
|
|
10743
10738
|
}) => {
|
|
10744
10739
|
return {
|
|
10745
|
-
name: { kind: "Name", value:
|
|
10740
|
+
name: { kind: "Name", value: name2 },
|
|
10746
10741
|
kind: "Field",
|
|
10747
10742
|
selectionSet: {
|
|
10748
10743
|
kind: "SelectionSet",
|
|
@@ -10751,7 +10746,7 @@ var astBuilder = {
|
|
|
10751
10746
|
};
|
|
10752
10747
|
},
|
|
10753
10748
|
InlineFragmentDefinition: ({
|
|
10754
|
-
name,
|
|
10749
|
+
name: name2,
|
|
10755
10750
|
selections
|
|
10756
10751
|
}) => {
|
|
10757
10752
|
return {
|
|
@@ -10764,13 +10759,13 @@ var astBuilder = {
|
|
|
10764
10759
|
kind: "NamedType",
|
|
10765
10760
|
name: {
|
|
10766
10761
|
kind: "Name",
|
|
10767
|
-
value:
|
|
10762
|
+
value: name2
|
|
10768
10763
|
}
|
|
10769
10764
|
}
|
|
10770
10765
|
};
|
|
10771
10766
|
},
|
|
10772
10767
|
FragmentDefinition: ({
|
|
10773
|
-
name,
|
|
10768
|
+
name: name2,
|
|
10774
10769
|
fragmentName,
|
|
10775
10770
|
selections
|
|
10776
10771
|
}) => {
|
|
@@ -10784,7 +10779,7 @@ var astBuilder = {
|
|
|
10784
10779
|
kind: "NamedType",
|
|
10785
10780
|
name: {
|
|
10786
10781
|
kind: "Name",
|
|
10787
|
-
value:
|
|
10782
|
+
value: name2
|
|
10788
10783
|
}
|
|
10789
10784
|
},
|
|
10790
10785
|
directives: [],
|
|
@@ -11341,7 +11336,7 @@ var Builder = class {
|
|
|
11341
11336
|
constructor(config) {
|
|
11342
11337
|
this.config = config;
|
|
11343
11338
|
this.buildCollectionDefinition = async (collections) => {
|
|
11344
|
-
const
|
|
11339
|
+
const name2 = "getCollection";
|
|
11345
11340
|
const typeName = "Collection";
|
|
11346
11341
|
const args = [
|
|
11347
11342
|
astBuilder.InputValueDefinition({
|
|
@@ -11402,20 +11397,20 @@ var Builder = class {
|
|
|
11402
11397
|
documentsType
|
|
11403
11398
|
]
|
|
11404
11399
|
});
|
|
11405
|
-
return astBuilder.FieldDefinition({ type, name, args, required: true });
|
|
11400
|
+
return astBuilder.FieldDefinition({ type, name: name2, args, required: true });
|
|
11406
11401
|
};
|
|
11407
11402
|
this.buildMultiCollectionDefinition = async (collections) => {
|
|
11408
|
-
const
|
|
11403
|
+
const name2 = "getCollections";
|
|
11409
11404
|
const typeName = "Collection";
|
|
11410
11405
|
return astBuilder.FieldDefinition({
|
|
11411
11406
|
type: typeName,
|
|
11412
|
-
name,
|
|
11407
|
+
name: name2,
|
|
11413
11408
|
list: true,
|
|
11414
11409
|
required: true
|
|
11415
11410
|
});
|
|
11416
11411
|
};
|
|
11417
11412
|
this.multiNodeDocument = async () => {
|
|
11418
|
-
const
|
|
11413
|
+
const name2 = "node";
|
|
11419
11414
|
const args = [
|
|
11420
11415
|
astBuilder.InputValueDefinition({
|
|
11421
11416
|
name: "id",
|
|
@@ -11427,7 +11422,7 @@ var Builder = class {
|
|
|
11427
11422
|
resolveType: "nodeDocument"
|
|
11428
11423
|
});
|
|
11429
11424
|
return astBuilder.FieldDefinition({
|
|
11430
|
-
name,
|
|
11425
|
+
name: name2,
|
|
11431
11426
|
args,
|
|
11432
11427
|
list: false,
|
|
11433
11428
|
type: astBuilder.TYPES.Node,
|
|
@@ -11435,7 +11430,7 @@ var Builder = class {
|
|
|
11435
11430
|
});
|
|
11436
11431
|
};
|
|
11437
11432
|
this.multiCollectionDocument = async (collections) => {
|
|
11438
|
-
const
|
|
11433
|
+
const name2 = "getDocument";
|
|
11439
11434
|
const args = [
|
|
11440
11435
|
astBuilder.InputValueDefinition({
|
|
11441
11436
|
name: "collection",
|
|
@@ -11451,7 +11446,7 @@ var Builder = class {
|
|
|
11451
11446
|
collections
|
|
11452
11447
|
});
|
|
11453
11448
|
return astBuilder.FieldDefinition({
|
|
11454
|
-
name,
|
|
11449
|
+
name: name2,
|
|
11455
11450
|
args,
|
|
11456
11451
|
list: false,
|
|
11457
11452
|
type,
|
|
@@ -11553,7 +11548,7 @@ var Builder = class {
|
|
|
11553
11548
|
});
|
|
11554
11549
|
};
|
|
11555
11550
|
this.collectionDocument = async (collection) => {
|
|
11556
|
-
const
|
|
11551
|
+
const name2 = NAMER.queryName([collection.name]);
|
|
11557
11552
|
const type = await this._buildCollectionDocumentType(collection);
|
|
11558
11553
|
const args = [
|
|
11559
11554
|
astBuilder.InputValueDefinition({
|
|
@@ -11568,10 +11563,10 @@ var Builder = class {
|
|
|
11568
11563
|
[NAMER.createName([collection.name])]: "create",
|
|
11569
11564
|
[NAMER.updateName([collection.name])]: "update"
|
|
11570
11565
|
});
|
|
11571
|
-
return astBuilder.FieldDefinition({ type, name, args, required: true });
|
|
11566
|
+
return astBuilder.FieldDefinition({ type, name: name2, args, required: true });
|
|
11572
11567
|
};
|
|
11573
11568
|
this.collectionFragment = async (collection) => {
|
|
11574
|
-
const
|
|
11569
|
+
const name2 = NAMER.dataTypeName(collection.namespace);
|
|
11575
11570
|
const fragmentName = NAMER.fragmentName(collection.namespace);
|
|
11576
11571
|
if (typeof collection.fields === "object") {
|
|
11577
11572
|
const selections = [];
|
|
@@ -11580,7 +11575,7 @@ var Builder = class {
|
|
|
11580
11575
|
selections.push(field);
|
|
11581
11576
|
});
|
|
11582
11577
|
return astBuilder.FragmentDefinition({
|
|
11583
|
-
name,
|
|
11578
|
+
name: name2,
|
|
11584
11579
|
fragmentName,
|
|
11585
11580
|
selections: filterSelections(selections)
|
|
11586
11581
|
});
|
|
@@ -11592,7 +11587,7 @@ var Builder = class {
|
|
|
11592
11587
|
}
|
|
11593
11588
|
});
|
|
11594
11589
|
return astBuilder.FragmentDefinition({
|
|
11595
|
-
name,
|
|
11590
|
+
name: name2,
|
|
11596
11591
|
fragmentName,
|
|
11597
11592
|
selections: filterSelections(selections)
|
|
11598
11593
|
});
|
|
@@ -12059,7 +12054,7 @@ var Builder = class {
|
|
|
12059
12054
|
};
|
|
12060
12055
|
this._buildObjectOrUnionData = async (collectableTemplate) => {
|
|
12061
12056
|
if (collectableTemplate.type === "union") {
|
|
12062
|
-
const
|
|
12057
|
+
const name2 = NAMER.dataTypeName(collectableTemplate.namespace);
|
|
12063
12058
|
const typeMap = {};
|
|
12064
12059
|
const types = await sequential(collectableTemplate.templates, async (template) => {
|
|
12065
12060
|
const type = await this._buildTemplateData(template);
|
|
@@ -12067,11 +12062,11 @@ var Builder = class {
|
|
|
12067
12062
|
return type;
|
|
12068
12063
|
});
|
|
12069
12064
|
await this.database.addToLookupMap({
|
|
12070
|
-
type:
|
|
12065
|
+
type: name2,
|
|
12071
12066
|
resolveType: "unionData",
|
|
12072
12067
|
typeMap
|
|
12073
12068
|
});
|
|
12074
|
-
return astBuilder.UnionTypeDefinition({ name, types });
|
|
12069
|
+
return astBuilder.UnionTypeDefinition({ name: name2, types });
|
|
12075
12070
|
}
|
|
12076
12071
|
return this._buildTemplateData(collectableTemplate.template);
|
|
12077
12072
|
};
|
|
@@ -12194,14 +12189,14 @@ Visit https://tina.io/docs/errors/ui-not-supported/ for more information
|
|
|
12194
12189
|
type: astBuilder.TYPES.JSON
|
|
12195
12190
|
});
|
|
12196
12191
|
case "reference":
|
|
12197
|
-
const
|
|
12192
|
+
const name2 = NAMER.documentTypeName(field.namespace);
|
|
12198
12193
|
if (field.list) {
|
|
12199
12194
|
console.warn(listWarningMsg);
|
|
12200
12195
|
return this._buildMultiCollectionDocumentListDefinition({
|
|
12201
12196
|
fieldName: field.name,
|
|
12202
12197
|
namespace: field.namespace,
|
|
12203
12198
|
nodeType: astBuilder.UnionTypeDefinition({
|
|
12204
|
-
name,
|
|
12199
|
+
name: name2,
|
|
12205
12200
|
types: field.collections.map((collectionName) => NAMER.documentTypeName([collectionName]))
|
|
12206
12201
|
}),
|
|
12207
12202
|
collections: this.tinaSchema.getCollectionsByName(field.collections),
|
|
@@ -12209,7 +12204,7 @@ Visit https://tina.io/docs/errors/ui-not-supported/ for more information
|
|
|
12209
12204
|
});
|
|
12210
12205
|
} else {
|
|
12211
12206
|
const type = await this._buildMultiCollectionDocumentDefinition({
|
|
12212
|
-
fieldName:
|
|
12207
|
+
fieldName: name2,
|
|
12213
12208
|
collections: this.tinaSchema.getCollectionsByName(field.collections)
|
|
12214
12209
|
});
|
|
12215
12210
|
return astBuilder.FieldDefinition({
|
|
@@ -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 = [];
|
|
@@ -12338,6 +12369,142 @@ var validateField = async (field) => {
|
|
|
12338
12369
|
return field;
|
|
12339
12370
|
};
|
|
12340
12371
|
|
|
12372
|
+
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/package.json
|
|
12373
|
+
var name = "@tinacms/graphql";
|
|
12374
|
+
var version = "0.59.3";
|
|
12375
|
+
var main = "dist/index.js";
|
|
12376
|
+
var typings = "dist/index.d.ts";
|
|
12377
|
+
var files = [
|
|
12378
|
+
"package.json",
|
|
12379
|
+
"dist"
|
|
12380
|
+
];
|
|
12381
|
+
var license = "Apache-2.0";
|
|
12382
|
+
var buildConfig = {
|
|
12383
|
+
entryPoints: [
|
|
12384
|
+
{
|
|
12385
|
+
name: "src/index.ts",
|
|
12386
|
+
target: "node",
|
|
12387
|
+
bundle: [
|
|
12388
|
+
"mdast",
|
|
12389
|
+
"mdast-util-from-markdown",
|
|
12390
|
+
"mdast-util-mdx",
|
|
12391
|
+
"mdast-util-mdx-expression",
|
|
12392
|
+
"mdast-util-to-markdown",
|
|
12393
|
+
"micromark-extension-mdxjs",
|
|
12394
|
+
"rehype-format",
|
|
12395
|
+
"rehype-stringify",
|
|
12396
|
+
"remark",
|
|
12397
|
+
"remark-frontmatter",
|
|
12398
|
+
"remark-mdx",
|
|
12399
|
+
"remark-parse",
|
|
12400
|
+
"remark-rehype",
|
|
12401
|
+
"remark-slate",
|
|
12402
|
+
"remark-stringify",
|
|
12403
|
+
"unified",
|
|
12404
|
+
"unist-util-remove-position",
|
|
12405
|
+
"unist-util-visit",
|
|
12406
|
+
"vfile"
|
|
12407
|
+
]
|
|
12408
|
+
}
|
|
12409
|
+
]
|
|
12410
|
+
};
|
|
12411
|
+
var scripts = {
|
|
12412
|
+
types: "yarn tsc",
|
|
12413
|
+
build: 'echo "Run `yarn build` from the root of the repository instead"',
|
|
12414
|
+
docs: "yarn typedoc",
|
|
12415
|
+
serve: "yarn nodemon dist/server.js",
|
|
12416
|
+
test: "jest"
|
|
12417
|
+
};
|
|
12418
|
+
var dependencies = {
|
|
12419
|
+
"body-parser": "^1.19.0",
|
|
12420
|
+
cors: "^2.8.5",
|
|
12421
|
+
dataloader: "^2.0.0",
|
|
12422
|
+
"date-fns": "^2.21.1",
|
|
12423
|
+
"encoding-down": "^7.1.0",
|
|
12424
|
+
esbuild: "^0.12.25",
|
|
12425
|
+
"esbuild-jest": "^0.5.0",
|
|
12426
|
+
"estree-walker": "^3.0.0",
|
|
12427
|
+
"fast-glob": "^3.2.5",
|
|
12428
|
+
flat: "^5.0.2",
|
|
12429
|
+
"fs-extra": "^9.0.1",
|
|
12430
|
+
graphql: "^15.3.0",
|
|
12431
|
+
"graphql-type-json": "^0.3.2",
|
|
12432
|
+
"gray-matter": "^4.0.2",
|
|
12433
|
+
"js-yaml": "^3.14.0",
|
|
12434
|
+
lodash: "^4.17.20",
|
|
12435
|
+
mdast: "^3.0.0",
|
|
12436
|
+
"mdast-util-from-markdown": "^1.0.0",
|
|
12437
|
+
"mdast-util-mdx": "^1.1.0",
|
|
12438
|
+
"mdast-util-mdx-expression": "^1.1.0",
|
|
12439
|
+
"mdast-util-to-markdown": "^1.2.1",
|
|
12440
|
+
"micromark-extension-mdxjs": "^1.0.0",
|
|
12441
|
+
mocha: "^9.1.1",
|
|
12442
|
+
"normalize-path": "^3.0.0",
|
|
12443
|
+
prettier: "^2.2.1",
|
|
12444
|
+
"rehype-format": "^3.1.0",
|
|
12445
|
+
"rehype-stringify": "^8.0.0",
|
|
12446
|
+
remark: "^13.0.0",
|
|
12447
|
+
"remark-frontmatter": "^3.0.0",
|
|
12448
|
+
"remark-mdx": "next",
|
|
12449
|
+
"remark-parse": "^10.0.0",
|
|
12450
|
+
"remark-rehype": "^8.0.0",
|
|
12451
|
+
"remark-slate": "^1.8.0",
|
|
12452
|
+
"remark-stringify": "^8.1.1",
|
|
12453
|
+
unified: "^10.1.0",
|
|
12454
|
+
"unist-util-remove-position": "^3.0.0",
|
|
12455
|
+
"unist-util-visit": "^4.0.0",
|
|
12456
|
+
vfile: "^4.2.0",
|
|
12457
|
+
ws: "^7.3.1",
|
|
12458
|
+
yup: "^0.32.9"
|
|
12459
|
+
};
|
|
12460
|
+
var publishConfig = {
|
|
12461
|
+
registry: "https://registry.npmjs.org"
|
|
12462
|
+
};
|
|
12463
|
+
var repository = {
|
|
12464
|
+
url: "https://github.com/tinacms/tinacms.git",
|
|
12465
|
+
directory: "packages/@tinacms/graphql"
|
|
12466
|
+
};
|
|
12467
|
+
var devDependencies = {
|
|
12468
|
+
"@tinacms/datalayer": "workspace:*",
|
|
12469
|
+
"@tinacms/scripts": "workspace:*",
|
|
12470
|
+
"@types/cors": "^2.8.7",
|
|
12471
|
+
"@types/estree": "^0.0.50",
|
|
12472
|
+
"@types/express": "^4.17.8",
|
|
12473
|
+
"@types/fs-extra": "^9.0.2",
|
|
12474
|
+
"@types/jest": "^26.0.4",
|
|
12475
|
+
"@types/js-yaml": "^3.12.5",
|
|
12476
|
+
"@types/level": "^6.0.0",
|
|
12477
|
+
"@types/lodash": "^4.14.161",
|
|
12478
|
+
"@types/lodash.camelcase": "^4.3.6",
|
|
12479
|
+
"@types/lodash.upperfirst": "^4.3.6",
|
|
12480
|
+
"@types/lru-cache": "^5.1.0",
|
|
12481
|
+
"@types/mdast": "^3.0.10",
|
|
12482
|
+
"@types/node": "^14.17.34",
|
|
12483
|
+
"@types/normalize-path": "^3.0.0",
|
|
12484
|
+
"@types/ws": "^7.2.6",
|
|
12485
|
+
"@types/yup": "^0.29.7",
|
|
12486
|
+
jest: "27.0.6",
|
|
12487
|
+
"jest-diff": "27.0.6",
|
|
12488
|
+
"jest-file-snapshot": "^0.5.0",
|
|
12489
|
+
"jest-matcher-utils": "27.0.6",
|
|
12490
|
+
nodemon: "^2.0.4",
|
|
12491
|
+
typescript: "^4.3.5"
|
|
12492
|
+
};
|
|
12493
|
+
var package_default = {
|
|
12494
|
+
name,
|
|
12495
|
+
version,
|
|
12496
|
+
main,
|
|
12497
|
+
typings,
|
|
12498
|
+
files,
|
|
12499
|
+
license,
|
|
12500
|
+
buildConfig,
|
|
12501
|
+
scripts,
|
|
12502
|
+
dependencies,
|
|
12503
|
+
publishConfig,
|
|
12504
|
+
repository,
|
|
12505
|
+
devDependencies
|
|
12506
|
+
};
|
|
12507
|
+
|
|
12341
12508
|
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/resolver/error.ts
|
|
12342
12509
|
var TinaError = class extends Error {
|
|
12343
12510
|
constructor(message, extensions) {
|
|
@@ -12351,10 +12518,24 @@ var TinaError = class extends Error {
|
|
|
12351
12518
|
|
|
12352
12519
|
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/schema/index.ts
|
|
12353
12520
|
var createSchema = async ({
|
|
12354
|
-
schema
|
|
12521
|
+
schema,
|
|
12522
|
+
flags = []
|
|
12355
12523
|
}) => {
|
|
12356
12524
|
const validSchema = await validateSchema(schema);
|
|
12357
|
-
|
|
12525
|
+
const [major, minor, patch] = package_default.version.split(".");
|
|
12526
|
+
const meta = {};
|
|
12527
|
+
if (flags && flags.length > 0) {
|
|
12528
|
+
meta["flags"] = flags;
|
|
12529
|
+
}
|
|
12530
|
+
return new TinaSchema(__spreadValues({
|
|
12531
|
+
version: {
|
|
12532
|
+
fullVersion: package_default.version,
|
|
12533
|
+
major,
|
|
12534
|
+
minor,
|
|
12535
|
+
patch
|
|
12536
|
+
},
|
|
12537
|
+
meta
|
|
12538
|
+
}, validSchema));
|
|
12358
12539
|
};
|
|
12359
12540
|
var TinaSchema = class {
|
|
12360
12541
|
constructor(config) {
|
|
@@ -12508,17 +12689,24 @@ var TinaSchema = class {
|
|
|
12508
12689
|
var import_path = __toModule(require("path"));
|
|
12509
12690
|
var indexDB = async ({
|
|
12510
12691
|
database,
|
|
12511
|
-
config
|
|
12692
|
+
config,
|
|
12693
|
+
buildSDK = true
|
|
12512
12694
|
}) => {
|
|
12513
|
-
const
|
|
12695
|
+
const flags = [];
|
|
12696
|
+
if (database.store.supportsIndexing()) {
|
|
12697
|
+
flags.push("experimentalData");
|
|
12698
|
+
}
|
|
12699
|
+
const tinaSchema = await createSchema({ schema: config, flags });
|
|
12514
12700
|
const builder = await createBuilder({
|
|
12515
12701
|
database,
|
|
12516
12702
|
tinaSchema
|
|
12517
12703
|
});
|
|
12518
12704
|
const graphQLSchema = await _buildSchema(builder, tinaSchema);
|
|
12519
12705
|
await database.indexData({ graphQLSchema, tinaSchema });
|
|
12520
|
-
|
|
12521
|
-
|
|
12706
|
+
if (buildSDK) {
|
|
12707
|
+
await _buildFragments(builder, tinaSchema, database.bridge.rootPath);
|
|
12708
|
+
await _buildQueries(builder, tinaSchema, database.bridge.rootPath);
|
|
12709
|
+
}
|
|
12522
12710
|
};
|
|
12523
12711
|
var _buildFragments = async (builder, tinaSchema, rootPath) => {
|
|
12524
12712
|
const fragmentDefinitionsFields = [];
|
|
@@ -12842,13 +13030,13 @@ var VFile = class {
|
|
|
12842
13030
|
get path() {
|
|
12843
13031
|
return this.history[this.history.length - 1];
|
|
12844
13032
|
}
|
|
12845
|
-
set path(
|
|
12846
|
-
if (isUrl(
|
|
12847
|
-
|
|
13033
|
+
set path(path6) {
|
|
13034
|
+
if (isUrl(path6)) {
|
|
13035
|
+
path6 = (0, import_url.fileURLToPath)(path6);
|
|
12848
13036
|
}
|
|
12849
|
-
assertNonEmpty(
|
|
12850
|
-
if (this.path !==
|
|
12851
|
-
this.history.push(
|
|
13037
|
+
assertNonEmpty(path6, "path");
|
|
13038
|
+
if (this.path !== path6) {
|
|
13039
|
+
this.history.push(path6);
|
|
12852
13040
|
}
|
|
12853
13041
|
}
|
|
12854
13042
|
get dirname() {
|
|
@@ -12914,19 +13102,19 @@ var VFile = class {
|
|
|
12914
13102
|
throw message;
|
|
12915
13103
|
}
|
|
12916
13104
|
};
|
|
12917
|
-
function assertPart(part,
|
|
13105
|
+
function assertPart(part, name2) {
|
|
12918
13106
|
if (part && part.includes(import_path2.default.sep)) {
|
|
12919
|
-
throw new Error("`" +
|
|
13107
|
+
throw new Error("`" + name2 + "` cannot be a path: did not expect `" + import_path2.default.sep + "`");
|
|
12920
13108
|
}
|
|
12921
13109
|
}
|
|
12922
|
-
function assertNonEmpty(part,
|
|
13110
|
+
function assertNonEmpty(part, name2) {
|
|
12923
13111
|
if (!part) {
|
|
12924
|
-
throw new Error("`" +
|
|
13112
|
+
throw new Error("`" + name2 + "` cannot be empty");
|
|
12925
13113
|
}
|
|
12926
13114
|
}
|
|
12927
|
-
function assertPath(
|
|
12928
|
-
if (!
|
|
12929
|
-
throw new Error("Setting `" +
|
|
13115
|
+
function assertPath(path6, name2) {
|
|
13116
|
+
if (!path6) {
|
|
13117
|
+
throw new Error("Setting `" + name2 + "` requires `path` to be set too");
|
|
12930
13118
|
}
|
|
12931
13119
|
}
|
|
12932
13120
|
|
|
@@ -13176,8 +13364,8 @@ function base() {
|
|
|
13176
13364
|
}
|
|
13177
13365
|
}
|
|
13178
13366
|
}
|
|
13179
|
-
function newable(value,
|
|
13180
|
-
return typeof value === "function" && value.prototype && (keys(value.prototype) ||
|
|
13367
|
+
function newable(value, name2) {
|
|
13368
|
+
return typeof value === "function" && value.prototype && (keys(value.prototype) || name2 in value.prototype);
|
|
13181
13369
|
}
|
|
13182
13370
|
function keys(value) {
|
|
13183
13371
|
let key2;
|
|
@@ -13188,19 +13376,19 @@ function keys(value) {
|
|
|
13188
13376
|
}
|
|
13189
13377
|
return false;
|
|
13190
13378
|
}
|
|
13191
|
-
function assertParser(
|
|
13379
|
+
function assertParser(name2, value) {
|
|
13192
13380
|
if (typeof value !== "function") {
|
|
13193
|
-
throw new TypeError("Cannot `" +
|
|
13381
|
+
throw new TypeError("Cannot `" + name2 + "` without `Parser`");
|
|
13194
13382
|
}
|
|
13195
13383
|
}
|
|
13196
|
-
function assertCompiler(
|
|
13384
|
+
function assertCompiler(name2, value) {
|
|
13197
13385
|
if (typeof value !== "function") {
|
|
13198
|
-
throw new TypeError("Cannot `" +
|
|
13386
|
+
throw new TypeError("Cannot `" + name2 + "` without `Compiler`");
|
|
13199
13387
|
}
|
|
13200
13388
|
}
|
|
13201
|
-
function assertUnfrozen(
|
|
13389
|
+
function assertUnfrozen(name2, frozen) {
|
|
13202
13390
|
if (frozen) {
|
|
13203
|
-
throw new Error("Cannot call `" +
|
|
13391
|
+
throw new Error("Cannot call `" + name2 + "` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.");
|
|
13204
13392
|
}
|
|
13205
13393
|
}
|
|
13206
13394
|
function assertNode(node) {
|
|
@@ -13208,9 +13396,9 @@ function assertNode(node) {
|
|
|
13208
13396
|
throw new TypeError("Expected node, got `" + node + "`");
|
|
13209
13397
|
}
|
|
13210
13398
|
}
|
|
13211
|
-
function assertDone(
|
|
13399
|
+
function assertDone(name2, asyncName, complete) {
|
|
13212
13400
|
if (!complete) {
|
|
13213
|
-
throw new Error("`" +
|
|
13401
|
+
throw new Error("`" + name2 + "` finished async. Use `" + asyncName + "` instead");
|
|
13214
13402
|
}
|
|
13215
13403
|
}
|
|
13216
13404
|
function vfile(value) {
|
|
@@ -18620,7 +18808,7 @@ function createTokenizer(parser, initialize, from) {
|
|
|
18620
18808
|
return context;
|
|
18621
18809
|
function write(slice) {
|
|
18622
18810
|
chunks = push(chunks, slice);
|
|
18623
|
-
|
|
18811
|
+
main2();
|
|
18624
18812
|
if (chunks[chunks.length - 1] !== null) {
|
|
18625
18813
|
return [];
|
|
18626
18814
|
}
|
|
@@ -18641,7 +18829,7 @@ function createTokenizer(parser, initialize, from) {
|
|
|
18641
18829
|
columnStart[value.line] = value.column;
|
|
18642
18830
|
accountForPotentialSkip();
|
|
18643
18831
|
}
|
|
18644
|
-
function
|
|
18832
|
+
function main2() {
|
|
18645
18833
|
let chunkIndex;
|
|
18646
18834
|
while (point2._index < chunks.length) {
|
|
18647
18835
|
const chunk = chunks[point2._index];
|
|
@@ -18702,7 +18890,7 @@ function createTokenizer(parser, initialize, from) {
|
|
|
18702
18890
|
function onsuccessfulconstruct(construct, info) {
|
|
18703
18891
|
addResult(construct, info.from);
|
|
18704
18892
|
}
|
|
18705
|
-
function onsuccessfulcheck(
|
|
18893
|
+
function onsuccessfulcheck(_6, info) {
|
|
18706
18894
|
info.restore();
|
|
18707
18895
|
}
|
|
18708
18896
|
function constructFactory(onreturn, fields) {
|
|
@@ -19842,11 +20030,11 @@ var visitParents = function(tree, test, visitor, reverse) {
|
|
|
19842
20030
|
factory(tree, null, [])();
|
|
19843
20031
|
function factory(node, index2, parents) {
|
|
19844
20032
|
const value = typeof node === "object" && node !== null ? node : {};
|
|
19845
|
-
let
|
|
20033
|
+
let name2;
|
|
19846
20034
|
if (typeof value.type === "string") {
|
|
19847
|
-
|
|
20035
|
+
name2 = typeof value.tagName === "string" ? value.tagName : typeof value.name === "string" ? value.name : void 0;
|
|
19848
20036
|
Object.defineProperty(visit3, "name", {
|
|
19849
|
-
value: "node (" + color(value.type + (
|
|
20037
|
+
value: "node (" + color(value.type + (name2 ? "<" + name2 + ">" : "")) + ")"
|
|
19850
20038
|
});
|
|
19851
20039
|
}
|
|
19852
20040
|
return visit3;
|
|
@@ -20390,13 +20578,13 @@ function indentLines(value, map3) {
|
|
|
20390
20578
|
}
|
|
20391
20579
|
|
|
20392
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
|
|
20393
|
-
function blockquote(node,
|
|
20581
|
+
function blockquote(node, _6, context) {
|
|
20394
20582
|
const exit2 = context.enter("blockquote");
|
|
20395
20583
|
const value = indentLines(containerFlow(node, context), map);
|
|
20396
20584
|
exit2();
|
|
20397
20585
|
return value;
|
|
20398
20586
|
}
|
|
20399
|
-
function map(line,
|
|
20587
|
+
function map(line, _6, blank) {
|
|
20400
20588
|
return ">" + (blank ? "" : " ") + line;
|
|
20401
20589
|
}
|
|
20402
20590
|
|
|
@@ -20421,7 +20609,7 @@ function listInScope(stack, list3, none) {
|
|
|
20421
20609
|
}
|
|
20422
20610
|
|
|
20423
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
|
|
20424
|
-
function hardBreak(
|
|
20612
|
+
function hardBreak(_6, _1, context, safe2) {
|
|
20425
20613
|
let index2 = -1;
|
|
20426
20614
|
while (++index2 < context.unsafe.length) {
|
|
20427
20615
|
if (context.unsafe[index2].character === "\n" && patternInScope(context.stack, context.unsafe[index2])) {
|
|
@@ -20561,7 +20749,7 @@ function escapeBackslashes(value, after) {
|
|
|
20561
20749
|
}
|
|
20562
20750
|
|
|
20563
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
|
|
20564
|
-
function code(node,
|
|
20752
|
+
function code(node, _6, context) {
|
|
20565
20753
|
const marker = checkFence(context);
|
|
20566
20754
|
const raw = node.value || "";
|
|
20567
20755
|
const suffix = marker === "`" ? "GraveAccent" : "Tilde";
|
|
@@ -20602,7 +20790,7 @@ function code(node, _8, context) {
|
|
|
20602
20790
|
exit2();
|
|
20603
20791
|
return value;
|
|
20604
20792
|
}
|
|
20605
|
-
function map2(line,
|
|
20793
|
+
function map2(line, _6, blank) {
|
|
20606
20794
|
return (blank ? "" : " ") + line;
|
|
20607
20795
|
}
|
|
20608
20796
|
|
|
@@ -20624,7 +20812,7 @@ function checkQuote(context) {
|
|
|
20624
20812
|
}
|
|
20625
20813
|
|
|
20626
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
|
|
20627
|
-
function definition2(node,
|
|
20815
|
+
function definition2(node, _6, context) {
|
|
20628
20816
|
const marker = checkQuote(context);
|
|
20629
20817
|
const suffix = marker === '"' ? "Quote" : "Apostrophe";
|
|
20630
20818
|
const exit2 = context.enter("definition");
|
|
@@ -20693,7 +20881,7 @@ function containerPhrasing(parent, context, safeOptions) {
|
|
|
20693
20881
|
|
|
20694
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
|
|
20695
20883
|
emphasis.peek = emphasisPeek;
|
|
20696
|
-
function emphasis(node,
|
|
20884
|
+
function emphasis(node, _6, context) {
|
|
20697
20885
|
const marker = checkEmphasis(context);
|
|
20698
20886
|
const exit2 = context.enter("emphasis");
|
|
20699
20887
|
const value = containerPhrasing(node, context, {
|
|
@@ -20703,7 +20891,7 @@ function emphasis(node, _8, context) {
|
|
|
20703
20891
|
exit2();
|
|
20704
20892
|
return marker + value + marker;
|
|
20705
20893
|
}
|
|
20706
|
-
function emphasisPeek(
|
|
20894
|
+
function emphasisPeek(_6, _1, context) {
|
|
20707
20895
|
return context.options.emphasis || "*";
|
|
20708
20896
|
}
|
|
20709
20897
|
|
|
@@ -20720,7 +20908,7 @@ function formatHeadingAsSetext(node, context) {
|
|
|
20720
20908
|
}
|
|
20721
20909
|
|
|
20722
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
|
|
20723
|
-
function heading(node,
|
|
20911
|
+
function heading(node, _6, context) {
|
|
20724
20912
|
const rank = Math.max(Math.min(6, node.depth || 1), 1);
|
|
20725
20913
|
if (formatHeadingAsSetext(node, context)) {
|
|
20726
20914
|
const exit3 = context.enter("headingSetext");
|
|
@@ -20757,7 +20945,7 @@ function htmlPeek() {
|
|
|
20757
20945
|
|
|
20758
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
|
|
20759
20947
|
image.peek = imagePeek;
|
|
20760
|
-
function image(node,
|
|
20948
|
+
function image(node, _6, context) {
|
|
20761
20949
|
const quote = checkQuote(context);
|
|
20762
20950
|
const suffix = quote === '"' ? "Quote" : "Apostrophe";
|
|
20763
20951
|
const exit2 = context.enter("image");
|
|
@@ -20790,7 +20978,7 @@ function imagePeek() {
|
|
|
20790
20978
|
|
|
20791
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
|
|
20792
20980
|
imageReference.peek = imageReferencePeek;
|
|
20793
|
-
function imageReference(node,
|
|
20981
|
+
function imageReference(node, _6, context) {
|
|
20794
20982
|
const type = node.referenceType;
|
|
20795
20983
|
const exit2 = context.enter("imageReference");
|
|
20796
20984
|
let subexit = context.enter("label");
|
|
@@ -20817,7 +21005,7 @@ function imageReferencePeek() {
|
|
|
20817
21005
|
|
|
20818
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
|
|
20819
21007
|
inlineCode.peek = inlineCodePeek;
|
|
20820
|
-
function inlineCode(node,
|
|
21008
|
+
function inlineCode(node, _6, context) {
|
|
20821
21009
|
let value = node.value || "";
|
|
20822
21010
|
let sequence = "`";
|
|
20823
21011
|
let index2 = -1;
|
|
@@ -20855,7 +21043,7 @@ function formatLinkAsAutolink(node, context) {
|
|
|
20855
21043
|
|
|
20856
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
|
|
20857
21045
|
link.peek = linkPeek;
|
|
20858
|
-
function link(node,
|
|
21046
|
+
function link(node, _6, context) {
|
|
20859
21047
|
const quote = checkQuote(context);
|
|
20860
21048
|
const suffix = quote === '"' ? "Quote" : "Apostrophe";
|
|
20861
21049
|
let exit2;
|
|
@@ -20894,13 +21082,13 @@ function link(node, _8, context) {
|
|
|
20894
21082
|
exit2();
|
|
20895
21083
|
return value;
|
|
20896
21084
|
}
|
|
20897
|
-
function linkPeek(node,
|
|
21085
|
+
function linkPeek(node, _6, context) {
|
|
20898
21086
|
return formatLinkAsAutolink(node, context) ? "<" : "[";
|
|
20899
21087
|
}
|
|
20900
21088
|
|
|
20901
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
|
|
20902
21090
|
linkReference.peek = linkReferencePeek;
|
|
20903
|
-
function linkReference(node,
|
|
21091
|
+
function linkReference(node, _6, context) {
|
|
20904
21092
|
const type = node.referenceType;
|
|
20905
21093
|
const exit2 = context.enter("linkReference");
|
|
20906
21094
|
let subexit = context.enter("label");
|
|
@@ -21058,7 +21246,7 @@ function listItem(node, parent, context) {
|
|
|
21058
21246
|
}
|
|
21059
21247
|
|
|
21060
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
|
|
21061
|
-
function paragraph(node,
|
|
21249
|
+
function paragraph(node, _6, context) {
|
|
21062
21250
|
const exit2 = context.enter("paragraph");
|
|
21063
21251
|
const subexit = context.enter("phrasing");
|
|
21064
21252
|
const value = containerPhrasing(node, context, { before: "\n", after: "\n" });
|
|
@@ -21068,7 +21256,7 @@ function paragraph(node, _8, context) {
|
|
|
21068
21256
|
}
|
|
21069
21257
|
|
|
21070
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
|
|
21071
|
-
function root(node,
|
|
21259
|
+
function root(node, _6, context) {
|
|
21072
21260
|
return containerFlow(node, context);
|
|
21073
21261
|
}
|
|
21074
21262
|
|
|
@@ -21083,7 +21271,7 @@ function checkStrong(context) {
|
|
|
21083
21271
|
|
|
21084
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
|
|
21085
21273
|
strong.peek = strongPeek;
|
|
21086
|
-
function strong(node,
|
|
21274
|
+
function strong(node, _6, context) {
|
|
21087
21275
|
const marker = checkStrong(context);
|
|
21088
21276
|
const exit2 = context.enter("strong");
|
|
21089
21277
|
const value = containerPhrasing(node, context, {
|
|
@@ -21093,12 +21281,12 @@ function strong(node, _8, context) {
|
|
|
21093
21281
|
exit2();
|
|
21094
21282
|
return marker + marker + value + marker + marker;
|
|
21095
21283
|
}
|
|
21096
|
-
function strongPeek(
|
|
21284
|
+
function strongPeek(_6, _1, context) {
|
|
21097
21285
|
return context.options.strong || "*";
|
|
21098
21286
|
}
|
|
21099
21287
|
|
|
21100
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
|
|
21101
|
-
function text3(node,
|
|
21289
|
+
function text3(node, _6, context, safeOptions) {
|
|
21102
21290
|
return safe(context, node.value, safeOptions);
|
|
21103
21291
|
}
|
|
21104
21292
|
|
|
@@ -21112,7 +21300,7 @@ function checkRuleRepetition(context) {
|
|
|
21112
21300
|
}
|
|
21113
21301
|
|
|
21114
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
|
|
21115
|
-
function thematicBreak2(
|
|
21303
|
+
function thematicBreak2(_6, _1, context) {
|
|
21116
21304
|
const value = (checkRule(context) + (context.options.ruleSpaces ? " " : "")).repeat(checkRuleRepetition(context));
|
|
21117
21305
|
return context.options.ruleSpaces ? value.slice(0, -1) : value;
|
|
21118
21306
|
}
|
|
@@ -21259,8 +21447,8 @@ function toMarkdown(tree, options = {}) {
|
|
|
21259
21447
|
result += "\n";
|
|
21260
21448
|
}
|
|
21261
21449
|
return result;
|
|
21262
|
-
function enter(
|
|
21263
|
-
context.stack.push(
|
|
21450
|
+
function enter(name2) {
|
|
21451
|
+
context.stack.push(name2);
|
|
21264
21452
|
return exit2;
|
|
21265
21453
|
function exit2() {
|
|
21266
21454
|
context.stack.pop();
|
|
@@ -21615,7 +21803,7 @@ var mdxJsxToMarkdown = {
|
|
|
21615
21803
|
fences: true,
|
|
21616
21804
|
resourceLink: true
|
|
21617
21805
|
};
|
|
21618
|
-
function mdxElement(node,
|
|
21806
|
+
function mdxElement(node, _6, context) {
|
|
21619
21807
|
const selfClosing = node.name && (!node.children || node.children.length === 0);
|
|
21620
21808
|
const quote = checkQuote(context);
|
|
21621
21809
|
const exit2 = context.enter(node.type);
|
|
@@ -21651,7 +21839,7 @@ function peekElement() {
|
|
|
21651
21839
|
}
|
|
21652
21840
|
function indent(value) {
|
|
21653
21841
|
return indentLines(value, map3);
|
|
21654
|
-
function map3(line,
|
|
21842
|
+
function map3(line, _6, blank) {
|
|
21655
21843
|
return (blank ? "" : " ") + line;
|
|
21656
21844
|
}
|
|
21657
21845
|
}
|
|
@@ -22033,10 +22221,17 @@ ${out}
|
|
|
22033
22221
|
console.log(e);
|
|
22034
22222
|
}
|
|
22035
22223
|
case "text":
|
|
22036
|
-
|
|
22037
|
-
|
|
22038
|
-
|
|
22039
|
-
}
|
|
22224
|
+
let returnNode = { type: "text", value: node.text || "" };
|
|
22225
|
+
if (node == null ? void 0 : node.bold) {
|
|
22226
|
+
returnNode = { type: "strong", children: [returnNode] };
|
|
22227
|
+
}
|
|
22228
|
+
if (node == null ? void 0 : node.italic) {
|
|
22229
|
+
returnNode = {
|
|
22230
|
+
type: "emphasis",
|
|
22231
|
+
children: [returnNode]
|
|
22232
|
+
};
|
|
22233
|
+
}
|
|
22234
|
+
return returnNode;
|
|
22040
22235
|
default:
|
|
22041
22236
|
console.log(`Unrecognized field type: ${node.type}`);
|
|
22042
22237
|
break;
|
|
@@ -22425,9 +22620,15 @@ var Resolver = class {
|
|
|
22425
22620
|
assertShape(rawData, (yup3) => yup3.object());
|
|
22426
22621
|
const value = rawData[field.name];
|
|
22427
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;
|
|
22428
22630
|
case "string":
|
|
22429
22631
|
case "boolean":
|
|
22430
|
-
case "datetime":
|
|
22431
22632
|
case "number":
|
|
22432
22633
|
case "reference":
|
|
22433
22634
|
case "image":
|
|
@@ -22520,7 +22721,8 @@ var Resolver = class {
|
|
|
22520
22721
|
}, field), extraFields);
|
|
22521
22722
|
case "image":
|
|
22522
22723
|
return __spreadValues(__spreadValues({
|
|
22523
|
-
component: "image"
|
|
22724
|
+
component: "image",
|
|
22725
|
+
clearable: true
|
|
22524
22726
|
}, field), extraFields);
|
|
22525
22727
|
case "string":
|
|
22526
22728
|
if (field.options) {
|
|
@@ -22655,7 +22857,7 @@ var resolve = async ({
|
|
|
22655
22857
|
const referencePathVisitor = () => {
|
|
22656
22858
|
return {
|
|
22657
22859
|
leave: {
|
|
22658
|
-
Field(node, key2, parent,
|
|
22860
|
+
Field(node, key2, parent, path6, ancestors) {
|
|
22659
22861
|
const type = typeInfo.getType();
|
|
22660
22862
|
if (type) {
|
|
22661
22863
|
const realType = (0, import_graphql3.getNamedType)(type);
|
|
@@ -22665,7 +22867,7 @@ var resolve = async ({
|
|
|
22665
22867
|
const p = [];
|
|
22666
22868
|
ancestors.forEach((item, index2) => {
|
|
22667
22869
|
var _a;
|
|
22668
|
-
const activePath =
|
|
22870
|
+
const activePath = path6[index2];
|
|
22669
22871
|
const result = item[activePath];
|
|
22670
22872
|
if ((_a = result == null ? void 0 : result.name) == null ? void 0 : _a.value) {
|
|
22671
22873
|
if (result.kind === "Field") {
|
|
@@ -22837,17 +23039,17 @@ var resolve = async ({
|
|
|
22837
23039
|
}
|
|
22838
23040
|
}
|
|
22839
23041
|
};
|
|
22840
|
-
var buildPath = (
|
|
22841
|
-
if (
|
|
22842
|
-
buildPath(
|
|
23042
|
+
var buildPath = (path6, accum) => {
|
|
23043
|
+
if (path6.prev) {
|
|
23044
|
+
buildPath(path6.prev, accum);
|
|
22843
23045
|
}
|
|
22844
|
-
accum.push(
|
|
23046
|
+
accum.push(path6.key);
|
|
22845
23047
|
return accum;
|
|
22846
23048
|
};
|
|
22847
|
-
var buildReferenceQuery = (fieldNode,
|
|
23049
|
+
var buildReferenceQuery = (fieldNode, path6) => {
|
|
22848
23050
|
if (fieldNode) {
|
|
22849
|
-
const p =
|
|
22850
|
-
const dataPath =
|
|
23051
|
+
const p = path6.map((item) => item === "data" ? "form" : item);
|
|
23052
|
+
const dataPath = path6;
|
|
22851
23053
|
const newNode = __spreadProps(__spreadValues({}, fieldNode), {
|
|
22852
23054
|
name: { kind: "Name", value: "node" },
|
|
22853
23055
|
arguments: [
|
|
@@ -23262,11 +23464,7 @@ var Database = class {
|
|
|
23262
23464
|
};
|
|
23263
23465
|
this.getGraphQLSchema = async () => {
|
|
23264
23466
|
const graphqlPath = import_path4.default.join(GENERATED_FOLDER, `_graphql.json`);
|
|
23265
|
-
|
|
23266
|
-
const _graphql = await this.store.get(graphqlPath);
|
|
23267
|
-
this._graphql = _graphql;
|
|
23268
|
-
}
|
|
23269
|
-
return this._graphql;
|
|
23467
|
+
return this.store.get(graphqlPath);
|
|
23270
23468
|
};
|
|
23271
23469
|
this.getGraphQLSchemaFromBridge = async () => {
|
|
23272
23470
|
const graphqlPath = import_path4.default.join(GENERATED_FOLDER, `_graphql.json`);
|
|
@@ -23454,499 +23652,24 @@ var _indexAttribute = async ({
|
|
|
23454
23652
|
return fieldName;
|
|
23455
23653
|
};
|
|
23456
23654
|
|
|
23457
|
-
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/database/bridge/github.ts
|
|
23458
|
-
var import_lodash8 = __toModule(require("lodash"));
|
|
23459
|
-
var import_path5 = __toModule(require("path"));
|
|
23460
|
-
var import_rest = __toModule(require("@octokit/rest"));
|
|
23461
|
-
var import_graphql5 = __toModule(require("graphql"));
|
|
23462
|
-
var GithubBridge = class {
|
|
23463
|
-
constructor({ rootPath, accessToken, owner, repo, ref }) {
|
|
23464
|
-
this.rootPath = rootPath;
|
|
23465
|
-
this.repoConfig = {
|
|
23466
|
-
owner,
|
|
23467
|
-
repo,
|
|
23468
|
-
ref
|
|
23469
|
-
};
|
|
23470
|
-
this.appOctoKit = new import_rest.Octokit({
|
|
23471
|
-
auth: accessToken
|
|
23472
|
-
});
|
|
23473
|
-
}
|
|
23474
|
-
async readDir(filepath) {
|
|
23475
|
-
const fullPath = import_path5.default.join(this.rootPath, filepath);
|
|
23476
|
-
const repos = await this.appOctoKit.repos.getContent(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23477
|
-
path: fullPath
|
|
23478
|
-
})).then(async (response) => {
|
|
23479
|
-
if (Array.isArray(response.data)) {
|
|
23480
|
-
return await Promise.all(await response.data.map(async (d) => {
|
|
23481
|
-
if (d.type === "dir") {
|
|
23482
|
-
const nestedItems = await this.readDir(d.path);
|
|
23483
|
-
if (Array.isArray(nestedItems)) {
|
|
23484
|
-
return nestedItems.map((nestedItem) => {
|
|
23485
|
-
return import_path5.default.join(d.path, nestedItem);
|
|
23486
|
-
});
|
|
23487
|
-
} else {
|
|
23488
|
-
throw new Error(`Expected items to be an array of strings for readDir at ${d.path}`);
|
|
23489
|
-
}
|
|
23490
|
-
}
|
|
23491
|
-
return d.path;
|
|
23492
|
-
}));
|
|
23493
|
-
}
|
|
23494
|
-
throw new Error(`Expected to return an array from Github directory ${import_path5.default}`);
|
|
23495
|
-
});
|
|
23496
|
-
return import_lodash8.default.flatten(repos);
|
|
23497
|
-
}
|
|
23498
|
-
supportsBuilding() {
|
|
23499
|
-
return false;
|
|
23500
|
-
}
|
|
23501
|
-
async glob(pattern) {
|
|
23502
|
-
const results = await this.readDir(pattern);
|
|
23503
|
-
return results.map((item) => item.replace(this.rootPath, "").replace(/^\/|\/$/g, ""));
|
|
23504
|
-
}
|
|
23505
|
-
async get(filepath) {
|
|
23506
|
-
const realpath = import_path5.default.join(this.rootPath, filepath);
|
|
23507
|
-
return this.appOctoKit.repos.getContent(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23508
|
-
path: realpath
|
|
23509
|
-
})).then((response) => {
|
|
23510
|
-
return Buffer.from(response.data.content, "base64").toString();
|
|
23511
|
-
}).catch((e) => {
|
|
23512
|
-
if (e.status === 401) {
|
|
23513
|
-
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 });
|
|
23514
|
-
}
|
|
23515
|
-
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 });
|
|
23516
|
-
});
|
|
23517
|
-
}
|
|
23518
|
-
async putConfig(filepath, data) {
|
|
23519
|
-
throw new Error(`Config files cannot be changed by the Github bridge`);
|
|
23520
|
-
}
|
|
23521
|
-
async put(filepath, data) {
|
|
23522
|
-
const realpath = import_path5.default.join(this.rootPath, filepath);
|
|
23523
|
-
let fileSha = void 0;
|
|
23524
|
-
try {
|
|
23525
|
-
const fileContent = await this.appOctoKit.repos.getContent(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23526
|
-
path: realpath
|
|
23527
|
-
}));
|
|
23528
|
-
fileSha = fileContent.data.sha;
|
|
23529
|
-
} catch (e) {
|
|
23530
|
-
console.log("No file exists, creating new one");
|
|
23531
|
-
}
|
|
23532
|
-
await this.appOctoKit.repos.createOrUpdateFileContents(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23533
|
-
branch: this.repoConfig.ref,
|
|
23534
|
-
path: realpath,
|
|
23535
|
-
message: "Update from GraphQL client",
|
|
23536
|
-
content: new Buffer(data).toString("base64"),
|
|
23537
|
-
sha: fileSha
|
|
23538
|
-
}));
|
|
23539
|
-
}
|
|
23540
|
-
};
|
|
23541
|
-
|
|
23542
|
-
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/database/store/github.ts
|
|
23543
|
-
var import_lodash9 = __toModule(require("lodash"));
|
|
23544
|
-
var import_path6 = __toModule(require("path"));
|
|
23545
|
-
var import_rest2 = __toModule(require("@octokit/rest"));
|
|
23546
|
-
var import_graphql6 = __toModule(require("graphql"));
|
|
23547
|
-
var GithubStore = class {
|
|
23548
|
-
async clear() {
|
|
23549
|
-
}
|
|
23550
|
-
async print() {
|
|
23551
|
-
}
|
|
23552
|
-
constructor({ rootPath, accessToken, owner, repo, ref }) {
|
|
23553
|
-
this.rootPath = rootPath;
|
|
23554
|
-
this.repoConfig = {
|
|
23555
|
-
owner,
|
|
23556
|
-
repo,
|
|
23557
|
-
ref
|
|
23558
|
-
};
|
|
23559
|
-
this.appOctoKit = new import_rest2.Octokit({
|
|
23560
|
-
auth: accessToken
|
|
23561
|
-
});
|
|
23562
|
-
}
|
|
23563
|
-
async query(queryStrings) {
|
|
23564
|
-
throw new Error(`Unable to perform query for GithubStore`);
|
|
23565
|
-
}
|
|
23566
|
-
supportsSeeding() {
|
|
23567
|
-
return false;
|
|
23568
|
-
}
|
|
23569
|
-
async seed() {
|
|
23570
|
-
throw new Error(`Seeding data is not possible for Github data store`);
|
|
23571
|
-
}
|
|
23572
|
-
async readDir(filepath) {
|
|
23573
|
-
const fullPath = import_path6.default.join(this.rootPath, filepath);
|
|
23574
|
-
const repos = await this.appOctoKit.repos.getContent(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23575
|
-
path: fullPath
|
|
23576
|
-
})).then(async (response) => {
|
|
23577
|
-
if (Array.isArray(response.data)) {
|
|
23578
|
-
return await Promise.all(await response.data.map(async (d) => {
|
|
23579
|
-
if (d.type === "dir") {
|
|
23580
|
-
const nestedItems = await this.readDir(d.path);
|
|
23581
|
-
if (Array.isArray(nestedItems)) {
|
|
23582
|
-
return nestedItems.map((nestedItem) => {
|
|
23583
|
-
return import_path6.default.join(d.path, nestedItem);
|
|
23584
|
-
});
|
|
23585
|
-
} else {
|
|
23586
|
-
throw new Error(`Expected items to be an array of strings for readDir at ${d.path}`);
|
|
23587
|
-
}
|
|
23588
|
-
}
|
|
23589
|
-
return d.path;
|
|
23590
|
-
}));
|
|
23591
|
-
}
|
|
23592
|
-
throw new Error(`Expected to return an array from Github directory ${import_path6.default}`);
|
|
23593
|
-
});
|
|
23594
|
-
return import_lodash9.default.flatten(repos);
|
|
23595
|
-
}
|
|
23596
|
-
async glob(pattern, callback) {
|
|
23597
|
-
const results = await this.readDir(pattern);
|
|
23598
|
-
const items = results.map((item) => item.replace(this.rootPath, "").replace(/^\/|\/$/g, ""));
|
|
23599
|
-
if (callback) {
|
|
23600
|
-
return sequential(items, async (item) => {
|
|
23601
|
-
return callback(item);
|
|
23602
|
-
});
|
|
23603
|
-
} else {
|
|
23604
|
-
return items;
|
|
23605
|
-
}
|
|
23606
|
-
}
|
|
23607
|
-
async get(filepath) {
|
|
23608
|
-
const realpath = import_path6.default.join(this.rootPath, filepath);
|
|
23609
|
-
return this.appOctoKit.repos.getContent(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23610
|
-
path: realpath
|
|
23611
|
-
})).then((response) => {
|
|
23612
|
-
const responseString = Buffer.from(response.data.content, "base64").toString();
|
|
23613
|
-
return parseFile(responseString, import_path6.default.extname(filepath), (yup3) => yup3.object());
|
|
23614
|
-
}).catch((e) => {
|
|
23615
|
-
if (e.status === 401) {
|
|
23616
|
-
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 });
|
|
23617
|
-
}
|
|
23618
|
-
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 });
|
|
23619
|
-
});
|
|
23620
|
-
}
|
|
23621
|
-
supportsIndexing() {
|
|
23622
|
-
return false;
|
|
23623
|
-
}
|
|
23624
|
-
async put(filepath, data) {
|
|
23625
|
-
const realpath = import_path6.default.join(this.rootPath, filepath);
|
|
23626
|
-
let fileSha = void 0;
|
|
23627
|
-
try {
|
|
23628
|
-
const fileContent = await this.appOctoKit.repos.getContent(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23629
|
-
path: realpath
|
|
23630
|
-
}));
|
|
23631
|
-
fileSha = fileContent.data.sha;
|
|
23632
|
-
} catch (e) {
|
|
23633
|
-
console.log("No file exists, creating new one");
|
|
23634
|
-
}
|
|
23635
|
-
await this.appOctoKit.repos.createOrUpdateFileContents(__spreadProps(__spreadValues({}, this.repoConfig), {
|
|
23636
|
-
branch: this.repoConfig.ref,
|
|
23637
|
-
path: realpath,
|
|
23638
|
-
message: "Update from GraphQL client",
|
|
23639
|
-
content: new Buffer(stringifyFile(data, import_path6.default.extname(filepath), false)).toString("base64"),
|
|
23640
|
-
sha: fileSha
|
|
23641
|
-
}));
|
|
23642
|
-
}
|
|
23643
|
-
};
|
|
23644
|
-
|
|
23645
|
-
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/database/bridge/filesystem.ts
|
|
23646
|
-
var import_fs_extra2 = __toModule(require("fs-extra"));
|
|
23647
|
-
var import_fast_glob = __toModule(require("fast-glob"));
|
|
23648
|
-
var import_path7 = __toModule(require("path"));
|
|
23649
|
-
var import_normalize_path = __toModule(require("normalize-path"));
|
|
23650
|
-
var FilesystemBridge = class {
|
|
23651
|
-
constructor(rootPath) {
|
|
23652
|
-
this.rootPath = rootPath || "";
|
|
23653
|
-
}
|
|
23654
|
-
async glob(pattern) {
|
|
23655
|
-
const basePath = import_path7.default.join(this.rootPath, ...pattern.split("/"));
|
|
23656
|
-
const items = await (0, import_fast_glob.default)(import_path7.default.join(basePath, "**", "/*").replace(/\\/g, "/"), {
|
|
23657
|
-
dot: true
|
|
23658
|
-
});
|
|
23659
|
-
const posixRootPath = (0, import_normalize_path.default)(this.rootPath);
|
|
23660
|
-
return items.map((item) => {
|
|
23661
|
-
return item.replace(posixRootPath, "").replace(/^\/|\/$/g, "");
|
|
23662
|
-
});
|
|
23663
|
-
}
|
|
23664
|
-
supportsBuilding() {
|
|
23665
|
-
return true;
|
|
23666
|
-
}
|
|
23667
|
-
async get(filepath) {
|
|
23668
|
-
return import_fs_extra2.default.readFileSync(import_path7.default.join(this.rootPath, filepath)).toString();
|
|
23669
|
-
}
|
|
23670
|
-
async putConfig(filepath, data) {
|
|
23671
|
-
await this.put(filepath, data);
|
|
23672
|
-
}
|
|
23673
|
-
async put(filepath, data) {
|
|
23674
|
-
await import_fs_extra2.default.outputFileSync(import_path7.default.join(this.rootPath, filepath), data);
|
|
23675
|
-
}
|
|
23676
|
-
};
|
|
23677
|
-
|
|
23678
|
-
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/database/store/filesystem.ts
|
|
23679
|
-
var import_fs_extra3 = __toModule(require("fs-extra"));
|
|
23680
|
-
var import_fast_glob2 = __toModule(require("fast-glob"));
|
|
23681
|
-
var import_path8 = __toModule(require("path"));
|
|
23682
|
-
var import_normalize_path2 = __toModule(require("normalize-path"));
|
|
23683
|
-
var FilesystemStore = class {
|
|
23684
|
-
async clear() {
|
|
23685
|
-
}
|
|
23686
|
-
async print() {
|
|
23687
|
-
}
|
|
23688
|
-
constructor({ rootPath }) {
|
|
23689
|
-
this.rootPath = rootPath || "";
|
|
23690
|
-
}
|
|
23691
|
-
async query(queryStrings) {
|
|
23692
|
-
throw new Error(`Unable to perform query for Filesystem store`);
|
|
23693
|
-
}
|
|
23694
|
-
async seed() {
|
|
23695
|
-
throw new Error(`Seeding data is not possible for Filesystem store`);
|
|
23696
|
-
}
|
|
23697
|
-
async get(filepath) {
|
|
23698
|
-
return parseFile(await import_fs_extra3.default.readFileSync(import_path8.default.join(this.rootPath, filepath)).toString(), import_path8.default.extname(filepath), (yup3) => yup3.object());
|
|
23699
|
-
}
|
|
23700
|
-
supportsSeeding() {
|
|
23701
|
-
return false;
|
|
23702
|
-
}
|
|
23703
|
-
supportsIndexing() {
|
|
23704
|
-
return false;
|
|
23705
|
-
}
|
|
23706
|
-
async glob(pattern, callback) {
|
|
23707
|
-
const basePath = import_path8.default.join(this.rootPath, ...pattern.split("/"));
|
|
23708
|
-
const itemsRaw = await (0, import_fast_glob2.default)(import_path8.default.join(basePath, "**", "/*").replace(/\\/g, "/"), {
|
|
23709
|
-
dot: true
|
|
23710
|
-
});
|
|
23711
|
-
const posixRootPath = (0, import_normalize_path2.default)(this.rootPath);
|
|
23712
|
-
const items = itemsRaw.map((item) => {
|
|
23713
|
-
return item.replace(posixRootPath, "").replace(/^\/|\/$/g, "");
|
|
23714
|
-
});
|
|
23715
|
-
if (callback) {
|
|
23716
|
-
return sequential(items, async (item) => {
|
|
23717
|
-
return callback(item);
|
|
23718
|
-
});
|
|
23719
|
-
} else {
|
|
23720
|
-
return items;
|
|
23721
|
-
}
|
|
23722
|
-
}
|
|
23723
|
-
async put(filepath, data) {
|
|
23724
|
-
await import_fs_extra3.default.outputFileSync(import_path8.default.join(this.rootPath, filepath), stringifyFile(data, import_path8.default.extname(filepath), false));
|
|
23725
|
-
}
|
|
23726
|
-
};
|
|
23727
|
-
|
|
23728
|
-
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/database/store/memory.ts
|
|
23729
|
-
var MemoryStore = class {
|
|
23730
|
-
constructor(rootPath, object2 = {}) {
|
|
23731
|
-
this.map = object2;
|
|
23732
|
-
this.rootPath = rootPath || "";
|
|
23733
|
-
this.db = {
|
|
23734
|
-
get: async (filepath) => {
|
|
23735
|
-
return this.map[filepath];
|
|
23736
|
-
},
|
|
23737
|
-
put: async (filepath, content3) => {
|
|
23738
|
-
this.map[filepath] = content3;
|
|
23739
|
-
await this.print();
|
|
23740
|
-
}
|
|
23741
|
-
};
|
|
23742
|
-
}
|
|
23743
|
-
async query(queryStrings, hydrator) {
|
|
23744
|
-
const resultSets = await sequential(queryStrings, async (queryString) => {
|
|
23745
|
-
const res = await this.get(queryString);
|
|
23746
|
-
return res || [];
|
|
23747
|
-
});
|
|
23748
|
-
let items = [];
|
|
23749
|
-
if (resultSets.length > 0) {
|
|
23750
|
-
items = resultSets.reduce((p, c) => p.filter((e) => c.includes(e)));
|
|
23751
|
-
}
|
|
23752
|
-
return sequential(items, async (documentString) => {
|
|
23753
|
-
return hydrator(documentString);
|
|
23754
|
-
});
|
|
23755
|
-
}
|
|
23756
|
-
async seed(filepath, data) {
|
|
23757
|
-
await this.put(filepath, data);
|
|
23758
|
-
}
|
|
23759
|
-
supportsSeeding() {
|
|
23760
|
-
return true;
|
|
23761
|
-
}
|
|
23762
|
-
supportsIndexing() {
|
|
23763
|
-
return true;
|
|
23764
|
-
}
|
|
23765
|
-
async print() {
|
|
23766
|
-
}
|
|
23767
|
-
async clear() {
|
|
23768
|
-
this.map = {};
|
|
23769
|
-
}
|
|
23770
|
-
async glob(pattern, callback) {
|
|
23771
|
-
const strings = Object.keys(this.map).filter((key2) => {
|
|
23772
|
-
if (key2.startsWith(pattern)) {
|
|
23773
|
-
return true;
|
|
23774
|
-
} else {
|
|
23775
|
-
return false;
|
|
23776
|
-
}
|
|
23777
|
-
});
|
|
23778
|
-
if (callback) {
|
|
23779
|
-
return sequential(strings, async (item) => {
|
|
23780
|
-
return callback(item);
|
|
23781
|
-
});
|
|
23782
|
-
} else {
|
|
23783
|
-
return strings;
|
|
23784
|
-
}
|
|
23785
|
-
}
|
|
23786
|
-
async get(filepath) {
|
|
23787
|
-
const content3 = await this.db.get(filepath);
|
|
23788
|
-
return content3;
|
|
23789
|
-
}
|
|
23790
|
-
async put(filepath, data) {
|
|
23791
|
-
await this.db.put(filepath, data);
|
|
23792
|
-
}
|
|
23793
|
-
};
|
|
23794
|
-
|
|
23795
|
-
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/database/store/level.ts
|
|
23796
|
-
var import_path9 = __toModule(require("path"));
|
|
23797
|
-
var import_level = __toModule(require("level"));
|
|
23798
|
-
var import_levelup = __toModule(require("levelup"));
|
|
23799
|
-
var import_memdown = __toModule(require("memdown"));
|
|
23800
|
-
var import_encoding_down = __toModule(require("encoding-down"));
|
|
23801
|
-
var LevelStore = class {
|
|
23802
|
-
constructor(rootPath, useMemory = false) {
|
|
23803
|
-
this.rootPath = rootPath || "";
|
|
23804
|
-
if (useMemory) {
|
|
23805
|
-
const db = (0, import_levelup.default)((0, import_encoding_down.default)((0, import_memdown.default)(), { valueEncoding: "json" }));
|
|
23806
|
-
this.db = db;
|
|
23807
|
-
} else {
|
|
23808
|
-
const db = (0, import_level.default)(import_path9.default.join(rootPath, ".tina/__generated__/db"), {
|
|
23809
|
-
valueEncoding: "json"
|
|
23810
|
-
});
|
|
23811
|
-
this.db = db;
|
|
23812
|
-
}
|
|
23813
|
-
}
|
|
23814
|
-
async query(queryStrings, hydrator) {
|
|
23815
|
-
const resultSets = await sequential(queryStrings, async (queryString) => {
|
|
23816
|
-
let strings = [];
|
|
23817
|
-
const p = new Promise((resolve2, reject) => {
|
|
23818
|
-
this.db.createReadStream({
|
|
23819
|
-
gte: queryString,
|
|
23820
|
-
lte: queryString + "\xFF"
|
|
23821
|
-
}).on("data", (data) => {
|
|
23822
|
-
strings = [...strings, ...data.value];
|
|
23823
|
-
}).on("error", (message) => {
|
|
23824
|
-
reject(message);
|
|
23825
|
-
}).on("end", function() {
|
|
23826
|
-
resolve2();
|
|
23827
|
-
});
|
|
23828
|
-
});
|
|
23829
|
-
await p;
|
|
23830
|
-
return strings || [];
|
|
23831
|
-
});
|
|
23832
|
-
let items = [];
|
|
23833
|
-
if (resultSets.length > 0) {
|
|
23834
|
-
items = resultSets.reduce((p, c) => p.filter((e) => c.includes(e)));
|
|
23835
|
-
}
|
|
23836
|
-
return sequential(items, async (documentString) => {
|
|
23837
|
-
return hydrator(documentString);
|
|
23838
|
-
});
|
|
23839
|
-
}
|
|
23840
|
-
async seed(filepath, data) {
|
|
23841
|
-
await this.put(filepath, data);
|
|
23842
|
-
}
|
|
23843
|
-
supportsSeeding() {
|
|
23844
|
-
return true;
|
|
23845
|
-
}
|
|
23846
|
-
supportsIndexing() {
|
|
23847
|
-
return true;
|
|
23848
|
-
}
|
|
23849
|
-
async print() {
|
|
23850
|
-
this.db.createReadStream().on("data", function(data) {
|
|
23851
|
-
console.log(data.key, "=", data.value);
|
|
23852
|
-
}).on("error", function(err) {
|
|
23853
|
-
console.log("Oh my!", err);
|
|
23854
|
-
}).on("close", function() {
|
|
23855
|
-
console.log("Stream closed");
|
|
23856
|
-
}).on("end", function() {
|
|
23857
|
-
console.log("Stream ended");
|
|
23858
|
-
});
|
|
23859
|
-
}
|
|
23860
|
-
async open() {
|
|
23861
|
-
await this.db.open();
|
|
23862
|
-
}
|
|
23863
|
-
async clear() {
|
|
23864
|
-
await this.db.clear();
|
|
23865
|
-
}
|
|
23866
|
-
async glob(pattern, callback) {
|
|
23867
|
-
const strings = [];
|
|
23868
|
-
const p = new Promise((resolve2, reject) => {
|
|
23869
|
-
this.db.createKeyStream({
|
|
23870
|
-
gte: pattern,
|
|
23871
|
-
lte: pattern + "\xFF"
|
|
23872
|
-
}).on("data", (data) => {
|
|
23873
|
-
strings.push(data);
|
|
23874
|
-
}).on("error", (message) => {
|
|
23875
|
-
reject(message);
|
|
23876
|
-
}).on("end", function() {
|
|
23877
|
-
resolve2();
|
|
23878
|
-
});
|
|
23879
|
-
});
|
|
23880
|
-
await p;
|
|
23881
|
-
if (callback) {
|
|
23882
|
-
return sequential(strings, async (item) => {
|
|
23883
|
-
return callback(item);
|
|
23884
|
-
});
|
|
23885
|
-
} else {
|
|
23886
|
-
return strings;
|
|
23887
|
-
}
|
|
23888
|
-
}
|
|
23889
|
-
async get(filepath) {
|
|
23890
|
-
try {
|
|
23891
|
-
const content3 = await this.db.get(filepath);
|
|
23892
|
-
return content3;
|
|
23893
|
-
} catch (e) {
|
|
23894
|
-
return void 0;
|
|
23895
|
-
}
|
|
23896
|
-
}
|
|
23897
|
-
async put(filepath, data) {
|
|
23898
|
-
await this.db.put(filepath, data);
|
|
23899
|
-
}
|
|
23900
|
-
};
|
|
23901
|
-
|
|
23902
23655
|
// pnp:/Users/jeffsee/code/tinacms/packages/@tinacms/graphql/src/index.ts
|
|
23903
|
-
var import_rest3 = __toModule(require("@octokit/rest"));
|
|
23904
23656
|
var buildSchema = async (rootPath, database) => {
|
|
23905
|
-
const tempConfig =
|
|
23906
|
-
const config = await
|
|
23907
|
-
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 });
|
|
23908
23660
|
await indexDB({ database, config: JSON.parse(config) });
|
|
23909
23661
|
const gqlAst = await database.getGraphQLSchemaFromBridge();
|
|
23910
|
-
return (0,
|
|
23911
|
-
};
|
|
23912
|
-
var listBranches = async ({ auth, owner, repo }) => {
|
|
23913
|
-
const appOctoKit = new import_rest3.Octokit({ auth });
|
|
23914
|
-
const branchList = await appOctoKit.repos.listBranches({
|
|
23915
|
-
owner,
|
|
23916
|
-
repo,
|
|
23917
|
-
per_page: 100
|
|
23918
|
-
});
|
|
23919
|
-
return branchList;
|
|
23920
|
-
};
|
|
23921
|
-
var createBranch = async ({ auth, owner, repo, name, baseBranch }) => {
|
|
23922
|
-
const appOctoKit = new import_rest3.Octokit({ auth });
|
|
23923
|
-
const currentBranch = await appOctoKit.repos.getBranch({
|
|
23924
|
-
owner,
|
|
23925
|
-
repo,
|
|
23926
|
-
branch: baseBranch
|
|
23927
|
-
});
|
|
23928
|
-
const newBranch = await appOctoKit.git.createRef({
|
|
23929
|
-
owner,
|
|
23930
|
-
repo,
|
|
23931
|
-
ref: `refs/heads/${name}`,
|
|
23932
|
-
sha: currentBranch.data.commit.sha
|
|
23933
|
-
});
|
|
23934
|
-
return newBranch;
|
|
23662
|
+
return (0, import_graphql5.buildASTSchema)(gqlAst);
|
|
23935
23663
|
};
|
|
23936
23664
|
// Annotate the CommonJS export names for ESM import in node:
|
|
23937
23665
|
0 && (module.exports = {
|
|
23938
|
-
FilesystemBridge,
|
|
23939
|
-
FilesystemStore,
|
|
23940
|
-
GithubBridge,
|
|
23941
|
-
GithubStore,
|
|
23942
|
-
LevelStore,
|
|
23943
|
-
MemoryStore,
|
|
23944
23666
|
buildSchema,
|
|
23945
|
-
createBranch,
|
|
23946
23667
|
createDatabase,
|
|
23947
23668
|
indexDB,
|
|
23948
|
-
|
|
23949
|
-
resolve
|
|
23669
|
+
parseFile,
|
|
23670
|
+
resolve,
|
|
23671
|
+
sequential,
|
|
23672
|
+
stringifyFile
|
|
23950
23673
|
});
|
|
23951
23674
|
/*!
|
|
23952
23675
|
* Determine if an object is a Buffer
|