@tinacms/graphql 1.4.40 → 1.5.1

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/index.mjs CHANGED
@@ -1,9 +1,6 @@
1
1
  // src/build.ts
2
- import _3 from "lodash";
3
2
  import { print } from "graphql";
4
-
5
- // src/ast-builder/index.ts
6
- import _ from "lodash";
3
+ import uniqBy2 from "lodash.uniqby";
7
4
 
8
5
  // src/util.ts
9
6
  import * as yup from "yup";
@@ -46,8 +43,20 @@ var btoa = (string2) => {
46
43
  var lastItem = (arr) => {
47
44
  return arr[arr.length - 1];
48
45
  };
46
+ var get = (obj, path7, defaultValue = void 0) => {
47
+ const travel = (regexp) => String.prototype.split.call(path7, regexp).filter(Boolean).reduce(
48
+ (res, key) => res !== null && res !== void 0 ? res[key] : res,
49
+ obj
50
+ );
51
+ const result = travel(/[,[\]]+?/) || travel(/[,[\].]+?/);
52
+ return result === void 0 || result === obj ? defaultValue : result;
53
+ };
54
+ var flattenDeep = (arr) => arr.flatMap(
55
+ (subArray, index) => Array.isArray(subArray) ? flattenDeep(subArray) : subArray
56
+ );
49
57
 
50
58
  // src/ast-builder/index.ts
59
+ import uniqBy from "lodash.uniqby";
51
60
  var SysFieldDefinition = {
52
61
  kind: "Field",
53
62
  name: {
@@ -933,7 +942,7 @@ var astBuilder = {
933
942
  };
934
943
  },
935
944
  toGraphQLAst: (ast) => {
936
- const definitions = _.uniqBy(
945
+ const definitions = uniqBy(
937
946
  [
938
947
  ...extractInlineTypes(ast.query),
939
948
  ...extractInlineTypes(ast.globalTemplates),
@@ -954,25 +963,24 @@ var capitalize = (s) => {
954
963
  };
955
964
  var extractInlineTypes = (item) => {
956
965
  if (Array.isArray(item)) {
957
- const accumulator = item.map((i) => {
966
+ const accumulator2 = item.map((i) => {
958
967
  return extractInlineTypes(i);
959
968
  });
960
- return _.flattenDeep(accumulator);
961
- } else {
962
- const accumulator = [item];
963
- for (const node of walk(item)) {
964
- if (node.kind === "UnionTypeDefinition") {
965
- node.types = _.uniqBy(node.types, (type) => type.name.value);
966
- }
967
- if (node.kind === "NamedType") {
968
- if (typeof node.name.value !== "string") {
969
- accumulator.push(node.name.value);
970
- node.name.value = node.name.value.name.value;
971
- }
969
+ return flattenDeep(accumulator2);
970
+ }
971
+ const accumulator = [item];
972
+ for (const node of walk(item)) {
973
+ if (node.kind === "UnionTypeDefinition") {
974
+ node.types = uniqBy(node.types, (type) => type.name.value);
975
+ }
976
+ if (node.kind === "NamedType") {
977
+ if (typeof node.name.value !== "string") {
978
+ accumulator.push(node.name.value);
979
+ node.name.value = node.name.value.name.value;
972
980
  }
973
981
  }
974
- return accumulator;
975
982
  }
983
+ return accumulator;
976
984
  };
977
985
  function* walk(maybeNode, visited = /* @__PURE__ */ new WeakSet()) {
978
986
  if (typeof maybeNode === "string") {
@@ -2653,7 +2661,7 @@ var filterSelections = (arr) => {
2653
2661
  import { TinaSchema } from "@tinacms/schema-tools";
2654
2662
 
2655
2663
  // src/schema/validate.ts
2656
- import _2 from "lodash";
2664
+ import deepClone from "lodash.clonedeep";
2657
2665
  import * as yup2 from "yup";
2658
2666
  import {
2659
2667
  validateTinaCloudSchemaConfig
@@ -2671,7 +2679,7 @@ var FIELD_TYPES = [
2671
2679
  ];
2672
2680
  var validateSchema = async (schema) => {
2673
2681
  const schema2 = addNamespaceToSchema(
2674
- _2.cloneDeep(schema)
2682
+ deepClone(schema)
2675
2683
  );
2676
2684
  const collections = await sequential(
2677
2685
  schema2.collections,
@@ -2776,7 +2784,7 @@ var validateCollection = async (collection) => {
2776
2784
  }
2777
2785
  if (validCollection.fields) {
2778
2786
  if (typeof validCollection.fields === "string") {
2779
- throw new Error(`Global templates are not yet supported`);
2787
+ throw new Error("Global templates are not yet supported");
2780
2788
  }
2781
2789
  fields = await sequential(validCollection.fields, async (field) => {
2782
2790
  return validateField(field);
@@ -2807,7 +2815,7 @@ var validateField = async (field) => {
2807
2815
  // package.json
2808
2816
  var package_default = {
2809
2817
  name: "@tinacms/graphql",
2810
- version: "1.4.40",
2818
+ version: "1.5.1",
2811
2819
  main: "dist/index.js",
2812
2820
  module: "dist/index.mjs",
2813
2821
  typings: "dist/index.d.ts",
@@ -2841,24 +2849,26 @@ var package_default = {
2841
2849
  "@iarna/toml": "^2.2.5",
2842
2850
  "@tinacms/mdx": "workspace:*",
2843
2851
  "@tinacms/schema-tools": "workspace:*",
2844
- "abstract-level": "^1.0.3",
2845
- "date-fns": "^2.21.1",
2846
- "fast-glob": "^3.2.5",
2847
- "fs-extra": "^9.0.1",
2852
+ "abstract-level": "^1.0.4",
2853
+ "date-fns": "^2.30.0",
2854
+ "fast-glob": "^3.3.2",
2855
+ "fs-extra": "^9.1.0",
2848
2856
  "glob-parent": "^6.0.2",
2849
2857
  graphql: "15.8.0",
2850
- "gray-matter": "^4.0.2",
2851
- "isomorphic-git": "^1.21.0",
2858
+ "gray-matter": "^4.0.3",
2859
+ "isomorphic-git": "^1.27.1",
2852
2860
  "js-sha1": "^0.6.0",
2853
2861
  "js-yaml": "^3.14.1",
2854
2862
  "jsonpath-plus": "^6.0.1",
2855
- lodash: "4.17.20",
2863
+ "lodash.clonedeep": "^4.5.0",
2864
+ "lodash.set": "^4.3.2",
2865
+ "lodash.uniqby": "^4.7.0",
2856
2866
  "many-level": "^2.0.0",
2857
2867
  micromatch: "4.0.5",
2858
2868
  "normalize-path": "^3.0.0",
2859
- "readable-stream": "^4.3.0",
2869
+ "readable-stream": "^4.5.2",
2860
2870
  scmp: "^2.1.0",
2861
- yup: "^0.32.9"
2871
+ yup: "^0.32.11"
2862
2872
  },
2863
2873
  publishConfig: {
2864
2874
  registry: "https://registry.npmjs.org"
@@ -2870,29 +2880,28 @@ var package_default = {
2870
2880
  devDependencies: {
2871
2881
  "@tinacms/schema-tools": "workspace:*",
2872
2882
  "@tinacms/scripts": "workspace:*",
2873
- "@types/cors": "^2.8.7",
2883
+ "@types/cors": "^2.8.17",
2874
2884
  "@types/estree": "^0.0.50",
2875
- "@types/express": "^4.17.8",
2876
- "@types/fs-extra": "^9.0.2",
2877
- "@types/jest": "^26.0.4",
2878
- "@types/js-yaml": "^3.12.5",
2879
- "@types/lodash": "4.14.190",
2880
- "@types/lodash.camelcase": "^4.3.6",
2881
- "@types/lodash.upperfirst": "^4.3.6",
2882
- "@types/lru-cache": "^5.1.0",
2883
- "@types/mdast": "^3.0.10",
2884
- "@types/micromatch": "^4.0.2",
2885
- "@types/node": "^14.17.34",
2886
- "@types/normalize-path": "^3.0.0",
2887
- "@types/ws": "^7.2.6",
2888
- "@types/yup": "^0.29.7",
2889
- jest: "^29.5.0",
2890
- "jest-diff": "^29.5.0",
2885
+ "@types/express": "^4.17.21",
2886
+ "@types/fs-extra": "^9.0.13",
2887
+ "@types/jest": "^26.0.24",
2888
+ "@types/js-yaml": "^3.12.10",
2889
+ "@types/lodash.camelcase": "^4.3.9",
2890
+ "@types/lodash.upperfirst": "^4.3.9",
2891
+ "@types/lru-cache": "^5.1.1",
2892
+ "@types/mdast": "^3.0.15",
2893
+ "@types/micromatch": "^4.0.9",
2894
+ "@types/node": "^14.18.63",
2895
+ "@types/normalize-path": "^3.0.2",
2896
+ "@types/ws": "^7.4.7",
2897
+ "@types/yup": "^0.29.14",
2898
+ jest: "^29.7.0",
2899
+ "jest-diff": "^29.7.0",
2891
2900
  "jest-file-snapshot": "^0.5.0",
2892
- "jest-matcher-utils": "^29.5.0",
2901
+ "jest-matcher-utils": "^29.7.0",
2893
2902
  "memory-level": "^1.0.0",
2894
2903
  nodemon: "2.0.19",
2895
- typescript: "4.7.4"
2904
+ typescript: "^5.5.4"
2896
2905
  }
2897
2906
  };
2898
2907
 
@@ -2962,7 +2971,7 @@ var _buildFragments = async (builder, tinaSchema) => {
2962
2971
  });
2963
2972
  const fragDoc = {
2964
2973
  kind: "Document",
2965
- definitions: _3.uniqBy(
2974
+ definitions: uniqBy2(
2966
2975
  extractInlineTypes(fragmentDefinitionsFields),
2967
2976
  (node) => node.name.value
2968
2977
  )
@@ -2993,7 +3002,7 @@ var _buildQueries = async (builder, tinaSchema) => {
2993
3002
  });
2994
3003
  const queryDoc = {
2995
3004
  kind: "Document",
2996
- definitions: _3.uniqBy(
3005
+ definitions: uniqBy2(
2997
3006
  extractInlineTypes(operationsDefinitions),
2998
3007
  (node) => node.name.value
2999
3008
  )
@@ -3081,7 +3090,7 @@ var _buildSchema = async (builder, tinaSchema) => {
3081
3090
  );
3082
3091
  return {
3083
3092
  kind: "Document",
3084
- definitions: _3.uniqBy(
3093
+ definitions: uniqBy2(
3085
3094
  extractInlineTypes(definitions),
3086
3095
  (node) => node.name.value
3087
3096
  )
@@ -5176,7 +5185,7 @@ var resolveDateInput = (value) => {
5176
5185
  };
5177
5186
 
5178
5187
  // src/resolve.ts
5179
- import _4 from "lodash";
5188
+ import set from "lodash.set";
5180
5189
 
5181
5190
  // src/error.ts
5182
5191
  import { GraphQLError as GraphQLError3 } from "graphql";
@@ -5202,7 +5211,7 @@ var resolve = async ({
5202
5211
  const verboseValue = verbose ?? true;
5203
5212
  const graphQLSchemaAst = await database.getGraphQLSchema();
5204
5213
  if (!graphQLSchemaAst) {
5205
- throw new GraphQLError4(`GraphQL schema not found`);
5214
+ throw new GraphQLError4("GraphQL schema not found");
5206
5215
  }
5207
5216
  const graphQLSchema = buildASTSchema(graphQLSchemaAst);
5208
5217
  const tinaConfig = await database.getTinaSchema();
@@ -5230,9 +5239,8 @@ var resolve = async ({
5230
5239
  const lookup = await database.getLookup(namedType);
5231
5240
  if (lookup.resolveType === "unionData") {
5232
5241
  return lookup.typeMap[source._template];
5233
- } else {
5234
- throw new Error(`Unable to find lookup key for ${namedType}`);
5235
5242
  }
5243
+ throw new Error(`Unable to find lookup key for ${namedType}`);
5236
5244
  },
5237
5245
  fieldResolver: async (source = {}, _args = {}, _context, info) => {
5238
5246
  try {
@@ -5289,7 +5297,7 @@ var resolve = async ({
5289
5297
  const sub = args.sub || ctxUser?.sub;
5290
5298
  const collection = tinaSchema.getCollections().find((c) => c.isAuthCollection);
5291
5299
  if (!collection) {
5292
- throw new Error(`Auth collection not found`);
5300
+ throw new Error("Auth collection not found");
5293
5301
  }
5294
5302
  const userFields = mapUserFields(collection, ["_rawData"]);
5295
5303
  if (!userFields.length) {
@@ -5305,7 +5313,7 @@ var resolve = async ({
5305
5313
  const userField = userFields[0];
5306
5314
  const realPath = `${collection.path}/index.json`;
5307
5315
  const userDoc = await resolver.getDocument(realPath);
5308
- const users = _4.get(userDoc, userField.path);
5316
+ const users = get(userDoc, userField.path);
5309
5317
  if (!users) {
5310
5318
  throw new Error("No users found");
5311
5319
  }
@@ -5318,7 +5326,7 @@ var resolve = async ({
5318
5326
  return null;
5319
5327
  }
5320
5328
  if (info.fieldName === "authenticate") {
5321
- const saltedHash = _4.get(user, [passwordFieldName || "", "value"]);
5329
+ const saltedHash = get(user, [passwordFieldName || "", "value"]);
5322
5330
  if (!saltedHash) {
5323
5331
  throw new Error("No password field found on user field");
5324
5332
  }
@@ -5328,12 +5336,10 @@ var resolve = async ({
5328
5336
  });
5329
5337
  if (matches) {
5330
5338
  return user;
5331
- } else {
5332
- return null;
5333
5339
  }
5334
- } else {
5335
- return user;
5340
+ return null;
5336
5341
  }
5342
+ return user;
5337
5343
  }
5338
5344
  if (info.fieldName === "updatePassword") {
5339
5345
  if (!ctxUser?.sub) {
@@ -5344,7 +5350,7 @@ var resolve = async ({
5344
5350
  }
5345
5351
  const collection = tinaSchema.getCollections().find((c) => c.isAuthCollection);
5346
5352
  if (!collection) {
5347
- throw new Error(`Auth collection not found`);
5353
+ throw new Error("Auth collection not found");
5348
5354
  }
5349
5355
  const userFields = mapUserFields(collection, ["_rawData"]);
5350
5356
  if (!userFields.length) {
@@ -5360,7 +5366,7 @@ var resolve = async ({
5360
5366
  const userField = userFields[0];
5361
5367
  const realPath = `${collection.path}/index.json`;
5362
5368
  const userDoc = await resolver.getDocument(realPath);
5363
- const users = _4.get(userDoc, userField.path);
5369
+ const users = get(userDoc, userField.path);
5364
5370
  if (!users) {
5365
5371
  throw new Error("No users found");
5366
5372
  }
@@ -5374,21 +5380,20 @@ var resolve = async ({
5374
5380
  passwordChangeRequired: false
5375
5381
  };
5376
5382
  const params = {};
5377
- _4.set(
5383
+ set(
5378
5384
  params,
5379
5385
  userField.path.slice(1),
5380
5386
  users.map((u) => {
5381
5387
  if (user[idFieldName] === u[idFieldName]) {
5382
5388
  return user;
5383
- } else {
5384
- return {
5385
- ...u,
5386
- [passwordFieldName]: {
5387
- ...u[passwordFieldName],
5388
- value: ""
5389
- }
5390
- };
5391
5389
  }
5390
+ return {
5391
+ ...u,
5392
+ [passwordFieldName]: {
5393
+ ...u[passwordFieldName],
5394
+ value: ""
5395
+ }
5396
+ };
5392
5397
  })
5393
5398
  );
5394
5399
  await resolver.updateResolveDocument({
@@ -5415,7 +5420,7 @@ var resolve = async ({
5415
5420
  if (typeof value === "string" && value !== "") {
5416
5421
  return resolver.getDocument(value);
5417
5422
  }
5418
- if (args && args.collection && info.fieldName === "addPendingDocument") {
5423
+ if (args?.collection && info.fieldName === "addPendingDocument") {
5419
5424
  return resolver.resolveDocument({
5420
5425
  args: { ...args, params: {} },
5421
5426
  collection: args.collection,
@@ -5431,7 +5436,7 @@ var resolve = async ({
5431
5436
  "deleteDocument",
5432
5437
  "createFolder"
5433
5438
  ].includes(info.fieldName)) {
5434
- const result2 = await resolver.resolveDocument({
5439
+ const result = await resolver.resolveDocument({
5435
5440
  args,
5436
5441
  collection: args.collection,
5437
5442
  isMutation,
@@ -5442,7 +5447,7 @@ var resolve = async ({
5442
5447
  isAddPendingDocument: false,
5443
5448
  isCollectionSpecific: false
5444
5449
  });
5445
- return result2;
5450
+ return result;
5446
5451
  }
5447
5452
  return value;
5448
5453
  case "multiCollectionDocumentList":
@@ -5453,7 +5458,8 @@ var resolve = async ({
5453
5458
  return { node: document };
5454
5459
  })
5455
5460
  };
5456
- } else if (info.fieldName === "documents" && value?.collection && value?.hasDocuments) {
5461
+ }
5462
+ if (info.fieldName === "documents" && value?.collection && value?.hasDocuments) {
5457
5463
  let filter = args.filter;
5458
5464
  if (typeof args?.filter !== "undefined" && args?.filter !== null && typeof value?.collection?.name === "string" && Object.keys(args.filter).includes(value?.collection?.name) && typeof args.filter[value?.collection?.name] !== "undefined") {
5459
5465
  filter = args.filter[value.collection.name];
@@ -5465,12 +5471,11 @@ var resolve = async ({
5465
5471
  },
5466
5472
  collection: value.collection
5467
5473
  });
5468
- } else {
5469
- throw new Error(
5470
- `Expected an array for result of ${info.fieldName} at ${info.path}`
5471
- );
5472
5474
  }
5473
- case "collectionDocument":
5475
+ throw new Error(
5476
+ `Expected an array for result of ${info.fieldName} at ${info.path}`
5477
+ );
5478
+ case "collectionDocument": {
5474
5479
  if (value) {
5475
5480
  return value;
5476
5481
  }
@@ -5483,6 +5488,7 @@ var resolve = async ({
5483
5488
  isCollectionSpecific: true
5484
5489
  });
5485
5490
  return result;
5491
+ }
5486
5492
  case "collectionDocumentList":
5487
5493
  return resolver.resolveCollectionConnection({
5488
5494
  args,
@@ -5491,7 +5497,7 @@ var resolve = async ({
5491
5497
  case "unionData":
5492
5498
  if (!value) {
5493
5499
  if (args.relativePath) {
5494
- const result2 = await resolver.resolveDocument({
5500
+ const result = await resolver.resolveDocument({
5495
5501
  args,
5496
5502
  collection: lookup.collection,
5497
5503
  isMutation,
@@ -5499,13 +5505,13 @@ var resolve = async ({
5499
5505
  isAddPendingDocument: false,
5500
5506
  isCollectionSpecific: true
5501
5507
  });
5502
- return result2;
5508
+ return result;
5503
5509
  }
5504
5510
  }
5505
5511
  return value;
5506
5512
  default:
5507
5513
  console.error(lookup);
5508
- throw new Error(`Unexpected resolve type`);
5514
+ throw new Error("Unexpected resolve type");
5509
5515
  }
5510
5516
  } catch (e) {
5511
5517
  handleFetchErrorError(e, verboseValue);
@@ -5536,9 +5542,8 @@ var resolve = async ({
5536
5542
  return {
5537
5543
  errors: [e]
5538
5544
  };
5539
- } else {
5540
- throw e;
5541
5545
  }
5546
+ throw e;
5542
5547
  }
5543
5548
  };
5544
5549
 
@@ -5568,7 +5573,7 @@ import path4 from "path";
5568
5573
  import { GraphQLError as GraphQLError5 } from "graphql";
5569
5574
  import micromatch2 from "micromatch";
5570
5575
  import sha2 from "js-sha1";
5571
- import _5 from "lodash";
5576
+ import set2 from "lodash.set";
5572
5577
  var createLocalDatabase = (config) => {
5573
5578
  const level = new TinaLevelClient(config?.port);
5574
5579
  level.openConnection();
@@ -6202,9 +6207,8 @@ var Database = class {
6202
6207
  collection: collection.name,
6203
6208
  stack: error.stack
6204
6209
  });
6205
- } else {
6206
- throw error;
6207
6210
  }
6211
+ throw error;
6208
6212
  }
6209
6213
  }),
6210
6214
  pageInfo: {
@@ -6554,9 +6558,9 @@ var Database = class {
6554
6558
  };
6555
6559
  var hashPasswordVisitor = async (node, path7) => {
6556
6560
  const passwordValuePath = [...path7, "value"];
6557
- const plaintextPassword = _5.get(node, passwordValuePath);
6561
+ const plaintextPassword = get(node, passwordValuePath);
6558
6562
  if (plaintextPassword) {
6559
- _5.set(
6563
+ set2(
6560
6564
  node,
6561
6565
  passwordValuePath,
6562
6566
  await generatePasswordHash({ password: plaintextPassword })
@@ -7305,3 +7309,5 @@ export {
7305
7309
  transformDocument,
7306
7310
  transformDocumentIntoPayload
7307
7311
  };
7312
+ //! Replaces _.flattenDeep()
7313
+ //! Replaces _.get()
@@ -14,7 +14,7 @@ export declare class TinaGraphQLError extends Error implements GraphQLError {
14
14
  [key: string]: any;
15
15
  constructor(message: string, extensions?: Record<string, any>);
16
16
  }
17
- export declare type TypeFetchErrorArgs = {
17
+ export type TypeFetchErrorArgs = {
18
18
  stack?: string;
19
19
  file?: string;
20
20
  includeAuditMessage?: boolean;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import type { ReferenceType, TinaField } from '@tinacms/schema-tools';
5
5
  import { FilterCondition } from '../database/datalayer';
6
- export declare type ReferenceResolver = (filter: Record<string, object>, fieldDefinition: ReferenceType) => Promise<{
6
+ export type ReferenceResolver = (filter: Record<string, object>, fieldDefinition: ReferenceType) => Promise<{
7
7
  edges: {
8
8
  node: any;
9
9
  }[];
@@ -12,8 +12,8 @@ interface ResolverConfig {
12
12
  }
13
13
  export declare const createResolver: (args: ResolverConfig) => Resolver;
14
14
  export declare const transformDocumentIntoPayload: (fullPath: string, rawData: {
15
- _collection;
16
- _template;
15
+ _collection: any;
16
+ _template: any;
17
17
  }, tinaSchema: TinaSchema, config?: GraphQLConfig, isAudit?: boolean) => Promise<{
18
18
  _sys: {
19
19
  title: any;
@@ -63,10 +63,10 @@ export declare class Resolver {
63
63
  }[];
64
64
  }[];
65
65
  format?: "json" | "md" | "markdown" | "mdx" | "yaml" | "yml" | "toml";
66
- ui?: import("@tinacms/schema-tools").UICollection<any, any, any>;
66
+ ui?: import("@tinacms/schema-tools").UICollection;
67
67
  defaultItem?: import("@tinacms/schema-tools").DefaultItem<Record<string, any>>;
68
- frontmatterFormat?: "json" | "yaml" | "toml";
69
- frontmatterDelimiters?: string | [string, string];
68
+ frontmatterFormat?: "yaml" | "toml" | "json";
69
+ frontmatterDelimiters?: [string, string] | string;
70
70
  match?: {
71
71
  include?: string;
72
72
  exclude?: string;
@@ -91,10 +91,10 @@ export declare class Resolver {
91
91
  }[];
92
92
  }[];
93
93
  format?: "json" | "md" | "markdown" | "mdx" | "yaml" | "yml" | "toml";
94
- ui?: import("@tinacms/schema-tools").UICollection<any, any, any>;
94
+ ui?: import("@tinacms/schema-tools").UICollection;
95
95
  defaultItem?: import("@tinacms/schema-tools").DefaultItem<Record<string, any>>;
96
- frontmatterFormat?: "json" | "yaml" | "toml";
97
- frontmatterDelimiters?: string | [string, string];
96
+ frontmatterFormat?: "yaml" | "toml" | "json";
97
+ frontmatterDelimiters?: [string, string] | string;
98
98
  match?: {
99
99
  include?: string;
100
100
  exclude?: string;
@@ -170,6 +170,8 @@ export declare class Resolver {
170
170
  [key: string]: unknown;
171
171
  } | {
172
172
  [key: string]: unknown;
173
+ }[] | {
174
+ _template: string;
173
175
  }[]>;
174
176
  createResolveDocument: ({ collection, realPath, args, isAddPendingDocument, }: {
175
177
  collection: Collection<true>;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
 
3
3
  */
4
- import { Schema, Collection } from '@tinacms/schema-tools';
4
+ import { type Schema, type Collection } from '@tinacms/schema-tools';
5
5
  export declare const validateSchema: (schema: Schema) => Promise<{
6
6
  collections: Collection<true>[];
7
7
  config: import("@tinacms/schema-tools").Config<undefined, undefined, undefined, undefined, undefined>;
@@ -8,7 +8,7 @@ export declare const setup: (rootPath: string, schema: Schema, level: Level) =>
8
8
  database: Database;
9
9
  }>;
10
10
  export declare const print: (fixture: Fixture) => string;
11
- export declare type Fixture = {
11
+ export type Fixture = {
12
12
  description?: string;
13
13
  name: string;
14
14
  assert: 'output';
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
 
3
3
  */
4
- export declare type GraphQLConfig = {
4
+ export type GraphQLConfig = {
5
5
  useRelativeMedia: true;
6
6
  } | {
7
7
  useRelativeMedia: false;
package/dist/util.d.ts CHANGED
@@ -12,8 +12,10 @@ import * as yup from 'yup';
12
12
  * })
13
13
  * ```
14
14
  */
15
- export declare const sequential: <A, B>(items: A[], callback: (args: A, idx: number) => Promise<B>) => Promise<B[]>;
15
+ export declare const sequential: <A, B>(items: A[] | undefined, callback: (args: A, idx: number) => Promise<B>) => Promise<B[]>;
16
16
  export declare function assertShape<T>(value: unknown, yupSchema: (args: typeof yup) => yup.AnySchema, errorMessage?: string): asserts value is T;
17
17
  export declare const atob: (b64Encoded: string) => string;
18
18
  export declare const btoa: (string: string) => string;
19
19
  export declare const lastItem: (arr: (number | string)[]) => string | number;
20
+ export declare const get: (obj: any, path: any, defaultValue?: any) => any;
21
+ export declare const flattenDeep: (arr: any) => any;