@takeshape/schema 10.2.20 → 10.2.24

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.
Files changed (68) hide show
  1. package/dist/api-version.js +2 -4
  2. package/dist/builtin-schema.js +4 -7
  3. package/dist/migration/index.js +2 -4
  4. package/dist/migration/to/v3.0.0.js +1 -2
  5. package/dist/migration/to/v3.1.0.js +1 -2
  6. package/dist/migration/to/v3.10.0.js +1 -2
  7. package/dist/migration/to/v3.11.0.js +1 -2
  8. package/dist/migration/to/v3.12.0.js +1 -2
  9. package/dist/migration/to/v3.12.1.js +1 -2
  10. package/dist/migration/to/v3.12.2.js +1 -2
  11. package/dist/migration/to/v3.12.3.js +1 -2
  12. package/dist/migration/to/v3.13.0.js +1 -2
  13. package/dist/migration/to/v3.14.0.js +1 -2
  14. package/dist/migration/to/v3.15.0.js +1 -2
  15. package/dist/migration/to/v3.16.0.js +1 -2
  16. package/dist/migration/to/v3.17.0.js +1 -2
  17. package/dist/migration/to/v3.17.1.js +1 -2
  18. package/dist/migration/to/v3.18.0.js +1 -2
  19. package/dist/migration/to/v3.18.1.js +1 -2
  20. package/dist/migration/to/v3.18.2.js +1 -2
  21. package/dist/migration/to/v3.19.0.js +1 -2
  22. package/dist/migration/to/v3.2.0.js +1 -2
  23. package/dist/migration/to/v3.20.0.js +1 -2
  24. package/dist/migration/to/v3.21.0.js +1 -2
  25. package/dist/migration/to/v3.22.0.js +1 -2
  26. package/dist/migration/to/v3.23.0.js +1 -2
  27. package/dist/migration/to/v3.24.0.js +1 -2
  28. package/dist/migration/to/v3.25.0.js +1 -2
  29. package/dist/migration/to/v3.26.0.js +1 -2
  30. package/dist/migration/to/v3.27.0.js +1 -2
  31. package/dist/migration/to/v3.28.0.js +1 -2
  32. package/dist/migration/to/v3.29.0.js +1 -2
  33. package/dist/migration/to/v3.3.0.js +1 -2
  34. package/dist/migration/to/v3.30.0.js +1 -2
  35. package/dist/migration/to/v3.31.0.js +1 -2
  36. package/dist/migration/to/v3.32.0.js +1 -2
  37. package/dist/migration/to/v3.33.0.js +1 -2
  38. package/dist/migration/to/v3.34.0.js +1 -2
  39. package/dist/migration/to/v3.35.0.js +1 -2
  40. package/dist/migration/to/v3.36.0.js +1 -2
  41. package/dist/migration/to/v3.37.0.js +1 -2
  42. package/dist/migration/to/v3.38.0.js +1 -2
  43. package/dist/migration/to/v3.39.0.js +1 -2
  44. package/dist/migration/to/v3.4.0.js +1 -2
  45. package/dist/migration/to/v3.5.0.js +1 -2
  46. package/dist/migration/to/v3.5.1.js +1 -2
  47. package/dist/migration/to/v3.6.0.js +1 -2
  48. package/dist/migration/to/v3.7.0.js +1 -2
  49. package/dist/migration/to/v3.8.0.js +1 -2
  50. package/dist/migration/to/v3.9.0.js +1 -2
  51. package/dist/project-schema/index.js +50 -100
  52. package/dist/scalars.js +1 -2
  53. package/dist/schema-util.js +12 -24
  54. package/dist/schemas/index.js +2 -4
  55. package/dist/taxonomies.js +3 -5
  56. package/dist/template-shapes/templates.js +20 -40
  57. package/dist/template-shapes/types.js +2 -3
  58. package/dist/template-shapes/where.js +5 -11
  59. package/dist/types/types.js +5 -9
  60. package/dist/unions.js +2 -4
  61. package/dist/util/api-indexing.js +2 -4
  62. package/dist/versions.js +3 -6
  63. package/dist/workflows.js +1 -2
  64. package/es/layers/type-utils.js +1 -0
  65. package/es/services.js +3 -0
  66. package/es/template-shapes/where.js +0 -1
  67. package/es/types/types.js +4 -0
  68. package/package.json +6 -6
@@ -21,7 +21,5 @@ const createVersionPredicate = (featureVersion, comparison) => {
21
21
  };
22
22
  };
23
23
  exports.createVersionPredicate = createVersionPredicate;
24
- const workflowsEnabled = createVersionPredicate('2.0.0', _gte.default);
25
- exports.workflowsEnabled = workflowsEnabled;
26
- const whereClauseEnabled = createVersionPredicate('2.0.0', _gte.default);
27
- exports.whereClauseEnabled = whereClauseEnabled;
24
+ const workflowsEnabled = exports.workflowsEnabled = createVersionPredicate('2.0.0', _gte.default);
25
+ const whereClauseEnabled = exports.whereClauseEnabled = createVersionPredicate('2.0.0', _gte.default);
@@ -18,14 +18,13 @@ function getAssetS3Path(content) {
18
18
  function setAssetS3Path(content, path) {
19
19
  content[ASSET_PATH] = path;
20
20
  }
21
- const jsonShape = {
21
+ const jsonShape = exports.jsonShape = {
22
22
  id: 'JSON',
23
23
  name: 'JSON',
24
24
  title: 'JSON',
25
25
  schema: {}
26
26
  };
27
- exports.jsonShape = jsonShape;
28
- const builtInShapes = {
27
+ const builtInShapes = exports.builtInShapes = {
29
28
  JSON: jsonShape,
30
29
  TSRelationship: {
31
30
  id: 'TSRelationship',
@@ -395,8 +394,7 @@ const builtInShapes = {
395
394
  }
396
395
  }
397
396
  };
398
- exports.builtInShapes = builtInShapes;
399
- const builtInForms = {
397
+ const builtInForms = exports.builtInForms = {
400
398
  Asset: {
401
399
  default: {
402
400
  order: ['title', 'description', 'caption', 'credit', 'filename', 'path', 'mimeType', 'sourceUrl', 'uploadStatus'],
@@ -609,5 +607,4 @@ const builtInForms = {
609
607
  }
610
608
  }
611
609
  }
612
- };
613
- exports.builtInForms = builtInForms;
610
+ };
@@ -68,7 +68,7 @@ Object.keys(_utils).forEach(function (key) {
68
68
  });
69
69
  });
70
70
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
71
- const migrateTo = {
71
+ const migrateTo = exports.migrateTo = {
72
72
  'v3.0.0': _v.default,
73
73
  'v3.1.0': _v2.default,
74
74
  'v3.2.0': _v3.default,
@@ -117,6 +117,4 @@ const migrateTo = {
117
117
  'v3.38.0': _v46.default,
118
118
  'v3.39.0': _v47.default
119
119
  };
120
- exports.migrateTo = migrateTo;
121
- const listTypePrefix = 'PaginatedList';
122
- exports.listTypePrefix = listTypePrefix;
120
+ const listTypePrefix = exports.listTypePrefix = 'PaginatedList';
@@ -260,5 +260,4 @@ const migrate = async (_, projectSchema) => {
260
260
  forms
261
261
  });
262
262
  };
263
- var _default = migrate;
264
- exports.default = _default;
263
+ var _default = exports.default = migrate;
@@ -203,5 +203,4 @@ const migrate = async (context, projectSchema) => {
203
203
  schemaVersion: '3.1.0'
204
204
  });
205
205
  };
206
- var _default = migrate;
207
- exports.default = _default;
206
+ var _default = exports.default = migrate;
@@ -88,5 +88,4 @@ const migrate = async (_, projectSchema) => {
88
88
  schemaVersion: '3.10.0'
89
89
  };
90
90
  };
91
- var _default = migrate;
92
- exports.default = _default;
91
+ var _default = exports.default = migrate;
@@ -94,5 +94,4 @@ const migrate = async (context, projectSchema) => {
94
94
  schemaVersion: '3.11.0'
95
95
  };
96
96
  };
97
- var _default = migrate;
98
- exports.default = _default;
97
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.12.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.12.1'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.12.2'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -80,5 +80,4 @@ const migrate = async (_, {
80
80
  indexedShapes
81
81
  };
82
82
  };
83
- var _default = migrate;
84
- exports.default = _default;
83
+ var _default = exports.default = migrate;
@@ -23,5 +23,4 @@ const migrate = async (_, projectSchema) => {
23
23
  schemaVersion: '3.13.0'
24
24
  };
25
25
  };
26
- var _default = migrate;
27
- exports.default = _default;
26
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.14.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.15.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.16.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -31,5 +31,4 @@ const migrate = async (_, projectSchema) => {
31
31
  schemaVersion: '3.17.0'
32
32
  };
33
33
  };
34
- var _default = migrate;
35
- exports.default = _default;
34
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.17.1'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -68,5 +68,4 @@ const migrate = async (_, projectSchema) => {
68
68
  schemaVersion: '3.18.0'
69
69
  };
70
70
  };
71
- var _default = migrate;
72
- exports.default = _default;
71
+ var _default = exports.default = migrate;
@@ -19,5 +19,4 @@ const migrate = async (_, projectSchema) => {
19
19
  schemaVersion: '3.18.1'
20
20
  };
21
21
  };
22
- var _default = migrate;
23
- exports.default = _default;
22
+ var _default = exports.default = migrate;
@@ -26,5 +26,4 @@ const migrate = async (_, projectSchema) => {
26
26
  schemaVersion: '3.18.2'
27
27
  };
28
28
  };
29
- var _default = migrate;
30
- exports.default = _default;
29
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.19.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.2.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -29,5 +29,4 @@ const migrate = async (_, projectSchema) => {
29
29
  schemaVersion: '3.20.0'
30
30
  };
31
31
  };
32
- var _default = migrate;
33
- exports.default = _default;
32
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.21.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -35,5 +35,4 @@ const migrate = async (_, projectSchema) => {
35
35
  }
36
36
  return migrated;
37
37
  };
38
- var _default = migrate;
39
- exports.default = _default;
38
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.23.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -19,5 +19,4 @@ const migrate = async (_, projectSchema) => {
19
19
  schemaVersion: '3.24.0'
20
20
  };
21
21
  };
22
- var _default = migrate;
23
- exports.default = _default;
22
+ var _default = exports.default = migrate;
@@ -17,5 +17,4 @@ const migrate = async (_, projectSchema) => {
17
17
  schemaVersion: '3.25.0'
18
18
  };
19
19
  };
20
- var _default = migrate;
21
- exports.default = _default;
20
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.26.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.27.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.28.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.29.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -19,5 +19,4 @@ const migrate = async (context, projectSchema) => {
19
19
  dataKey
20
20
  };
21
21
  };
22
- var _default = migrate;
23
- exports.default = _default;
22
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.30.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -39,5 +39,4 @@ const migrate = async (_, projectSchema) => {
39
39
  schemaVersion: '3.31.0'
40
40
  };
41
41
  };
42
- var _default = migrate;
43
- exports.default = _default;
42
+ var _default = exports.default = migrate;
@@ -96,5 +96,4 @@ const migrate = async (_, projectSchema) => {
96
96
  schemaVersion: '3.32.0'
97
97
  };
98
98
  };
99
- var _default = migrate;
100
- exports.default = _default;
99
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.33.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -150,5 +150,4 @@ const migrate = async (_, projectSchema) => {
150
150
  schemaVersion: '3.34.0'
151
151
  };
152
152
  };
153
- var _default = migrate;
154
- exports.default = _default;
153
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.35.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -28,5 +28,4 @@ const migrate = async (_, projectSchema) => {
28
28
  }
29
29
  return result;
30
30
  };
31
- var _default = migrate;
32
- exports.default = _default;
31
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.37.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.38.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -51,5 +51,4 @@ const migrate = async ({
51
51
  schemaVersion: '3.39.0'
52
52
  };
53
53
  };
54
- var _default = migrate;
55
- exports.default = _default;
54
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.4.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.5.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.5.1'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.6.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.7.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -13,5 +13,4 @@ const migrate = async (_, projectSchema) => {
13
13
  schemaVersion: '3.8.0'
14
14
  };
15
15
  };
16
- var _default = migrate;
17
- exports.default = _default;
16
+ var _default = exports.default = migrate;
@@ -81,5 +81,4 @@ const migrate = async (_, projectSchema) => {
81
81
  schemaVersion: '3.9.0'
82
82
  };
83
83
  };
84
- var _default = migrate;
85
- exports.default = _default;
84
+ var _default = exports.default = migrate;
@@ -673,103 +673,53 @@ function createVersionPredicate(expectedVersion) {
673
673
  return Boolean(expectedVersion && schemaVersion && expectedVersion === schemaVersion);
674
674
  };
675
675
  }
676
- const isProjectSchemaJSONV1_0_0 = createVersionPredicate('1.0.0');
677
- exports.isProjectSchemaJSONV1_0_0 = isProjectSchemaJSONV1_0_0;
678
- const isProjectSchemaJSONV3_0_0 = createVersionPredicate('3.0.0');
679
- exports.isProjectSchemaJSONV3_0_0 = isProjectSchemaJSONV3_0_0;
680
- const isProjectSchemaJSONV3_1_0 = createVersionPredicate('3.1.0');
681
- exports.isProjectSchemaJSONV3_1_0 = isProjectSchemaJSONV3_1_0;
682
- const isProjectSchemaJSONV3_2_0 = createVersionPredicate('3.2.0');
683
- exports.isProjectSchemaJSONV3_2_0 = isProjectSchemaJSONV3_2_0;
684
- const isProjectSchemaJSONV3_3_0 = createVersionPredicate('3.3.0');
685
- exports.isProjectSchemaJSONV3_3_0 = isProjectSchemaJSONV3_3_0;
686
- const isProjectSchemaJSONV3_4_0 = createVersionPredicate('3.4.0');
687
- exports.isProjectSchemaJSONV3_4_0 = isProjectSchemaJSONV3_4_0;
688
- const isProjectSchemaJSONV3_5_0 = createVersionPredicate('3.5.0');
689
- exports.isProjectSchemaJSONV3_5_0 = isProjectSchemaJSONV3_5_0;
690
- const isProjectSchemaJSONV3_5_1 = createVersionPredicate('3.5.1');
691
- exports.isProjectSchemaJSONV3_5_1 = isProjectSchemaJSONV3_5_1;
692
- const isProjectSchemaJSONV3_6_0 = createVersionPredicate('3.6.0');
693
- exports.isProjectSchemaJSONV3_6_0 = isProjectSchemaJSONV3_6_0;
694
- const isProjectSchemaJSONV3_7_0 = createVersionPredicate('3.7.0');
695
- exports.isProjectSchemaJSONV3_7_0 = isProjectSchemaJSONV3_7_0;
696
- const isProjectSchemaJSONV3_8_0 = createVersionPredicate('3.8.0');
697
- exports.isProjectSchemaJSONV3_8_0 = isProjectSchemaJSONV3_8_0;
698
- const isProjectSchemaJSONV3_9_0 = createVersionPredicate('3.9.0');
699
- exports.isProjectSchemaJSONV3_9_0 = isProjectSchemaJSONV3_9_0;
700
- const isProjectSchemaJSONV3_10_0 = createVersionPredicate('3.10.0');
701
- exports.isProjectSchemaJSONV3_10_0 = isProjectSchemaJSONV3_10_0;
702
- const isProjectSchemaJSONV3_11_0 = createVersionPredicate('3.11.0');
703
- exports.isProjectSchemaJSONV3_11_0 = isProjectSchemaJSONV3_11_0;
704
- const isProjectSchemaJSONV3_12_0 = createVersionPredicate('3.12.0');
705
- exports.isProjectSchemaJSONV3_12_0 = isProjectSchemaJSONV3_12_0;
706
- const isProjectSchemaJSONV3_12_1 = createVersionPredicate('3.12.1');
707
- exports.isProjectSchemaJSONV3_12_1 = isProjectSchemaJSONV3_12_1;
708
- const isProjectSchemaJSONV3_12_2 = createVersionPredicate('3.12.2');
709
- exports.isProjectSchemaJSONV3_12_2 = isProjectSchemaJSONV3_12_2;
710
- const isProjectSchemaJSONV3_12_3 = createVersionPredicate('3.12.3');
711
- exports.isProjectSchemaJSONV3_12_3 = isProjectSchemaJSONV3_12_3;
712
- const isProjectSchemaJSONV3_13_0 = createVersionPredicate('3.13.0');
713
- exports.isProjectSchemaJSONV3_13_0 = isProjectSchemaJSONV3_13_0;
714
- const isProjectSchemaJSONV3_14_0 = createVersionPredicate('3.14.0');
715
- exports.isProjectSchemaJSONV3_14_0 = isProjectSchemaJSONV3_14_0;
716
- const isProjectSchemaJSONV3_15_0 = createVersionPredicate('3.15.0');
717
- exports.isProjectSchemaJSONV3_15_0 = isProjectSchemaJSONV3_15_0;
718
- const isProjectSchemaJSONV3_16_0 = createVersionPredicate('3.16.0');
719
- exports.isProjectSchemaJSONV3_16_0 = isProjectSchemaJSONV3_16_0;
720
- const isProjectSchemaJSONV3_17_0 = createVersionPredicate('3.17.0');
721
- exports.isProjectSchemaJSONV3_17_0 = isProjectSchemaJSONV3_17_0;
722
- const isProjectSchemaJSONV3_17_1 = createVersionPredicate('3.17.1');
723
- exports.isProjectSchemaJSONV3_17_1 = isProjectSchemaJSONV3_17_1;
724
- const isProjectSchemaJSONV3_18_0 = createVersionPredicate('3.18.0');
725
- exports.isProjectSchemaJSONV3_18_0 = isProjectSchemaJSONV3_18_0;
726
- const isProjectSchemaJSONV3_18_1 = createVersionPredicate('3.18.1');
727
- exports.isProjectSchemaJSONV3_18_1 = isProjectSchemaJSONV3_18_1;
728
- const isProjectSchemaJSONV3_18_2 = createVersionPredicate('3.18.2');
729
- exports.isProjectSchemaJSONV3_18_2 = isProjectSchemaJSONV3_18_2;
730
- const isProjectSchemaJSONV3_19_0 = createVersionPredicate('3.19.0');
731
- exports.isProjectSchemaJSONV3_19_0 = isProjectSchemaJSONV3_19_0;
732
- const isProjectSchemaJSONV3_20_0 = createVersionPredicate('3.20.0');
733
- exports.isProjectSchemaJSONV3_20_0 = isProjectSchemaJSONV3_20_0;
734
- const isProjectSchemaJSONV3_21_0 = createVersionPredicate('3.21.0');
735
- exports.isProjectSchemaJSONV3_21_0 = isProjectSchemaJSONV3_21_0;
736
- const isProjectSchemaJSONV3_22_0 = createVersionPredicate('3.22.0');
737
- exports.isProjectSchemaJSONV3_22_0 = isProjectSchemaJSONV3_22_0;
738
- const isProjectSchemaJSONV3_23_0 = createVersionPredicate('3.23.0');
739
- exports.isProjectSchemaJSONV3_23_0 = isProjectSchemaJSONV3_23_0;
740
- const isProjectSchemaJSONV3_24_0 = createVersionPredicate('3.24.0');
741
- exports.isProjectSchemaJSONV3_24_0 = isProjectSchemaJSONV3_24_0;
742
- const isProjectSchemaJSONV3_25_0 = createVersionPredicate('3.25.0');
743
- exports.isProjectSchemaJSONV3_25_0 = isProjectSchemaJSONV3_25_0;
744
- const isProjectSchemaJSONV3_26_0 = createVersionPredicate('3.26.0');
745
- exports.isProjectSchemaJSONV3_26_0 = isProjectSchemaJSONV3_26_0;
746
- const isProjectSchemaJSONV3_27_0 = createVersionPredicate('3.27.0');
747
- exports.isProjectSchemaJSONV3_27_0 = isProjectSchemaJSONV3_27_0;
748
- const isProjectSchemaJSONV3_28_0 = createVersionPredicate('3.28.0');
749
- exports.isProjectSchemaJSONV3_28_0 = isProjectSchemaJSONV3_28_0;
750
- const isProjectSchemaJSONV3_29_0 = createVersionPredicate('3.29.0');
751
- exports.isProjectSchemaJSONV3_29_0 = isProjectSchemaJSONV3_29_0;
752
- const isProjectSchemaJSONV3_30_0 = createVersionPredicate('3.30.0');
753
- exports.isProjectSchemaJSONV3_30_0 = isProjectSchemaJSONV3_30_0;
754
- const isProjectSchemaJSONV3_31_0 = createVersionPredicate('3.31.0');
755
- exports.isProjectSchemaJSONV3_31_0 = isProjectSchemaJSONV3_31_0;
756
- const isProjectSchemaJSONV3_32_0 = createVersionPredicate('3.32.0');
757
- exports.isProjectSchemaJSONV3_32_0 = isProjectSchemaJSONV3_32_0;
758
- const isProjectSchemaJSONV3_33_0 = createVersionPredicate('3.33.0');
759
- exports.isProjectSchemaJSONV3_33_0 = isProjectSchemaJSONV3_33_0;
760
- const isProjectSchemaJSONV3_34_0 = createVersionPredicate('3.34.0');
761
- exports.isProjectSchemaJSONV3_34_0 = isProjectSchemaJSONV3_34_0;
762
- const isProjectSchemaJSONV3_35_0 = createVersionPredicate('3.35.0');
763
- exports.isProjectSchemaJSONV3_35_0 = isProjectSchemaJSONV3_35_0;
764
- const isProjectSchemaJSONV3_36_0 = createVersionPredicate('3.36.0');
765
- exports.isProjectSchemaJSONV3_36_0 = isProjectSchemaJSONV3_36_0;
766
- const isProjectSchemaJSONV3_37_0 = createVersionPredicate('3.37.0');
767
- exports.isProjectSchemaJSONV3_37_0 = isProjectSchemaJSONV3_37_0;
768
- const isProjectSchemaJSONV3_38_0 = createVersionPredicate('3.38.0');
769
- exports.isProjectSchemaJSONV3_38_0 = isProjectSchemaJSONV3_38_0;
770
- const isProjectSchemaJSONV3_39_0 = createVersionPredicate('3.39.0');
771
- exports.isProjectSchemaJSONV3_39_0 = isProjectSchemaJSONV3_39_0;
772
- const isLatestProjectSchemaJSON = createVersionPredicate('3.39.0');
773
- exports.isLatestProjectSchemaJSON = isLatestProjectSchemaJSON;
774
- const isProjectSchemaJSONV4_0_0 = createVersionPredicate('4.0.0');
775
- exports.isProjectSchemaJSONV4_0_0 = isProjectSchemaJSONV4_0_0;
676
+ const isProjectSchemaJSONV1_0_0 = exports.isProjectSchemaJSONV1_0_0 = createVersionPredicate('1.0.0');
677
+ const isProjectSchemaJSONV3_0_0 = exports.isProjectSchemaJSONV3_0_0 = createVersionPredicate('3.0.0');
678
+ const isProjectSchemaJSONV3_1_0 = exports.isProjectSchemaJSONV3_1_0 = createVersionPredicate('3.1.0');
679
+ const isProjectSchemaJSONV3_2_0 = exports.isProjectSchemaJSONV3_2_0 = createVersionPredicate('3.2.0');
680
+ const isProjectSchemaJSONV3_3_0 = exports.isProjectSchemaJSONV3_3_0 = createVersionPredicate('3.3.0');
681
+ const isProjectSchemaJSONV3_4_0 = exports.isProjectSchemaJSONV3_4_0 = createVersionPredicate('3.4.0');
682
+ const isProjectSchemaJSONV3_5_0 = exports.isProjectSchemaJSONV3_5_0 = createVersionPredicate('3.5.0');
683
+ const isProjectSchemaJSONV3_5_1 = exports.isProjectSchemaJSONV3_5_1 = createVersionPredicate('3.5.1');
684
+ const isProjectSchemaJSONV3_6_0 = exports.isProjectSchemaJSONV3_6_0 = createVersionPredicate('3.6.0');
685
+ const isProjectSchemaJSONV3_7_0 = exports.isProjectSchemaJSONV3_7_0 = createVersionPredicate('3.7.0');
686
+ const isProjectSchemaJSONV3_8_0 = exports.isProjectSchemaJSONV3_8_0 = createVersionPredicate('3.8.0');
687
+ const isProjectSchemaJSONV3_9_0 = exports.isProjectSchemaJSONV3_9_0 = createVersionPredicate('3.9.0');
688
+ const isProjectSchemaJSONV3_10_0 = exports.isProjectSchemaJSONV3_10_0 = createVersionPredicate('3.10.0');
689
+ const isProjectSchemaJSONV3_11_0 = exports.isProjectSchemaJSONV3_11_0 = createVersionPredicate('3.11.0');
690
+ const isProjectSchemaJSONV3_12_0 = exports.isProjectSchemaJSONV3_12_0 = createVersionPredicate('3.12.0');
691
+ const isProjectSchemaJSONV3_12_1 = exports.isProjectSchemaJSONV3_12_1 = createVersionPredicate('3.12.1');
692
+ const isProjectSchemaJSONV3_12_2 = exports.isProjectSchemaJSONV3_12_2 = createVersionPredicate('3.12.2');
693
+ const isProjectSchemaJSONV3_12_3 = exports.isProjectSchemaJSONV3_12_3 = createVersionPredicate('3.12.3');
694
+ const isProjectSchemaJSONV3_13_0 = exports.isProjectSchemaJSONV3_13_0 = createVersionPredicate('3.13.0');
695
+ const isProjectSchemaJSONV3_14_0 = exports.isProjectSchemaJSONV3_14_0 = createVersionPredicate('3.14.0');
696
+ const isProjectSchemaJSONV3_15_0 = exports.isProjectSchemaJSONV3_15_0 = createVersionPredicate('3.15.0');
697
+ const isProjectSchemaJSONV3_16_0 = exports.isProjectSchemaJSONV3_16_0 = createVersionPredicate('3.16.0');
698
+ const isProjectSchemaJSONV3_17_0 = exports.isProjectSchemaJSONV3_17_0 = createVersionPredicate('3.17.0');
699
+ const isProjectSchemaJSONV3_17_1 = exports.isProjectSchemaJSONV3_17_1 = createVersionPredicate('3.17.1');
700
+ const isProjectSchemaJSONV3_18_0 = exports.isProjectSchemaJSONV3_18_0 = createVersionPredicate('3.18.0');
701
+ const isProjectSchemaJSONV3_18_1 = exports.isProjectSchemaJSONV3_18_1 = createVersionPredicate('3.18.1');
702
+ const isProjectSchemaJSONV3_18_2 = exports.isProjectSchemaJSONV3_18_2 = createVersionPredicate('3.18.2');
703
+ const isProjectSchemaJSONV3_19_0 = exports.isProjectSchemaJSONV3_19_0 = createVersionPredicate('3.19.0');
704
+ const isProjectSchemaJSONV3_20_0 = exports.isProjectSchemaJSONV3_20_0 = createVersionPredicate('3.20.0');
705
+ const isProjectSchemaJSONV3_21_0 = exports.isProjectSchemaJSONV3_21_0 = createVersionPredicate('3.21.0');
706
+ const isProjectSchemaJSONV3_22_0 = exports.isProjectSchemaJSONV3_22_0 = createVersionPredicate('3.22.0');
707
+ const isProjectSchemaJSONV3_23_0 = exports.isProjectSchemaJSONV3_23_0 = createVersionPredicate('3.23.0');
708
+ const isProjectSchemaJSONV3_24_0 = exports.isProjectSchemaJSONV3_24_0 = createVersionPredicate('3.24.0');
709
+ const isProjectSchemaJSONV3_25_0 = exports.isProjectSchemaJSONV3_25_0 = createVersionPredicate('3.25.0');
710
+ const isProjectSchemaJSONV3_26_0 = exports.isProjectSchemaJSONV3_26_0 = createVersionPredicate('3.26.0');
711
+ const isProjectSchemaJSONV3_27_0 = exports.isProjectSchemaJSONV3_27_0 = createVersionPredicate('3.27.0');
712
+ const isProjectSchemaJSONV3_28_0 = exports.isProjectSchemaJSONV3_28_0 = createVersionPredicate('3.28.0');
713
+ const isProjectSchemaJSONV3_29_0 = exports.isProjectSchemaJSONV3_29_0 = createVersionPredicate('3.29.0');
714
+ const isProjectSchemaJSONV3_30_0 = exports.isProjectSchemaJSONV3_30_0 = createVersionPredicate('3.30.0');
715
+ const isProjectSchemaJSONV3_31_0 = exports.isProjectSchemaJSONV3_31_0 = createVersionPredicate('3.31.0');
716
+ const isProjectSchemaJSONV3_32_0 = exports.isProjectSchemaJSONV3_32_0 = createVersionPredicate('3.32.0');
717
+ const isProjectSchemaJSONV3_33_0 = exports.isProjectSchemaJSONV3_33_0 = createVersionPredicate('3.33.0');
718
+ const isProjectSchemaJSONV3_34_0 = exports.isProjectSchemaJSONV3_34_0 = createVersionPredicate('3.34.0');
719
+ const isProjectSchemaJSONV3_35_0 = exports.isProjectSchemaJSONV3_35_0 = createVersionPredicate('3.35.0');
720
+ const isProjectSchemaJSONV3_36_0 = exports.isProjectSchemaJSONV3_36_0 = createVersionPredicate('3.36.0');
721
+ const isProjectSchemaJSONV3_37_0 = exports.isProjectSchemaJSONV3_37_0 = createVersionPredicate('3.37.0');
722
+ const isProjectSchemaJSONV3_38_0 = exports.isProjectSchemaJSONV3_38_0 = createVersionPredicate('3.38.0');
723
+ const isProjectSchemaJSONV3_39_0 = exports.isProjectSchemaJSONV3_39_0 = createVersionPredicate('3.39.0');
724
+ const isLatestProjectSchemaJSON = exports.isLatestProjectSchemaJSON = createVersionPredicate('3.39.0');
725
+ const isProjectSchemaJSONV4_0_0 = exports.isProjectSchemaJSONV4_0_0 = createVersionPredicate('4.0.0');
package/dist/scalars.js CHANGED
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.isScalar = isScalar;
7
7
  exports.scalars = void 0;
8
- const scalars = ['string', 'boolean', 'integer', 'number'];
9
- exports.scalars = scalars;
8
+ const scalars = exports.scalars = ['string', 'boolean', 'integer', 'number'];
10
9
  function isScalar(str) {
11
10
  return Array.from(scalars).includes(str);
12
11
  }
@@ -88,8 +88,7 @@ var _isArray = _interopRequireDefault(require("lodash/isArray"));
88
88
  var _some = _interopRequireDefault(require("lodash/some"));
89
89
  var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
90
90
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
91
- const SERVICE_OBJECT_PATTERN_NAME = 'pattern:service-object';
92
- exports.SERVICE_OBJECT_PATTERN_NAME = SERVICE_OBJECT_PATTERN_NAME;
91
+ const SERVICE_OBJECT_PATTERN_NAME = exports.SERVICE_OBJECT_PATTERN_NAME = 'pattern:service-object';
93
92
  function isBuiltinShape(shapeName) {
94
93
  return Boolean(_builtinSchema.builtInShapes[shapeName]);
95
94
  }
@@ -104,22 +103,15 @@ function isBuiltinType(projectSchema, refSchema) {
104
103
  const shapeName = (0, _refs.getRefShapeName)(projectSchema, refSchema);
105
104
  return shapeName !== undefined && isBuiltinShape(shapeName);
106
105
  }
107
- const schemaMetadataKeys = ['$comment', 'title', 'description', '@l10n', '@deprecationReason', '@tag', '@tags', '@syncLocaleStructure', '@sensitive'];
108
- exports.schemaMetadataKeys = schemaMetadataKeys;
109
- const commonSchemaKeys = ['type', 'default', 'readOnly', ...schemaMetadataKeys];
110
- exports.commonSchemaKeys = commonSchemaKeys;
111
- const scalarSchemaKeys = [...commonSchemaKeys, 'format', 'oneOf', 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', 'minLength', 'pattern'];
112
- exports.scalarSchemaKeys = scalarSchemaKeys;
113
- const objectSchemaKeys = [...commonSchemaKeys, 'properties', 'required'];
114
- exports.objectSchemaKeys = objectSchemaKeys;
115
- const arraySchemaKeys = [...commonSchemaKeys, 'items', 'additionalItems', 'maxItems', 'minItems', 'uniqueItems'];
116
- exports.arraySchemaKeys = arraySchemaKeys;
117
- const multipleRelationshipSchemaKeys = [...schemaMetadataKeys, 'maxItems', 'minItems'];
106
+ const schemaMetadataKeys = exports.schemaMetadataKeys = ['$comment', 'title', 'description', '@l10n', '@deprecationReason', '@tag', '@tags', '@syncLocaleStructure', '@sensitive'];
107
+ const commonSchemaKeys = exports.commonSchemaKeys = ['type', 'default', 'readOnly', ...schemaMetadataKeys];
108
+ const scalarSchemaKeys = exports.scalarSchemaKeys = [...commonSchemaKeys, 'format', 'oneOf', 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', 'minLength', 'pattern'];
109
+ const objectSchemaKeys = exports.objectSchemaKeys = [...commonSchemaKeys, 'properties', 'required'];
110
+ const arraySchemaKeys = exports.arraySchemaKeys = [...commonSchemaKeys, 'items', 'additionalItems', 'maxItems', 'minItems', 'uniqueItems'];
111
+ const multipleRelationshipSchemaKeys = exports.multipleRelationshipSchemaKeys = [...schemaMetadataKeys, 'maxItems', 'minItems'];
118
112
 
119
113
  // All properties except properties, items, additionalItems
120
- exports.multipleRelationshipSchemaKeys = multipleRelationshipSchemaKeys;
121
- const nonStructuralSchemaKeys = [...scalarSchemaKeys, '@resolver', '@input', '@output', '@backreference', '@args', 'required', 'maxItems', 'minItems', 'uniqueItems'];
122
- exports.nonStructuralSchemaKeys = nonStructuralSchemaKeys;
114
+ const nonStructuralSchemaKeys = exports.nonStructuralSchemaKeys = [...scalarSchemaKeys, '@resolver', '@input', '@output', '@backreference', '@args', 'required', 'maxItems', 'minItems', 'uniqueItems'];
123
115
  function getServiceIdFieldName(serviceFieldName) {
124
116
  return `${serviceFieldName}Id`;
125
117
  }
@@ -319,8 +311,7 @@ function getCommonBuiltInProperties(shape) {
319
311
  }
320
312
  };
321
313
  }
322
- const DEFAULT_ID_FIELD = 'id';
323
- exports.DEFAULT_ID_FIELD = DEFAULT_ID_FIELD;
314
+ const DEFAULT_ID_FIELD = exports.DEFAULT_ID_FIELD = 'id';
324
315
  function getIdField(obj) {
325
316
  return obj?.idField ?? DEFAULT_ID_FIELD;
326
317
  }
@@ -431,13 +422,12 @@ function getBuiltInPropertyNames(profile = BuiltInPropertiesProfile.Model) {
431
422
  }
432
423
  return new Set(keys);
433
424
  }
434
- let BuiltInPropertiesProfile = /*#__PURE__*/function (BuiltInPropertiesProfile) {
425
+ let BuiltInPropertiesProfile = exports.BuiltInPropertiesProfile = /*#__PURE__*/function (BuiltInPropertiesProfile) {
435
426
  BuiltInPropertiesProfile[BuiltInPropertiesProfile["Model"] = 0] = "Model";
436
427
  BuiltInPropertiesProfile[BuiltInPropertiesProfile["Cached"] = 1] = "Cached";
437
428
  BuiltInPropertiesProfile[BuiltInPropertiesProfile["None"] = 2] = "None";
438
429
  return BuiltInPropertiesProfile;
439
430
  }({});
440
- exports.BuiltInPropertiesProfile = BuiltInPropertiesProfile;
441
431
  const BUILT_IN_PROPERTY_NAMES = {
442
432
  [BuiltInPropertiesProfile.Model]: getBuiltInPropertyNames(BuiltInPropertiesProfile.Model),
443
433
  [BuiltInPropertiesProfile.Cached]: getBuiltInPropertyNames(BuiltInPropertiesProfile.Cached),
@@ -1030,7 +1020,7 @@ function collectReferencedShapeNames(context, shapeNames) {
1030
1020
  * Creates a schema property list chainable fn, allowing you to manipulate and
1031
1021
  * iterate the properties in a schema.
1032
1022
  */
1033
- const createSchemaPropertyList = (0, _curry.default)((context, shapeOrSchema) => {
1023
+ const createSchemaPropertyList = exports.createSchemaPropertyList = (0, _curry.default)((context, shapeOrSchema) => {
1034
1024
  const propSchema = isShape(shapeOrSchema) ? shapeOrSchema.schema : shapeOrSchema;
1035
1025
  const schema = (0, _refs.dereferenceSchema)(context, propSchema, isShape(shapeOrSchema) ? ['shapes', shapeOrSchema.name] : undefined);
1036
1026
  const propertyIterator = new Map((0, _utils.isObjectSchema)(schema) ? Object.entries(schema.properties) : undefined);
@@ -1091,7 +1081,6 @@ const createSchemaPropertyList = (0, _curry.default)((context, shapeOrSchema) =>
1091
1081
  };
1092
1082
  return self;
1093
1083
  });
1094
- exports.createSchemaPropertyList = createSchemaPropertyList;
1095
1084
  function isShape(shapeOrSchema) {
1096
1085
  return 'schema' in shapeOrSchema;
1097
1086
  }
@@ -1122,10 +1111,9 @@ class SchemaPropertyAccessor {
1122
1111
  * Creates a schema property accessor, allowing you to safely access schema
1123
1112
  * properties.
1124
1113
  */
1125
- const createSchemaPropertyAccessor = (0, _curry.default)((context, shapeOrSchema) => {
1114
+ const createSchemaPropertyAccessor = exports.createSchemaPropertyAccessor = (0, _curry.default)((context, shapeOrSchema) => {
1126
1115
  return new SchemaPropertyAccessor(context, shapeOrSchema);
1127
1116
  });
1128
- exports.createSchemaPropertyAccessor = createSchemaPropertyAccessor;
1129
1117
  function findQueryHelper(slice, shapeName, resolver, type) {
1130
1118
  const schemaPath = type === 'query' ? 'queries' : 'mutations';
1131
1119
  return Object.keys(slice[schemaPath]).find(queryName => {
@@ -80,7 +80,5 @@ var _v48 = _interopRequireDefault(require("./project-schema/v3.38.0.json"));
80
80
  var _v49 = _interopRequireDefault(require("./project-schema/v4.0.0.json"));
81
81
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
82
82
  // This file is generated by "pnpm json2ts"
83
- const CURRENT_SCHEMA_VERSION = '3.39.0';
84
- exports.CURRENT_SCHEMA_VERSION = CURRENT_SCHEMA_VERSION;
85
- const allProjectSchemas = [_metaSchemaV.default, _v2.default, _metaSchemaV2.default, _v3.default, _metaSchemaV3.default, _v4.default, _metaSchemaV4.default, _v5.default, _metaSchemaV5.default, _v6.default, _metaSchemaV6.default, _v7.default, _metaSchemaV7.default, _v8.default, _metaSchemaV8.default, _v9.default, _metaSchemaV9.default, _v10.default, _metaSchemaV10.default, _v11.default, _metaSchemaV11.default, _v12.default, _metaSchemaV12.default, _v13.default, _v14.default, _v15.default, _v16.default, _v17.default, _v18.default, _v19.default, _v20.default, _v21.default, _v22.default, _v23.default, _v24.default, _v25.default, _v26.default, _v27.default, _v28.default, _v29.default, _v30.default, _v31.default, _v32.default, _v33.default, _v34.default, _v35.default, _v36.default, _v37.default, _v38.default, _v39.default, _v40.default, _v41.default, _v42.default, _v43.default, _v44.default, _v45.default, _v46.default, _v47.default, _v48.default, _v.default, _v49.default];
86
- exports.allProjectSchemas = allProjectSchemas;
83
+ const CURRENT_SCHEMA_VERSION = exports.CURRENT_SCHEMA_VERSION = '3.39.0';
84
+ const allProjectSchemas = exports.allProjectSchemas = [_metaSchemaV.default, _v2.default, _metaSchemaV2.default, _v3.default, _metaSchemaV3.default, _v4.default, _metaSchemaV4.default, _v5.default, _metaSchemaV5.default, _v6.default, _metaSchemaV6.default, _v7.default, _metaSchemaV7.default, _v8.default, _metaSchemaV8.default, _v9.default, _metaSchemaV9.default, _v10.default, _metaSchemaV10.default, _v11.default, _metaSchemaV11.default, _v12.default, _metaSchemaV12.default, _v13.default, _v14.default, _v15.default, _v16.default, _v17.default, _v18.default, _v19.default, _v20.default, _v21.default, _v22.default, _v23.default, _v24.default, _v25.default, _v26.default, _v27.default, _v28.default, _v29.default, _v30.default, _v31.default, _v32.default, _v33.default, _v34.default, _v35.default, _v36.default, _v37.default, _v38.default, _v39.default, _v40.default, _v41.default, _v42.default, _v43.default, _v44.default, _v45.default, _v46.default, _v47.default, _v48.default, _v.default, _v49.default];
@@ -28,9 +28,8 @@ function getFirstStringFieldV3(shape, projectSchema) {
28
28
  key: schemaProperties.getKey(name)
29
29
  } : null;
30
30
  }
31
- const getTaxonomyField = weakMemoize((shape, projectSchema) => shape.model?.type === 'taxonomy' ? getFirstStringFieldV3(shape, projectSchema) : null);
32
- exports.getTaxonomyField = getTaxonomyField;
33
- const getTaxonomies = weakMemoize(projectSchema => {
31
+ const getTaxonomyField = exports.getTaxonomyField = weakMemoize((shape, projectSchema) => shape.model?.type === 'taxonomy' ? getFirstStringFieldV3(shape, projectSchema) : null);
32
+ const getTaxonomies = exports.getTaxonomies = weakMemoize(projectSchema => {
34
33
  const {
35
34
  shapes
36
35
  } = projectSchema;
@@ -45,5 +44,4 @@ const getTaxonomies = weakMemoize(projectSchema => {
45
44
  }
46
45
  return result;
47
46
  }, []);
48
- });
49
- exports.getTaxonomies = getTaxonomies;
47
+ });
@@ -25,35 +25,21 @@ var _util2 = require("../util");
25
25
  var _createInputSchema = require("../create-input-schema");
26
26
  var _get = _interopRequireDefault(require("lodash/get"));
27
27
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28
- const TSGetArgs = getIDQueryArgs('TSGetArgs');
29
- exports.TSGetArgs = TSGetArgs;
30
- const TSGetSingletonArgs = getIDQueryArgs('TSGetSingletonArgs');
31
- exports.TSGetSingletonArgs = TSGetSingletonArgs;
32
- const TSListArgs = getShapeListQueryArgs('TSListArgs', true);
33
- exports.TSListArgs = TSListArgs;
34
- const TSSearchArgs = getShapeListQueryArgs('TSSearchArgs', false);
35
- exports.TSSearchArgs = TSSearchArgs;
36
- const CreateArgs = getMutationArgs('CreateArgs', _types.TemplateVerbs.Create);
37
- exports.CreateArgs = CreateArgs;
38
- const UpdateArgs = getMutationArgs('UpdateArgs', _types.TemplateVerbs.Update);
39
- exports.UpdateArgs = UpdateArgs;
40
- const DuplicateArgs = getMutationArgs('DuplicateArgs', _types.TemplateVerbs.Duplicate);
41
- exports.DuplicateArgs = DuplicateArgs;
42
- const DeleteArgs = getMutationArgs('DeleteArgs', _types.TemplateVerbs.Delete);
43
- exports.DeleteArgs = DeleteArgs;
44
- const PaginatedList = getPaginatedListShape;
45
- exports.PaginatedList = PaginatedList;
46
- const SearchResults = getSearchResultsShape;
47
- exports.SearchResults = SearchResults;
48
- const CreateResult = getMutationResultType(_types.TemplateVerbs.Create);
49
- exports.CreateResult = CreateResult;
50
- const UpdateResult = getMutationResultType(_types.TemplateVerbs.Update);
51
- exports.UpdateResult = UpdateResult;
52
- const DuplicateResult = getMutationResultType(_types.TemplateVerbs.Duplicate);
53
- exports.DuplicateResult = DuplicateResult;
54
- const DeleteResult = getMutationResultType(_types.TemplateVerbs.Delete);
55
- exports.DeleteResult = DeleteResult;
56
- const TSSearchSortInput = (0, _schemaUtil.createShape)('TSSearchSortInput', {
28
+ const TSGetArgs = exports.TSGetArgs = getIDQueryArgs('TSGetArgs');
29
+ const TSGetSingletonArgs = exports.TSGetSingletonArgs = getIDQueryArgs('TSGetSingletonArgs');
30
+ const TSListArgs = exports.TSListArgs = getShapeListQueryArgs('TSListArgs', true);
31
+ const TSSearchArgs = exports.TSSearchArgs = getShapeListQueryArgs('TSSearchArgs', false);
32
+ const CreateArgs = exports.CreateArgs = getMutationArgs('CreateArgs', _types.TemplateVerbs.Create);
33
+ const UpdateArgs = exports.UpdateArgs = getMutationArgs('UpdateArgs', _types.TemplateVerbs.Update);
34
+ const DuplicateArgs = exports.DuplicateArgs = getMutationArgs('DuplicateArgs', _types.TemplateVerbs.Duplicate);
35
+ const DeleteArgs = exports.DeleteArgs = getMutationArgs('DeleteArgs', _types.TemplateVerbs.Delete);
36
+ const PaginatedList = exports.PaginatedList = getPaginatedListShape;
37
+ const SearchResults = exports.SearchResults = getSearchResultsShape;
38
+ const CreateResult = exports.CreateResult = getMutationResultType(_types.TemplateVerbs.Create);
39
+ const UpdateResult = exports.UpdateResult = getMutationResultType(_types.TemplateVerbs.Update);
40
+ const DuplicateResult = exports.DuplicateResult = getMutationResultType(_types.TemplateVerbs.Duplicate);
41
+ const DeleteResult = exports.DeleteResult = getMutationResultType(_types.TemplateVerbs.Delete);
42
+ const TSSearchSortInput = exports.TSSearchSortInput = (0, _schemaUtil.createShape)('TSSearchSortInput', {
57
43
  type: 'object',
58
44
  properties: {
59
45
  field: {
@@ -66,8 +52,7 @@ const TSSearchSortInput = (0, _schemaUtil.createShape)('TSSearchSortInput', {
66
52
  },
67
53
  required: ['field', 'order']
68
54
  });
69
- exports.TSSearchSortInput = TSSearchSortInput;
70
- const commonSearchProps = {
55
+ const commonSearchProps = exports.commonSearchProps = {
71
56
  terms: {
72
57
  type: 'string'
73
58
  },
@@ -91,8 +76,7 @@ const commonSearchProps = {
91
76
  }
92
77
  }
93
78
  };
94
- exports.commonSearchProps = commonSearchProps;
95
- const localeProps = {
79
+ const localeProps = exports.localeProps = {
96
80
  type: 'object',
97
81
  properties: {
98
82
  locale: {
@@ -104,8 +88,7 @@ const localeProps = {
104
88
  }
105
89
  }
106
90
  };
107
- exports.localeProps = localeProps;
108
- const termsProps = {
91
+ const termsProps = exports.termsProps = {
109
92
  type: 'object',
110
93
  properties: {
111
94
  terms: {
@@ -113,8 +96,7 @@ const termsProps = {
113
96
  }
114
97
  }
115
98
  };
116
- exports.termsProps = termsProps;
117
- const TSContentStructureInput = (0, _schemaUtil.createShape)('TSContentStructureInput', {
99
+ const TSContentStructureInput = exports.TSContentStructureInput = (0, _schemaUtil.createShape)('TSContentStructureInput', {
118
100
  type: 'object',
119
101
  properties: {
120
102
  path: {
@@ -133,7 +115,6 @@ const TSContentStructureInput = (0, _schemaUtil.createShape)('TSContentStructure
133
115
  }, {
134
116
  description: 'Describes a structural update to an array of data.'
135
117
  });
136
- exports.TSContentStructureInput = TSContentStructureInput;
137
118
  function getPaginatedListShape(context, shape) {
138
119
  const shapeName = `${shape.name}${_migration.listTypePrefix}`;
139
120
  return {
@@ -349,7 +330,7 @@ function getMutationResultType(verb) {
349
330
  };
350
331
  };
351
332
  }
352
- const commonSearchArgs = {
333
+ const commonSearchArgs = exports.commonSearchArgs = {
353
334
  type: 'object',
354
335
  properties: {
355
336
  terms: {
@@ -376,7 +357,6 @@ const commonSearchArgs = {
376
357
  }
377
358
  }
378
359
  };
379
- exports.commonSearchArgs = commonSearchArgs;
380
360
  const legacyListArgs = {
381
361
  type: 'object',
382
362
  properties: {
@@ -4,11 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.TemplateVerbs = void 0;
7
- let TemplateVerbs = /*#__PURE__*/function (TemplateVerbs) {
7
+ let TemplateVerbs = exports.TemplateVerbs = /*#__PURE__*/function (TemplateVerbs) {
8
8
  TemplateVerbs["Create"] = "create";
9
9
  TemplateVerbs["Update"] = "update";
10
10
  TemplateVerbs["Duplicate"] = "duplicate";
11
11
  TemplateVerbs["Delete"] = "delete";
12
12
  return TemplateVerbs;
13
- }({});
14
- exports.TemplateVerbs = TemplateVerbs;
13
+ }({});
@@ -21,8 +21,7 @@ var _unions = require("../unions");
21
21
  var _utils = require("../types/utils");
22
22
  var _relationships = require("../relationships");
23
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
- const MAX_RELATIONSHIP_DEPTH = 1;
25
- exports.MAX_RELATIONSHIP_DEPTH = MAX_RELATIONSHIP_DEPTH;
24
+ const MAX_RELATIONSHIP_DEPTH = exports.MAX_RELATIONSHIP_DEPTH = 1;
26
25
  const exceededRelationshipDepth = (depth = 0) => depth >= MAX_RELATIONSHIP_DEPTH;
27
26
  exports.exceededRelationshipDepth = exceededRelationshipDepth;
28
27
  class ShapeCache {
@@ -53,7 +52,7 @@ class ShapeCache {
53
52
  return result;
54
53
  }
55
54
  }
56
- const fieldTypeComparison = {
55
+ const fieldTypeComparison = exports.fieldTypeComparison = {
57
56
  id: {
58
57
  comparators: ['eq', 'in'],
59
58
  type: 'string'
@@ -91,8 +90,7 @@ const fieldTypeComparison = {
91
90
  type: 'string'
92
91
  }
93
92
  };
94
- exports.fieldTypeComparison = fieldTypeComparison;
95
- const comparatorDescriptions = {
93
+ const comparatorDescriptions = exports.comparatorDescriptions = {
96
94
  eq: 'Exact match',
97
95
  gt: 'Greater than',
98
96
  gte: 'Greater than or equal',
@@ -102,15 +100,12 @@ const comparatorDescriptions = {
102
100
  match: 'Full text searching with fuzzy matching.',
103
101
  regexp: 'Regular expression string matching. Use of * wildcards could degrade performance.'
104
102
  };
105
- exports.comparatorDescriptions = comparatorDescriptions;
106
- const booleanOperators = ['AND', 'OR', 'NOT'];
107
- exports.booleanOperators = booleanOperators;
108
- const boolOpDescriptionMap = {
103
+ const booleanOperators = exports.booleanOperators = ['AND', 'OR', 'NOT'];
104
+ const boolOpDescriptionMap = exports.boolOpDescriptionMap = {
109
105
  AND: 'AND takes an array of conditions that must appear in the matching results. Nested boolean operators can be used to create complex filters.',
110
106
  OR: 'OR takes an array of conditions that should appear in the matching results. Nested boolean operators can be used to create complex filters.',
111
107
  NOT: 'NOT takes a single condition that must not appear in the matching results.'
112
108
  };
113
- exports.boolOpDescriptionMap = boolOpDescriptionMap;
114
109
  function getConflictingProperties(projectSchema, shapes) {
115
110
  const conflicts = new Set();
116
111
  const allProps = {};
@@ -344,7 +339,6 @@ function getPropertyComparisonType(name, prop, shapeName, context) {
344
339
  ...context,
345
340
  conflictingProperties: undefined // non-union objects have no conflicts
346
341
  };
347
-
348
342
  for (const propName of Object.keys(properties)) {
349
343
  Object.assign(props, getPropertyComparisonType(propName, properties[propName], shapeName, fieldContext));
350
344
  }
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.projectSchemaImportOptionalProps = exports.legacyProjectSchemaImportOptionalProps = exports.RefType = exports.ArgsType = void 0;
7
- const projectSchemaImportOptionalProps = ['projectId', 'locales', 'defaultLocale', 'author'];
8
- exports.projectSchemaImportOptionalProps = projectSchemaImportOptionalProps;
9
- const legacyProjectSchemaImportOptionalProps = ['created', 'updated', 'version', 'dataKey'];
7
+ const projectSchemaImportOptionalProps = exports.projectSchemaImportOptionalProps = ['projectId', 'locales', 'defaultLocale', 'author'];
8
+ const legacyProjectSchemaImportOptionalProps = exports.legacyProjectSchemaImportOptionalProps = ['created', 'updated', 'version', 'dataKey'];
10
9
 
11
10
  /**
12
11
  * Remote service configuration types
@@ -25,11 +24,10 @@ const legacyProjectSchemaImportOptionalProps = ['created', 'updated', 'version',
25
24
  * A type suitable for service object updates, mostly concerns authentication
26
25
  * requirements.
27
26
  */
28
- exports.legacyProjectSchemaImportOptionalProps = legacyProjectSchemaImportOptionalProps;
29
27
  /**
30
28
  * Types of refs
31
29
  */
32
- let RefType = /*#__PURE__*/function (RefType) {
30
+ let RefType = exports.RefType = /*#__PURE__*/function (RefType) {
33
31
  RefType["@ref"] = "@ref";
34
32
  RefType["$ref"] = "$ref";
35
33
  return RefType;
@@ -37,11 +35,10 @@ let RefType = /*#__PURE__*/function (RefType) {
37
35
  /**
38
36
  * Stub of a PropertySchema that may contain a `$ref` or `@ref`.
39
37
  */
40
- exports.RefType = RefType;
41
38
  /**
42
39
  * Types of args
43
40
  */
44
- let ArgsType = /*#__PURE__*/function (ArgsType) {
41
+ let ArgsType = exports.ArgsType = /*#__PURE__*/function (ArgsType) {
45
42
  ArgsType["@args"] = "@args";
46
43
  ArgsType["args"] = "args";
47
44
  return ArgsType;
@@ -60,5 +57,4 @@ let ArgsType = /*#__PURE__*/function (ArgsType) {
60
57
  */
61
58
  /**
62
59
  * The old relationship format, used in client UI.
63
- */
64
- exports.ArgsType = ArgsType;
60
+ */
package/dist/unions.js CHANGED
@@ -127,13 +127,11 @@ function transformOneOf(process) {
127
127
  * See https://github.com/graphql/graphql-spec/pull/825 for more on "GraphQL oneOf"
128
128
  * Opposite of `wrapOneOfObjects`
129
129
  */
130
- const unwrapOneOfObjects = transformOneOf(createUnwrapTransform);
130
+ const unwrapOneOfObjects = exports.unwrapOneOfObjects = transformOneOf(createUnwrapTransform);
131
131
 
132
132
  /**
133
133
  * Wrap oneOf objects in "GraphQL oneOf" style wrapper objects
134
134
  * See https://github.com/graphql/graphql-spec/pull/825 for more on "GraphQL oneOf"
135
135
  * Opposite of `unwrapOneOfObjects`
136
136
  */
137
- exports.unwrapOneOfObjects = unwrapOneOfObjects;
138
- const wrapOneOfObjects = transformOneOf(createWrapTransform);
139
- exports.wrapOneOfObjects = wrapOneOfObjects;
137
+ const wrapOneOfObjects = exports.wrapOneOfObjects = transformOneOf(createWrapTransform);
@@ -71,7 +71,5 @@ function getQueryIndexConfigHelper(op) {
71
71
  }
72
72
  };
73
73
  }
74
- const getListQueryIndexConfigs = getQueryIndexConfigHelper('list');
75
- exports.getListQueryIndexConfigs = getListQueryIndexConfigs;
76
- const getGetQueryIndexConfig = getQueryIndexConfigHelper('get');
77
- exports.getGetQueryIndexConfig = getGetQueryIndexConfig;
74
+ const getListQueryIndexConfigs = exports.getListQueryIndexConfigs = getQueryIndexConfigHelper('list');
75
+ const getGetQueryIndexConfig = exports.getGetQueryIndexConfig = getQueryIndexConfigHelper('get');
package/dist/versions.js CHANGED
@@ -12,9 +12,6 @@ Object.defineProperty(exports, "CURRENT_SCHEMA_VERSION", {
12
12
  });
13
13
  exports.LEGACY_SCHEMA_VERSION = exports.LEGACY_API_VERSION = void 0;
14
14
  var _schemas = require("./schemas");
15
- const LEGACY_SCHEMA_VERSION = '1.0.0';
16
- exports.LEGACY_SCHEMA_VERSION = LEGACY_SCHEMA_VERSION;
17
- const CURRENT_API_VERSION = '2';
18
- exports.CURRENT_API_VERSION = CURRENT_API_VERSION;
19
- const LEGACY_API_VERSION = '1';
20
- exports.LEGACY_API_VERSION = LEGACY_API_VERSION;
15
+ const LEGACY_SCHEMA_VERSION = exports.LEGACY_SCHEMA_VERSION = '1.0.0';
16
+ const CURRENT_API_VERSION = exports.CURRENT_API_VERSION = '2';
17
+ const LEGACY_API_VERSION = exports.LEGACY_API_VERSION = '1';
package/dist/workflows.js CHANGED
@@ -12,7 +12,7 @@ exports.getWorkflow = getWorkflow;
12
12
  exports.getWorkflowStepKeys = getWorkflowStepKeys;
13
13
  exports.statusFallback = statusFallback;
14
14
  var _schemaUtil = require("./schema-util");
15
- const defaultWorkflow = {
15
+ const defaultWorkflow = exports.defaultWorkflow = {
16
16
  name: 'default',
17
17
  title: 'Default',
18
18
  steps: [{
@@ -29,7 +29,6 @@ const defaultWorkflow = {
29
29
  live: true
30
30
  }]
31
31
  };
32
- exports.defaultWorkflow = defaultWorkflow;
33
32
  function getWorkflow(projectSchema, shapeId) {
34
33
  const workflow = (0, _schemaUtil.getShapeById)(projectSchema, shapeId)?.workflow;
35
34
  if (workflow) {
@@ -4,6 +4,7 @@ import isString from 'lodash/isString';
4
4
  import isArray from 'lodash/isArray';
5
5
  import { latestSchemaJson } from '../schemas';
6
6
  /** Resolver Type Utils **/
7
+
7
8
  /**
8
9
  * Only tests that the shape is right, not that the name is correct. That's a job for the validator.
9
10
  */
package/es/services.js CHANGED
@@ -14,12 +14,15 @@ import isEmpty from 'lodash/isEmpty';
14
14
  * Throws an error if decryption fails
15
15
  */
16
16
  // eslint-disable-next-line @typescript-eslint/ban-types
17
+
17
18
  /**
18
19
  * Decrypt an encrypted authentication JSON string
19
20
  * Returns undefined if decryption fails
20
21
  */
21
22
  // eslint-disable-next-line @typescript-eslint/ban-types
23
+
22
24
  // eslint-disable-next-line @typescript-eslint/ban-types
25
+
23
26
  /**
24
27
  * Given a `StoredServiceConfig` returns a usable `ServiceConfig` with the
25
28
  * authentication object decrypted.
@@ -326,7 +326,6 @@ export function getPropertyComparisonType(name, prop, shapeName, context) {
326
326
  ...context,
327
327
  conflictingProperties: undefined // non-union objects have no conflicts
328
328
  };
329
-
330
329
  for (const propName of Object.keys(properties)) {
331
330
  Object.assign(props, getPropertyComparisonType(propName, properties[propName], shapeName, fieldContext));
332
331
  }
package/es/types/types.js CHANGED
@@ -4,17 +4,21 @@ export const legacyProjectSchemaImportOptionalProps = ['created', 'updated', 've
4
4
  /**
5
5
  * Remote service configuration types
6
6
  */
7
+
7
8
  /**
8
9
  * Old service authentication
9
10
  * @deprecated
10
11
  */
12
+
11
13
  /**
12
14
  * Support null sentinels for authentication
13
15
  */
16
+
14
17
  /**
15
18
  * A type suitable for service object updates, mostly concerns authentication
16
19
  * requirements.
17
20
  */
21
+
18
22
  /**
19
23
  * Types of refs
20
24
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeshape/schema",
3
- "version": "10.2.20",
3
+ "version": "10.2.24",
4
4
  "description": "TakeShape Schema",
5
5
  "homepage": "https://www.takeshape.io",
6
6
  "repository": {
@@ -28,9 +28,9 @@
28
28
  "p-reduce": "^2.1.0",
29
29
  "semver": "^7.3.2",
30
30
  "tiny-invariant": "^1.2.0",
31
- "@takeshape/errors": "10.2.20",
32
- "@takeshape/json-schema": "10.2.20",
33
- "@takeshape/util": "10.2.20"
31
+ "@takeshape/errors": "10.2.24",
32
+ "@takeshape/json-schema": "10.2.24",
33
+ "@takeshape/util": "10.2.24"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@takeshape/json-schema-to-typescript": "^11.0.0",
@@ -46,8 +46,8 @@
46
46
  "meow": "^9.0.0",
47
47
  "p-map": "^5.0.0",
48
48
  "shortid": "^2.2.15",
49
- "@takeshape/infra": "10.2.20",
50
- "@takeshape/typescript-jest-junit-reporter": "10.2.20"
49
+ "@takeshape/infra": "10.2.24",
50
+ "@takeshape/typescript-jest-junit-reporter": "10.2.24"
51
51
  },
52
52
  "engines": {
53
53
  "node": ">=18"