@tinacms/graphql 1.4.39 → 1.5.0
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/ast-builder/index.d.ts +4 -4
- package/dist/auth/utils.d.ts +1 -1
- package/dist/build.d.ts +3 -4
- package/dist/database/bridge/isomorphic.d.ts +1 -1
- package/dist/database/datalayer.d.ts +11 -11
- package/dist/database/index.d.ts +18 -18
- package/dist/database/level.d.ts +4 -5
- package/dist/database/util.d.ts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +242 -225
- package/dist/index.mjs +219 -202
- package/dist/resolver/error.d.ts +1 -1
- package/dist/resolver/filter-utils.d.ts +1 -1
- package/dist/resolver/index.d.ts +10 -8
- package/dist/schema/validate.d.ts +1 -1
- package/dist/spec/setup.d.ts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/util.d.ts +3 -1
- package/package.json +34 -33
package/dist/index.js
CHANGED
|
@@ -61,11 +61,8 @@ __export(src_exports, {
|
|
|
61
61
|
module.exports = __toCommonJS(src_exports);
|
|
62
62
|
|
|
63
63
|
// src/build.ts
|
|
64
|
-
var import_lodash3 = __toESM(require("lodash"));
|
|
65
64
|
var import_graphql2 = require("graphql");
|
|
66
|
-
|
|
67
|
-
// src/ast-builder/index.ts
|
|
68
|
-
var import_lodash = __toESM(require("lodash"));
|
|
65
|
+
var import_lodash3 = __toESM(require("lodash.uniqby"));
|
|
69
66
|
|
|
70
67
|
// src/util.ts
|
|
71
68
|
var yup = __toESM(require("yup"));
|
|
@@ -108,8 +105,20 @@ var btoa = (string2) => {
|
|
|
108
105
|
var lastItem = (arr) => {
|
|
109
106
|
return arr[arr.length - 1];
|
|
110
107
|
};
|
|
108
|
+
var get = (obj, path7, defaultValue = void 0) => {
|
|
109
|
+
const travel = (regexp) => String.prototype.split.call(path7, regexp).filter(Boolean).reduce(
|
|
110
|
+
(res, key) => res !== null && res !== void 0 ? res[key] : res,
|
|
111
|
+
obj
|
|
112
|
+
);
|
|
113
|
+
const result = travel(/[,[\]]+?/) || travel(/[,[\].]+?/);
|
|
114
|
+
return result === void 0 || result === obj ? defaultValue : result;
|
|
115
|
+
};
|
|
116
|
+
var flattenDeep = (arr) => arr.flatMap(
|
|
117
|
+
(subArray, index) => Array.isArray(subArray) ? flattenDeep(subArray) : subArray
|
|
118
|
+
);
|
|
111
119
|
|
|
112
120
|
// src/ast-builder/index.ts
|
|
121
|
+
var import_lodash = __toESM(require("lodash.uniqby"));
|
|
113
122
|
var SysFieldDefinition = {
|
|
114
123
|
kind: "Field",
|
|
115
124
|
name: {
|
|
@@ -995,7 +1004,7 @@ var astBuilder = {
|
|
|
995
1004
|
};
|
|
996
1005
|
},
|
|
997
1006
|
toGraphQLAst: (ast) => {
|
|
998
|
-
const definitions = import_lodash.default
|
|
1007
|
+
const definitions = (0, import_lodash.default)(
|
|
999
1008
|
[
|
|
1000
1009
|
...extractInlineTypes(ast.query),
|
|
1001
1010
|
...extractInlineTypes(ast.globalTemplates),
|
|
@@ -1016,25 +1025,24 @@ var capitalize = (s) => {
|
|
|
1016
1025
|
};
|
|
1017
1026
|
var extractInlineTypes = (item) => {
|
|
1018
1027
|
if (Array.isArray(item)) {
|
|
1019
|
-
const
|
|
1028
|
+
const accumulator2 = item.map((i) => {
|
|
1020
1029
|
return extractInlineTypes(i);
|
|
1021
1030
|
});
|
|
1022
|
-
return
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
}
|
|
1031
|
+
return flattenDeep(accumulator2);
|
|
1032
|
+
}
|
|
1033
|
+
const accumulator = [item];
|
|
1034
|
+
for (const node of walk(item)) {
|
|
1035
|
+
if (node.kind === "UnionTypeDefinition") {
|
|
1036
|
+
node.types = (0, import_lodash.default)(node.types, (type) => type.name.value);
|
|
1037
|
+
}
|
|
1038
|
+
if (node.kind === "NamedType") {
|
|
1039
|
+
if (typeof node.name.value !== "string") {
|
|
1040
|
+
accumulator.push(node.name.value);
|
|
1041
|
+
node.name.value = node.name.value.name.value;
|
|
1034
1042
|
}
|
|
1035
1043
|
}
|
|
1036
|
-
return accumulator;
|
|
1037
1044
|
}
|
|
1045
|
+
return accumulator;
|
|
1038
1046
|
};
|
|
1039
1047
|
function* walk(maybeNode, visited = /* @__PURE__ */ new WeakSet()) {
|
|
1040
1048
|
if (typeof maybeNode === "string") {
|
|
@@ -2719,7 +2727,7 @@ var filterSelections = (arr) => {
|
|
|
2719
2727
|
var import_schema_tools2 = require("@tinacms/schema-tools");
|
|
2720
2728
|
|
|
2721
2729
|
// src/schema/validate.ts
|
|
2722
|
-
var import_lodash2 = __toESM(require("lodash"));
|
|
2730
|
+
var import_lodash2 = __toESM(require("lodash.clonedeep"));
|
|
2723
2731
|
var yup2 = __toESM(require("yup"));
|
|
2724
2732
|
var import_schema_tools = require("@tinacms/schema-tools");
|
|
2725
2733
|
var FIELD_TYPES = [
|
|
@@ -2735,7 +2743,7 @@ var FIELD_TYPES = [
|
|
|
2735
2743
|
];
|
|
2736
2744
|
var validateSchema = async (schema) => {
|
|
2737
2745
|
const schema2 = addNamespaceToSchema(
|
|
2738
|
-
import_lodash2.default
|
|
2746
|
+
(0, import_lodash2.default)(schema)
|
|
2739
2747
|
);
|
|
2740
2748
|
const collections = await sequential(
|
|
2741
2749
|
schema2.collections,
|
|
@@ -2843,7 +2851,7 @@ var validateCollection = async (collection) => {
|
|
|
2843
2851
|
}
|
|
2844
2852
|
if (validCollection.fields) {
|
|
2845
2853
|
if (typeof validCollection.fields === "string") {
|
|
2846
|
-
throw new Error(
|
|
2854
|
+
throw new Error("Global templates are not yet supported");
|
|
2847
2855
|
}
|
|
2848
2856
|
fields = await sequential(validCollection.fields, async (field) => {
|
|
2849
2857
|
return validateField(field);
|
|
@@ -2874,7 +2882,7 @@ var validateField = async (field) => {
|
|
|
2874
2882
|
// package.json
|
|
2875
2883
|
var package_default = {
|
|
2876
2884
|
name: "@tinacms/graphql",
|
|
2877
|
-
version: "1.
|
|
2885
|
+
version: "1.5.0",
|
|
2878
2886
|
main: "dist/index.js",
|
|
2879
2887
|
module: "dist/index.mjs",
|
|
2880
2888
|
typings: "dist/index.d.ts",
|
|
@@ -2908,24 +2916,26 @@ var package_default = {
|
|
|
2908
2916
|
"@iarna/toml": "^2.2.5",
|
|
2909
2917
|
"@tinacms/mdx": "workspace:*",
|
|
2910
2918
|
"@tinacms/schema-tools": "workspace:*",
|
|
2911
|
-
"abstract-level": "^1.0.
|
|
2912
|
-
"date-fns": "^2.
|
|
2913
|
-
"fast-glob": "^3.2
|
|
2914
|
-
"fs-extra": "^9.0
|
|
2919
|
+
"abstract-level": "^1.0.4",
|
|
2920
|
+
"date-fns": "^2.30.0",
|
|
2921
|
+
"fast-glob": "^3.3.2",
|
|
2922
|
+
"fs-extra": "^9.1.0",
|
|
2915
2923
|
"glob-parent": "^6.0.2",
|
|
2916
2924
|
graphql: "15.8.0",
|
|
2917
|
-
"gray-matter": "^4.0.
|
|
2918
|
-
"isomorphic-git": "^1.
|
|
2925
|
+
"gray-matter": "^4.0.3",
|
|
2926
|
+
"isomorphic-git": "^1.27.1",
|
|
2919
2927
|
"js-sha1": "^0.6.0",
|
|
2920
2928
|
"js-yaml": "^3.14.1",
|
|
2921
2929
|
"jsonpath-plus": "^6.0.1",
|
|
2922
|
-
lodash: "^4.
|
|
2930
|
+
"lodash.clonedeep": "^4.5.0",
|
|
2931
|
+
"lodash.set": "^4.3.2",
|
|
2932
|
+
"lodash.uniqby": "^4.7.0",
|
|
2923
2933
|
"many-level": "^2.0.0",
|
|
2924
2934
|
micromatch: "4.0.5",
|
|
2925
2935
|
"normalize-path": "^3.0.0",
|
|
2926
|
-
"readable-stream": "^4.
|
|
2936
|
+
"readable-stream": "^4.5.2",
|
|
2927
2937
|
scmp: "^2.1.0",
|
|
2928
|
-
yup: "^0.32.
|
|
2938
|
+
yup: "^0.32.11"
|
|
2929
2939
|
},
|
|
2930
2940
|
publishConfig: {
|
|
2931
2941
|
registry: "https://registry.npmjs.org"
|
|
@@ -2937,29 +2947,28 @@ var package_default = {
|
|
|
2937
2947
|
devDependencies: {
|
|
2938
2948
|
"@tinacms/schema-tools": "workspace:*",
|
|
2939
2949
|
"@tinacms/scripts": "workspace:*",
|
|
2940
|
-
"@types/cors": "^2.8.
|
|
2950
|
+
"@types/cors": "^2.8.17",
|
|
2941
2951
|
"@types/estree": "^0.0.50",
|
|
2942
|
-
"@types/express": "^4.17.
|
|
2943
|
-
"@types/fs-extra": "^9.0.
|
|
2944
|
-
"@types/jest": "^26.0.
|
|
2945
|
-
"@types/js-yaml": "^3.12.
|
|
2946
|
-
"@types/lodash": "^4.
|
|
2947
|
-
"@types/lodash.
|
|
2948
|
-
"@types/
|
|
2949
|
-
"@types/
|
|
2950
|
-
"@types/
|
|
2951
|
-
"@types/
|
|
2952
|
-
"@types/
|
|
2953
|
-
"@types/
|
|
2954
|
-
"@types/
|
|
2955
|
-
|
|
2956
|
-
jest: "^29.
|
|
2957
|
-
"jest-diff": "^29.5.0",
|
|
2952
|
+
"@types/express": "^4.17.21",
|
|
2953
|
+
"@types/fs-extra": "^9.0.13",
|
|
2954
|
+
"@types/jest": "^26.0.24",
|
|
2955
|
+
"@types/js-yaml": "^3.12.10",
|
|
2956
|
+
"@types/lodash.camelcase": "^4.3.9",
|
|
2957
|
+
"@types/lodash.upperfirst": "^4.3.9",
|
|
2958
|
+
"@types/lru-cache": "^5.1.1",
|
|
2959
|
+
"@types/mdast": "^3.0.15",
|
|
2960
|
+
"@types/micromatch": "^4.0.9",
|
|
2961
|
+
"@types/node": "^14.18.63",
|
|
2962
|
+
"@types/normalize-path": "^3.0.2",
|
|
2963
|
+
"@types/ws": "^7.4.7",
|
|
2964
|
+
"@types/yup": "^0.29.14",
|
|
2965
|
+
jest: "^29.7.0",
|
|
2966
|
+
"jest-diff": "^29.7.0",
|
|
2958
2967
|
"jest-file-snapshot": "^0.5.0",
|
|
2959
|
-
"jest-matcher-utils": "^29.
|
|
2968
|
+
"jest-matcher-utils": "^29.7.0",
|
|
2960
2969
|
"memory-level": "^1.0.0",
|
|
2961
2970
|
nodemon: "2.0.19",
|
|
2962
|
-
typescript: "
|
|
2971
|
+
typescript: "^5.5.4"
|
|
2963
2972
|
}
|
|
2964
2973
|
};
|
|
2965
2974
|
|
|
@@ -3029,7 +3038,7 @@ var _buildFragments = async (builder, tinaSchema) => {
|
|
|
3029
3038
|
});
|
|
3030
3039
|
const fragDoc = {
|
|
3031
3040
|
kind: "Document",
|
|
3032
|
-
definitions: import_lodash3.default
|
|
3041
|
+
definitions: (0, import_lodash3.default)(
|
|
3033
3042
|
extractInlineTypes(fragmentDefinitionsFields),
|
|
3034
3043
|
(node) => node.name.value
|
|
3035
3044
|
)
|
|
@@ -3061,7 +3070,7 @@ var _buildQueries = async (builder, tinaSchema) => {
|
|
|
3061
3070
|
});
|
|
3062
3071
|
const queryDoc = {
|
|
3063
3072
|
kind: "Document",
|
|
3064
|
-
definitions: import_lodash3.default
|
|
3073
|
+
definitions: (0, import_lodash3.default)(
|
|
3065
3074
|
extractInlineTypes(operationsDefinitions),
|
|
3066
3075
|
(node) => node.name.value
|
|
3067
3076
|
)
|
|
@@ -3149,7 +3158,7 @@ var _buildSchema = async (builder, tinaSchema) => {
|
|
|
3149
3158
|
);
|
|
3150
3159
|
return {
|
|
3151
3160
|
kind: "Document",
|
|
3152
|
-
definitions: import_lodash3.default
|
|
3161
|
+
definitions: (0, import_lodash3.default)(
|
|
3153
3162
|
extractInlineTypes(definitions),
|
|
3154
3163
|
(node) => node.name.value
|
|
3155
3164
|
)
|
|
@@ -5250,7 +5259,7 @@ var resolveDateInput = (value) => {
|
|
|
5250
5259
|
};
|
|
5251
5260
|
|
|
5252
5261
|
// src/resolve.ts
|
|
5253
|
-
var import_lodash4 = __toESM(require("lodash"));
|
|
5262
|
+
var import_lodash4 = __toESM(require("lodash.set"));
|
|
5254
5263
|
|
|
5255
5264
|
// src/error.ts
|
|
5256
5265
|
var import_graphql4 = require("graphql");
|
|
@@ -5277,7 +5286,7 @@ var resolve = async ({
|
|
|
5277
5286
|
const verboseValue = verbose != null ? verbose : true;
|
|
5278
5287
|
const graphQLSchemaAst = await database.getGraphQLSchema();
|
|
5279
5288
|
if (!graphQLSchemaAst) {
|
|
5280
|
-
throw new import_graphql5.GraphQLError(
|
|
5289
|
+
throw new import_graphql5.GraphQLError("GraphQL schema not found");
|
|
5281
5290
|
}
|
|
5282
5291
|
const graphQLSchema = (0, import_graphql5.buildASTSchema)(graphQLSchemaAst);
|
|
5283
5292
|
const tinaConfig = await database.getTinaSchema();
|
|
@@ -5305,9 +5314,8 @@ var resolve = async ({
|
|
|
5305
5314
|
const lookup = await database.getLookup(namedType);
|
|
5306
5315
|
if (lookup.resolveType === "unionData") {
|
|
5307
5316
|
return lookup.typeMap[source._template];
|
|
5308
|
-
} else {
|
|
5309
|
-
throw new Error(`Unable to find lookup key for ${namedType}`);
|
|
5310
5317
|
}
|
|
5318
|
+
throw new Error(`Unable to find lookup key for ${namedType}`);
|
|
5311
5319
|
},
|
|
5312
5320
|
fieldResolver: async (source = {}, _args = {}, _context, info) => {
|
|
5313
5321
|
var _a2, _b, _c, _d;
|
|
@@ -5367,7 +5375,7 @@ var resolve = async ({
|
|
|
5367
5375
|
const sub = args.sub || (ctxUser == null ? void 0 : ctxUser.sub);
|
|
5368
5376
|
const collection = tinaSchema.getCollections().find((c) => c.isAuthCollection);
|
|
5369
5377
|
if (!collection) {
|
|
5370
|
-
throw new Error(
|
|
5378
|
+
throw new Error("Auth collection not found");
|
|
5371
5379
|
}
|
|
5372
5380
|
const userFields = mapUserFields(collection, ["_rawData"]);
|
|
5373
5381
|
if (!userFields.length) {
|
|
@@ -5383,7 +5391,7 @@ var resolve = async ({
|
|
|
5383
5391
|
const userField = userFields[0];
|
|
5384
5392
|
const realPath = `${collection.path}/index.json`;
|
|
5385
5393
|
const userDoc = await resolver.getDocument(realPath);
|
|
5386
|
-
const users =
|
|
5394
|
+
const users = get(userDoc, userField.path);
|
|
5387
5395
|
if (!users) {
|
|
5388
5396
|
throw new Error("No users found");
|
|
5389
5397
|
}
|
|
@@ -5396,7 +5404,7 @@ var resolve = async ({
|
|
|
5396
5404
|
return null;
|
|
5397
5405
|
}
|
|
5398
5406
|
if (info.fieldName === "authenticate") {
|
|
5399
|
-
const saltedHash =
|
|
5407
|
+
const saltedHash = get(user, [passwordFieldName || "", "value"]);
|
|
5400
5408
|
if (!saltedHash) {
|
|
5401
5409
|
throw new Error("No password field found on user field");
|
|
5402
5410
|
}
|
|
@@ -5406,12 +5414,10 @@ var resolve = async ({
|
|
|
5406
5414
|
});
|
|
5407
5415
|
if (matches) {
|
|
5408
5416
|
return user;
|
|
5409
|
-
} else {
|
|
5410
|
-
return null;
|
|
5411
5417
|
}
|
|
5412
|
-
|
|
5413
|
-
return user;
|
|
5418
|
+
return null;
|
|
5414
5419
|
}
|
|
5420
|
+
return user;
|
|
5415
5421
|
}
|
|
5416
5422
|
if (info.fieldName === "updatePassword") {
|
|
5417
5423
|
if (!(ctxUser == null ? void 0 : ctxUser.sub)) {
|
|
@@ -5422,7 +5428,7 @@ var resolve = async ({
|
|
|
5422
5428
|
}
|
|
5423
5429
|
const collection = tinaSchema.getCollections().find((c) => c.isAuthCollection);
|
|
5424
5430
|
if (!collection) {
|
|
5425
|
-
throw new Error(
|
|
5431
|
+
throw new Error("Auth collection not found");
|
|
5426
5432
|
}
|
|
5427
5433
|
const userFields = mapUserFields(collection, ["_rawData"]);
|
|
5428
5434
|
if (!userFields.length) {
|
|
@@ -5438,7 +5444,7 @@ var resolve = async ({
|
|
|
5438
5444
|
const userField = userFields[0];
|
|
5439
5445
|
const realPath = `${collection.path}/index.json`;
|
|
5440
5446
|
const userDoc = await resolver.getDocument(realPath);
|
|
5441
|
-
const users =
|
|
5447
|
+
const users = get(userDoc, userField.path);
|
|
5442
5448
|
if (!users) {
|
|
5443
5449
|
throw new Error("No users found");
|
|
5444
5450
|
}
|
|
@@ -5452,21 +5458,20 @@ var resolve = async ({
|
|
|
5452
5458
|
passwordChangeRequired: false
|
|
5453
5459
|
};
|
|
5454
5460
|
const params = {};
|
|
5455
|
-
import_lodash4.default
|
|
5461
|
+
(0, import_lodash4.default)(
|
|
5456
5462
|
params,
|
|
5457
5463
|
userField.path.slice(1),
|
|
5458
5464
|
users.map((u) => {
|
|
5459
5465
|
if (user[idFieldName] === u[idFieldName]) {
|
|
5460
5466
|
return user;
|
|
5461
|
-
} else {
|
|
5462
|
-
return {
|
|
5463
|
-
...u,
|
|
5464
|
-
[passwordFieldName]: {
|
|
5465
|
-
...u[passwordFieldName],
|
|
5466
|
-
value: ""
|
|
5467
|
-
}
|
|
5468
|
-
};
|
|
5469
5467
|
}
|
|
5468
|
+
return {
|
|
5469
|
+
...u,
|
|
5470
|
+
[passwordFieldName]: {
|
|
5471
|
+
...u[passwordFieldName],
|
|
5472
|
+
value: ""
|
|
5473
|
+
}
|
|
5474
|
+
};
|
|
5470
5475
|
})
|
|
5471
5476
|
);
|
|
5472
5477
|
await resolver.updateResolveDocument({
|
|
@@ -5493,7 +5498,7 @@ var resolve = async ({
|
|
|
5493
5498
|
if (typeof value === "string" && value !== "") {
|
|
5494
5499
|
return resolver.getDocument(value);
|
|
5495
5500
|
}
|
|
5496
|
-
if (args
|
|
5501
|
+
if ((args == null ? void 0 : args.collection) && info.fieldName === "addPendingDocument") {
|
|
5497
5502
|
return resolver.resolveDocument({
|
|
5498
5503
|
args: { ...args, params: {} },
|
|
5499
5504
|
collection: args.collection,
|
|
@@ -5509,7 +5514,7 @@ var resolve = async ({
|
|
|
5509
5514
|
"deleteDocument",
|
|
5510
5515
|
"createFolder"
|
|
5511
5516
|
].includes(info.fieldName)) {
|
|
5512
|
-
const
|
|
5517
|
+
const result = await resolver.resolveDocument({
|
|
5513
5518
|
args,
|
|
5514
5519
|
collection: args.collection,
|
|
5515
5520
|
isMutation,
|
|
@@ -5520,7 +5525,7 @@ var resolve = async ({
|
|
|
5520
5525
|
isAddPendingDocument: false,
|
|
5521
5526
|
isCollectionSpecific: false
|
|
5522
5527
|
});
|
|
5523
|
-
return
|
|
5528
|
+
return result;
|
|
5524
5529
|
}
|
|
5525
5530
|
return value;
|
|
5526
5531
|
case "multiCollectionDocumentList":
|
|
@@ -5531,7 +5536,8 @@ var resolve = async ({
|
|
|
5531
5536
|
return { node: document };
|
|
5532
5537
|
})
|
|
5533
5538
|
};
|
|
5534
|
-
}
|
|
5539
|
+
}
|
|
5540
|
+
if (info.fieldName === "documents" && (value == null ? void 0 : value.collection) && (value == null ? void 0 : value.hasDocuments)) {
|
|
5535
5541
|
let filter = args.filter;
|
|
5536
5542
|
if (typeof (args == null ? void 0 : args.filter) !== "undefined" && (args == null ? void 0 : args.filter) !== null && typeof ((_b = value == null ? void 0 : value.collection) == null ? void 0 : _b.name) === "string" && Object.keys(args.filter).includes((_c = value == null ? void 0 : value.collection) == null ? void 0 : _c.name) && typeof args.filter[(_d = value == null ? void 0 : value.collection) == null ? void 0 : _d.name] !== "undefined") {
|
|
5537
5543
|
filter = args.filter[value.collection.name];
|
|
@@ -5543,12 +5549,11 @@ var resolve = async ({
|
|
|
5543
5549
|
},
|
|
5544
5550
|
collection: value.collection
|
|
5545
5551
|
});
|
|
5546
|
-
} else {
|
|
5547
|
-
throw new Error(
|
|
5548
|
-
`Expected an array for result of ${info.fieldName} at ${info.path}`
|
|
5549
|
-
);
|
|
5550
5552
|
}
|
|
5551
|
-
|
|
5553
|
+
throw new Error(
|
|
5554
|
+
`Expected an array for result of ${info.fieldName} at ${info.path}`
|
|
5555
|
+
);
|
|
5556
|
+
case "collectionDocument": {
|
|
5552
5557
|
if (value) {
|
|
5553
5558
|
return value;
|
|
5554
5559
|
}
|
|
@@ -5561,6 +5566,7 @@ var resolve = async ({
|
|
|
5561
5566
|
isCollectionSpecific: true
|
|
5562
5567
|
});
|
|
5563
5568
|
return result;
|
|
5569
|
+
}
|
|
5564
5570
|
case "collectionDocumentList":
|
|
5565
5571
|
return resolver.resolveCollectionConnection({
|
|
5566
5572
|
args,
|
|
@@ -5569,7 +5575,7 @@ var resolve = async ({
|
|
|
5569
5575
|
case "unionData":
|
|
5570
5576
|
if (!value) {
|
|
5571
5577
|
if (args.relativePath) {
|
|
5572
|
-
const
|
|
5578
|
+
const result = await resolver.resolveDocument({
|
|
5573
5579
|
args,
|
|
5574
5580
|
collection: lookup.collection,
|
|
5575
5581
|
isMutation,
|
|
@@ -5577,13 +5583,13 @@ var resolve = async ({
|
|
|
5577
5583
|
isAddPendingDocument: false,
|
|
5578
5584
|
isCollectionSpecific: true
|
|
5579
5585
|
});
|
|
5580
|
-
return
|
|
5586
|
+
return result;
|
|
5581
5587
|
}
|
|
5582
5588
|
}
|
|
5583
5589
|
return value;
|
|
5584
5590
|
default:
|
|
5585
5591
|
console.error(lookup);
|
|
5586
|
-
throw new Error(
|
|
5592
|
+
throw new Error("Unexpected resolve type");
|
|
5587
5593
|
}
|
|
5588
5594
|
} catch (e) {
|
|
5589
5595
|
handleFetchErrorError(e, verboseValue);
|
|
@@ -5614,9 +5620,8 @@ var resolve = async ({
|
|
|
5614
5620
|
return {
|
|
5615
5621
|
errors: [e]
|
|
5616
5622
|
};
|
|
5617
|
-
} else {
|
|
5618
|
-
throw e;
|
|
5619
5623
|
}
|
|
5624
|
+
throw e;
|
|
5620
5625
|
}
|
|
5621
5626
|
};
|
|
5622
5627
|
|
|
@@ -5642,11 +5647,11 @@ var TinaLevelClient = class extends import_many_level.ManyLevelGuest {
|
|
|
5642
5647
|
};
|
|
5643
5648
|
|
|
5644
5649
|
// src/database/index.ts
|
|
5645
|
-
var
|
|
5650
|
+
var import_node_path = __toESM(require("path"));
|
|
5646
5651
|
var import_graphql6 = require("graphql");
|
|
5647
5652
|
var import_micromatch2 = __toESM(require("micromatch"));
|
|
5648
5653
|
var import_js_sha12 = __toESM(require("js-sha1"));
|
|
5649
|
-
var import_lodash5 = __toESM(require("lodash"));
|
|
5654
|
+
var import_lodash5 = __toESM(require("lodash.set"));
|
|
5650
5655
|
var createLocalDatabase = (config) => {
|
|
5651
5656
|
const level = new TinaLevelClient(config == null ? void 0 : config.port);
|
|
5652
5657
|
level.openConnection();
|
|
@@ -5712,7 +5717,7 @@ var Database = class {
|
|
|
5712
5717
|
} catch (e) {
|
|
5713
5718
|
}
|
|
5714
5719
|
};
|
|
5715
|
-
this.getGeneratedFolder = () =>
|
|
5720
|
+
this.getGeneratedFolder = () => import_node_path.default.join(this.tinaDirectory, "__generated__");
|
|
5716
5721
|
this.getMetadata = async (key) => {
|
|
5717
5722
|
await this.initLevel();
|
|
5718
5723
|
let metadataLevel = this.rootLevel.sublevel("_metadata", SUBLEVEL_OPTIONS);
|
|
@@ -5801,46 +5806,50 @@ var Database = class {
|
|
|
5801
5806
|
}
|
|
5802
5807
|
const folderTreeBuilder = new FolderTreeBuilder();
|
|
5803
5808
|
const folderKey = folderTreeBuilder.update(filepath, collection.path || "");
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5809
|
+
let putOps = [];
|
|
5810
|
+
let delOps = [];
|
|
5811
|
+
if (!isGitKeep(normalizedPath, collection)) {
|
|
5812
|
+
putOps = [
|
|
5813
|
+
...makeIndexOpsForDocument(
|
|
5814
|
+
normalizedPath,
|
|
5815
|
+
collection == null ? void 0 : collection.name,
|
|
5816
|
+
collectionIndexDefinitions,
|
|
5817
|
+
dataFields,
|
|
5818
|
+
"put",
|
|
5819
|
+
level
|
|
5820
|
+
),
|
|
5821
|
+
...makeIndexOpsForDocument(
|
|
5822
|
+
normalizedPath,
|
|
5823
|
+
`${collection == null ? void 0 : collection.name}_${folderKey}`,
|
|
5824
|
+
collectionIndexDefinitions,
|
|
5825
|
+
dataFields,
|
|
5826
|
+
"put",
|
|
5827
|
+
level
|
|
5828
|
+
)
|
|
5829
|
+
];
|
|
5830
|
+
const existingItem = await level.sublevel(
|
|
5831
|
+
CONTENT_ROOT_PREFIX,
|
|
5832
|
+
SUBLEVEL_OPTIONS
|
|
5833
|
+
).get(normalizedPath);
|
|
5834
|
+
delOps = existingItem ? [
|
|
5835
|
+
...makeIndexOpsForDocument(
|
|
5836
|
+
normalizedPath,
|
|
5837
|
+
collection == null ? void 0 : collection.name,
|
|
5838
|
+
collectionIndexDefinitions,
|
|
5839
|
+
existingItem,
|
|
5840
|
+
"del",
|
|
5841
|
+
level
|
|
5842
|
+
),
|
|
5843
|
+
...makeIndexOpsForDocument(
|
|
5844
|
+
normalizedPath,
|
|
5845
|
+
`${collection == null ? void 0 : collection.name}_${folderKey}`,
|
|
5846
|
+
collectionIndexDefinitions,
|
|
5847
|
+
existingItem,
|
|
5848
|
+
"del",
|
|
5849
|
+
level
|
|
5850
|
+
)
|
|
5851
|
+
] : [];
|
|
5852
|
+
}
|
|
5844
5853
|
const ops = [
|
|
5845
5854
|
...delOps,
|
|
5846
5855
|
...putOps,
|
|
@@ -5913,46 +5922,50 @@ var Database = class {
|
|
|
5913
5922
|
collection.path || ""
|
|
5914
5923
|
);
|
|
5915
5924
|
const level = (collection == null ? void 0 : collection.isDetached) ? this.appLevel.sublevel(collection == null ? void 0 : collection.name, SUBLEVEL_OPTIONS) : this.contentLevel;
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5925
|
+
let putOps = [];
|
|
5926
|
+
let delOps = [];
|
|
5927
|
+
if (!isGitKeep(normalizedPath, collection)) {
|
|
5928
|
+
putOps = [
|
|
5929
|
+
...makeIndexOpsForDocument(
|
|
5930
|
+
normalizedPath,
|
|
5931
|
+
collectionName,
|
|
5932
|
+
collectionIndexDefinitions,
|
|
5933
|
+
dataFields,
|
|
5934
|
+
"put",
|
|
5935
|
+
level
|
|
5936
|
+
),
|
|
5937
|
+
...makeIndexOpsForDocument(
|
|
5938
|
+
normalizedPath,
|
|
5939
|
+
`${collection == null ? void 0 : collection.name}_${folderKey}`,
|
|
5940
|
+
collectionIndexDefinitions,
|
|
5941
|
+
dataFields,
|
|
5942
|
+
"put",
|
|
5943
|
+
level
|
|
5944
|
+
)
|
|
5945
|
+
];
|
|
5946
|
+
const existingItem = await level.sublevel(
|
|
5947
|
+
CONTENT_ROOT_PREFIX,
|
|
5948
|
+
SUBLEVEL_OPTIONS
|
|
5949
|
+
).get(normalizedPath);
|
|
5950
|
+
delOps = existingItem ? [
|
|
5951
|
+
...makeIndexOpsForDocument(
|
|
5952
|
+
normalizedPath,
|
|
5953
|
+
collectionName,
|
|
5954
|
+
collectionIndexDefinitions,
|
|
5955
|
+
existingItem,
|
|
5956
|
+
"del",
|
|
5957
|
+
level
|
|
5958
|
+
),
|
|
5959
|
+
...makeIndexOpsForDocument(
|
|
5960
|
+
normalizedPath,
|
|
5961
|
+
`${collection == null ? void 0 : collection.name}_${folderKey}`,
|
|
5962
|
+
collectionIndexDefinitions,
|
|
5963
|
+
existingItem,
|
|
5964
|
+
"del",
|
|
5965
|
+
level
|
|
5966
|
+
)
|
|
5967
|
+
] : [];
|
|
5968
|
+
}
|
|
5956
5969
|
const ops = [
|
|
5957
5970
|
...delOps,
|
|
5958
5971
|
...putOps,
|
|
@@ -6015,7 +6028,7 @@ var Database = class {
|
|
|
6015
6028
|
);
|
|
6016
6029
|
const writeTemplateKey = templateDetails.info.type === "union";
|
|
6017
6030
|
const aliasedData = applyNameOverrides(templateDetails.template, payload);
|
|
6018
|
-
const extension =
|
|
6031
|
+
const extension = import_node_path.default.extname(filepath);
|
|
6019
6032
|
return stringifyFile(
|
|
6020
6033
|
aliasedData,
|
|
6021
6034
|
extension,
|
|
@@ -6038,7 +6051,7 @@ var Database = class {
|
|
|
6038
6051
|
this.getLookup = async (returnType) => {
|
|
6039
6052
|
await this.initLevel();
|
|
6040
6053
|
const lookupPath = (0, import_schema_tools3.normalizePath)(
|
|
6041
|
-
|
|
6054
|
+
import_node_path.default.join(this.getGeneratedFolder(), `_lookup.json`)
|
|
6042
6055
|
);
|
|
6043
6056
|
if (!this._lookup) {
|
|
6044
6057
|
this._lookup = await this.contentLevel.sublevel(
|
|
@@ -6051,7 +6064,7 @@ var Database = class {
|
|
|
6051
6064
|
this.getGraphQLSchema = async () => {
|
|
6052
6065
|
await this.initLevel();
|
|
6053
6066
|
const graphqlPath = (0, import_schema_tools3.normalizePath)(
|
|
6054
|
-
|
|
6067
|
+
import_node_path.default.join(this.getGeneratedFolder(), `_graphql.json`)
|
|
6055
6068
|
);
|
|
6056
6069
|
return await this.contentLevel.sublevel(
|
|
6057
6070
|
CONTENT_ROOT_PREFIX,
|
|
@@ -6063,7 +6076,7 @@ var Database = class {
|
|
|
6063
6076
|
throw new Error(`No bridge configured`);
|
|
6064
6077
|
}
|
|
6065
6078
|
const graphqlPath = (0, import_schema_tools3.normalizePath)(
|
|
6066
|
-
|
|
6079
|
+
import_node_path.default.join(this.getGeneratedFolder(), `_graphql.json`)
|
|
6067
6080
|
);
|
|
6068
6081
|
const _graphql = await this.bridge.get(graphqlPath);
|
|
6069
6082
|
return JSON.parse(_graphql);
|
|
@@ -6071,7 +6084,7 @@ var Database = class {
|
|
|
6071
6084
|
this.getTinaSchema = async (level) => {
|
|
6072
6085
|
await this.initLevel();
|
|
6073
6086
|
const schemaPath = (0, import_schema_tools3.normalizePath)(
|
|
6074
|
-
|
|
6087
|
+
import_node_path.default.join(this.getGeneratedFolder(), `_schema.json`)
|
|
6075
6088
|
);
|
|
6076
6089
|
return await (level || this.contentLevel).sublevel(
|
|
6077
6090
|
CONTENT_ROOT_PREFIX,
|
|
@@ -6087,7 +6100,7 @@ var Database = class {
|
|
|
6087
6100
|
if (!schema) {
|
|
6088
6101
|
throw new Error(
|
|
6089
6102
|
`Unable to get schema from level db: ${(0, import_schema_tools3.normalizePath)(
|
|
6090
|
-
|
|
6103
|
+
import_node_path.default.join(this.getGeneratedFolder(), `_schema.json`)
|
|
6091
6104
|
)}`
|
|
6092
6105
|
);
|
|
6093
6106
|
}
|
|
@@ -6274,9 +6287,8 @@ var Database = class {
|
|
|
6274
6287
|
collection: collection.name,
|
|
6275
6288
|
stack: error.stack
|
|
6276
6289
|
});
|
|
6277
|
-
} else {
|
|
6278
|
-
throw error;
|
|
6279
6290
|
}
|
|
6291
|
+
throw error;
|
|
6280
6292
|
}
|
|
6281
6293
|
}),
|
|
6282
6294
|
pageInfo: {
|
|
@@ -6304,7 +6316,7 @@ var Database = class {
|
|
|
6304
6316
|
lookup = lookupFromLockFile || JSON.parse(
|
|
6305
6317
|
await this.bridge.get(
|
|
6306
6318
|
(0, import_schema_tools3.normalizePath)(
|
|
6307
|
-
|
|
6319
|
+
import_node_path.default.join(this.getGeneratedFolder(), "_lookup.json")
|
|
6308
6320
|
)
|
|
6309
6321
|
)
|
|
6310
6322
|
);
|
|
@@ -6328,15 +6340,15 @@ var Database = class {
|
|
|
6328
6340
|
}
|
|
6329
6341
|
const contentRootLevel = nextLevel.sublevel(CONTENT_ROOT_PREFIX, SUBLEVEL_OPTIONS);
|
|
6330
6342
|
await contentRootLevel.put(
|
|
6331
|
-
(0, import_schema_tools3.normalizePath)(
|
|
6343
|
+
(0, import_schema_tools3.normalizePath)(import_node_path.default.join(this.getGeneratedFolder(), "_graphql.json")),
|
|
6332
6344
|
graphQLSchema
|
|
6333
6345
|
);
|
|
6334
6346
|
await contentRootLevel.put(
|
|
6335
|
-
(0, import_schema_tools3.normalizePath)(
|
|
6347
|
+
(0, import_schema_tools3.normalizePath)(import_node_path.default.join(this.getGeneratedFolder(), "_schema.json")),
|
|
6336
6348
|
tinaSchema.schema
|
|
6337
6349
|
);
|
|
6338
6350
|
await contentRootLevel.put(
|
|
6339
|
-
(0, import_schema_tools3.normalizePath)(
|
|
6351
|
+
(0, import_schema_tools3.normalizePath)(import_node_path.default.join(this.getGeneratedFolder(), "_lookup.json")),
|
|
6340
6352
|
lookup
|
|
6341
6353
|
);
|
|
6342
6354
|
const result = await this._indexAllContent(
|
|
@@ -6626,9 +6638,9 @@ var Database = class {
|
|
|
6626
6638
|
};
|
|
6627
6639
|
var hashPasswordVisitor = async (node, path7) => {
|
|
6628
6640
|
const passwordValuePath = [...path7, "value"];
|
|
6629
|
-
const plaintextPassword =
|
|
6641
|
+
const plaintextPassword = get(node, passwordValuePath);
|
|
6630
6642
|
if (plaintextPassword) {
|
|
6631
|
-
import_lodash5.default
|
|
6643
|
+
(0, import_lodash5.default)(
|
|
6632
6644
|
node,
|
|
6633
6645
|
passwordValuePath,
|
|
6634
6646
|
await generatePasswordHash({ password: plaintextPassword })
|
|
@@ -6653,6 +6665,7 @@ var hashPasswordValues = async (data, passwordFields) => Promise.all(
|
|
|
6653
6665
|
async (passwordField) => visitNodes(data, passwordField, hashPasswordVisitor)
|
|
6654
6666
|
)
|
|
6655
6667
|
);
|
|
6668
|
+
var isGitKeep = (filepath, collection) => filepath.endsWith(`.gitkeep.${(collection == null ? void 0 : collection.format) || "md"}`);
|
|
6656
6669
|
var _indexContent = async (database, level, documentPaths, enqueueOps, collection, passwordFields) => {
|
|
6657
6670
|
let collectionIndexDefinitions;
|
|
6658
6671
|
let collectionPath;
|
|
@@ -6689,33 +6702,35 @@ var _indexContent = async (database, level, documentPaths, enqueueOps, collectio
|
|
|
6689
6702
|
normalizedPath,
|
|
6690
6703
|
collectionPath || ""
|
|
6691
6704
|
);
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6705
|
+
if (!isGitKeep(filepath, collection)) {
|
|
6706
|
+
await enqueueOps([
|
|
6707
|
+
...makeIndexOpsForDocument(
|
|
6708
|
+
normalizedPath,
|
|
6709
|
+
collection == null ? void 0 : collection.name,
|
|
6710
|
+
collectionIndexDefinitions,
|
|
6711
|
+
aliasedData,
|
|
6712
|
+
"put",
|
|
6713
|
+
level
|
|
6714
|
+
),
|
|
6715
|
+
...makeIndexOpsForDocument(
|
|
6716
|
+
normalizedPath,
|
|
6717
|
+
`${collection == null ? void 0 : collection.name}_${folderKey}`,
|
|
6718
|
+
collectionIndexDefinitions,
|
|
6719
|
+
aliasedData,
|
|
6720
|
+
"put",
|
|
6721
|
+
level
|
|
6722
|
+
),
|
|
6723
|
+
{
|
|
6724
|
+
type: "put",
|
|
6725
|
+
key: normalizedPath,
|
|
6726
|
+
value: aliasedData,
|
|
6727
|
+
sublevel: level.sublevel(
|
|
6728
|
+
CONTENT_ROOT_PREFIX,
|
|
6729
|
+
SUBLEVEL_OPTIONS
|
|
6730
|
+
)
|
|
6731
|
+
}
|
|
6732
|
+
]);
|
|
6733
|
+
}
|
|
6719
6734
|
} catch (error) {
|
|
6720
6735
|
throw new TinaFetchError(`Unable to seed ${filepath}`, {
|
|
6721
6736
|
originalError: error,
|
|
@@ -6810,13 +6825,13 @@ var _deleteIndexContent = async (database, documentPaths, enqueueOps, collection
|
|
|
6810
6825
|
// src/git/index.ts
|
|
6811
6826
|
var import_isomorphic_git = __toESM(require("isomorphic-git"));
|
|
6812
6827
|
var import_fs_extra = __toESM(require("fs-extra"));
|
|
6813
|
-
var
|
|
6828
|
+
var import_path4 = __toESM(require("path"));
|
|
6814
6829
|
var import_micromatch3 = __toESM(require("micromatch"));
|
|
6815
6830
|
var findGitRoot = async (dir) => {
|
|
6816
|
-
if (await import_fs_extra.default.pathExists(
|
|
6831
|
+
if (await import_fs_extra.default.pathExists(import_path4.default.join(dir, ".git"))) {
|
|
6817
6832
|
return dir;
|
|
6818
6833
|
}
|
|
6819
|
-
const parentDir =
|
|
6834
|
+
const parentDir = import_path4.default.dirname(dir);
|
|
6820
6835
|
if (parentDir === dir) {
|
|
6821
6836
|
throw new Error("Could not find .git directory");
|
|
6822
6837
|
}
|
|
@@ -6898,7 +6913,7 @@ var shaExists = async ({
|
|
|
6898
6913
|
// src/database/bridge/filesystem.ts
|
|
6899
6914
|
var import_fs_extra2 = __toESM(require("fs-extra"));
|
|
6900
6915
|
var import_fast_glob = __toESM(require("fast-glob"));
|
|
6901
|
-
var
|
|
6916
|
+
var import_path5 = __toESM(require("path"));
|
|
6902
6917
|
var import_normalize_path = __toESM(require("normalize-path"));
|
|
6903
6918
|
var FilesystemBridge = class {
|
|
6904
6919
|
constructor(rootPath, outputPath) {
|
|
@@ -6906,9 +6921,9 @@ var FilesystemBridge = class {
|
|
|
6906
6921
|
this.outputPath = outputPath || rootPath;
|
|
6907
6922
|
}
|
|
6908
6923
|
async glob(pattern, extension) {
|
|
6909
|
-
const basePath =
|
|
6924
|
+
const basePath = import_path5.default.join(this.outputPath, ...pattern.split("/"));
|
|
6910
6925
|
const items = await (0, import_fast_glob.default)(
|
|
6911
|
-
|
|
6926
|
+
import_path5.default.join(basePath, "**", `/*.${extension}`).replace(/\\/g, "/"),
|
|
6912
6927
|
{
|
|
6913
6928
|
dot: true,
|
|
6914
6929
|
ignore: ["**/node_modules/**"]
|
|
@@ -6920,14 +6935,14 @@ var FilesystemBridge = class {
|
|
|
6920
6935
|
});
|
|
6921
6936
|
}
|
|
6922
6937
|
async delete(filepath) {
|
|
6923
|
-
await import_fs_extra2.default.remove(
|
|
6938
|
+
await import_fs_extra2.default.remove(import_path5.default.join(this.outputPath, filepath));
|
|
6924
6939
|
}
|
|
6925
6940
|
async get(filepath) {
|
|
6926
|
-
return import_fs_extra2.default.readFileSync(
|
|
6941
|
+
return import_fs_extra2.default.readFileSync(import_path5.default.join(this.outputPath, filepath)).toString();
|
|
6927
6942
|
}
|
|
6928
6943
|
async put(filepath, data, basePathOverride) {
|
|
6929
6944
|
const basePath = basePathOverride || this.outputPath;
|
|
6930
|
-
await import_fs_extra2.default.outputFileSync(
|
|
6945
|
+
await import_fs_extra2.default.outputFileSync(import_path5.default.join(basePath, filepath), data);
|
|
6931
6946
|
}
|
|
6932
6947
|
};
|
|
6933
6948
|
var AuditFileSystemBridge = class extends FilesystemBridge {
|
|
@@ -6952,7 +6967,7 @@ var import_fs_extra3 = __toESM(require("fs-extra"));
|
|
|
6952
6967
|
var import_glob_parent = __toESM(require("glob-parent"));
|
|
6953
6968
|
var import_normalize_path2 = __toESM(require("normalize-path"));
|
|
6954
6969
|
var import_graphql7 = require("graphql");
|
|
6955
|
-
var
|
|
6970
|
+
var import_path6 = require("path");
|
|
6956
6971
|
var flat = typeof Array.prototype.flat === "undefined" ? (entries) => entries.reduce((acc, x) => acc.concat(x), []) : (entries) => entries.flat();
|
|
6957
6972
|
var toUint8Array = (buf) => {
|
|
6958
6973
|
const ab = new ArrayBuffer(buf.length);
|
|
@@ -7049,7 +7064,7 @@ var IsomorphicBridge = class {
|
|
|
7049
7064
|
return head;
|
|
7050
7065
|
}
|
|
7051
7066
|
if (path7.startsWith(filepath)) {
|
|
7052
|
-
if ((0,
|
|
7067
|
+
if ((0, import_path6.dirname)(path7) === (0, import_path6.dirname)(filepath)) {
|
|
7053
7068
|
if (path7 === filepath) {
|
|
7054
7069
|
return head;
|
|
7055
7070
|
}
|
|
@@ -7375,3 +7390,5 @@ var buildSchema = async (config, flags) => {
|
|
|
7375
7390
|
transformDocument,
|
|
7376
7391
|
transformDocumentIntoPayload
|
|
7377
7392
|
});
|
|
7393
|
+
//! Replaces _.flattenDeep()
|
|
7394
|
+
//! Replaces _.get()
|