@takeshape/schema 8.17.1 → 8.21.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.
Files changed (117) hide show
  1. package/es/enum.js +1 -1
  2. package/es/get-is-leaf.js +5 -5
  3. package/es/layers/type-utils.js +2 -2
  4. package/es/migration.js +59 -1
  5. package/es/project-schema/index.js +1 -0
  6. package/es/project-schema/v3.10.0.js +1 -0
  7. package/es/refs.js +19 -19
  8. package/es/schema-util.js +11 -7
  9. package/es/schemas/index.js +15 -15
  10. package/es/schemas/index.ts +26 -25
  11. package/es/schemas/project-schema/v3.10.0.json +2091 -0
  12. package/es/schemas/project-schema/v4.0.0.json +8 -6
  13. package/es/schemas/project-schema.json +2 -1
  14. package/es/types/types.js +1 -1
  15. package/es/types/utils.js +20 -19
  16. package/es/util/detect-cycles.js +1 -1
  17. package/es/validate.js +6 -5
  18. package/examples/latest/blog-schema.json +32 -32
  19. package/examples/latest/brewery-schema.json +53 -53
  20. package/examples/latest/complex-project-schema.json +3278 -3278
  21. package/examples/latest/fabric-ecommerce.json +130 -130
  22. package/examples/latest/frank-and-fred-schema.json +15588 -15588
  23. package/examples/latest/massive-schema.json +5836 -5836
  24. package/examples/latest/mill-components-schema.json +876 -876
  25. package/examples/latest/pet-oneof-array.json +77 -77
  26. package/examples/latest/post-schema.json +23 -23
  27. package/examples/latest/pruned-shopify-product-schema.json +19 -19
  28. package/examples/latest/real-world-schema.json +166 -166
  29. package/examples/latest/recursive-repeater-schema.json +14 -14
  30. package/examples/latest/recursive-schema.json +14 -14
  31. package/examples/latest/rick-and-morty-ast.json +1875 -1896
  32. package/examples/latest/rick-and-morty-graphql.json +1093 -1093
  33. package/examples/latest/rick-and-morty-rest.json +20 -20
  34. package/examples/latest/schema-with-repeater-draftjs.json +9 -9
  35. package/examples/latest/shape-books-v3_2_0.json +218 -218
  36. package/examples/latest/shape-books.json +218 -218
  37. package/examples/latest/shopify-lookbook.json +147 -147
  38. package/examples/latest/shopify-store-with-widget.json +10420 -10420
  39. package/examples/latest/stripe-starter-resolved.json +1018 -1018
  40. package/examples/latest/user-schema-no-required.json +19 -19
  41. package/examples/latest/user-schema-with-defaults.json +20 -20
  42. package/examples/source/rick-and-morty-ast.json +0 -21
  43. package/lib/content-schema-transform.d.ts +13 -13
  44. package/lib/content-schema-transform.d.ts.map +1 -1
  45. package/lib/enum.d.ts +2 -2
  46. package/lib/enum.d.ts.map +1 -1
  47. package/lib/enum.js +2 -2
  48. package/lib/get-is-leaf.d.ts +2 -2
  49. package/lib/get-is-leaf.d.ts.map +1 -1
  50. package/lib/get-is-leaf.js +5 -5
  51. package/lib/layers/type-utils.js +1 -1
  52. package/lib/migration.d.ts +6 -5
  53. package/lib/migration.d.ts.map +1 -1
  54. package/lib/migration.js +60 -0
  55. package/lib/project-schema/index.d.ts +3 -1
  56. package/lib/project-schema/index.d.ts.map +1 -1
  57. package/lib/project-schema/index.js +25 -12
  58. package/lib/project-schema/latest.d.ts +260 -238
  59. package/lib/project-schema/latest.d.ts.map +1 -1
  60. package/lib/project-schema/v1.0.0.d.ts +14 -7
  61. package/lib/project-schema/v1.0.0.d.ts.map +1 -1
  62. package/lib/project-schema/v3.0.0.d.ts +24 -25
  63. package/lib/project-schema/v3.0.0.d.ts.map +1 -1
  64. package/lib/project-schema/v3.1.0.d.ts +42 -43
  65. package/lib/project-schema/v3.1.0.d.ts.map +1 -1
  66. package/lib/project-schema/v3.10.0.d.ts +1202 -0
  67. package/lib/project-schema/v3.10.0.d.ts.map +1 -0
  68. package/lib/project-schema/v3.10.0.js +5 -0
  69. package/lib/project-schema/v3.2.0.d.ts +42 -43
  70. package/lib/project-schema/v3.2.0.d.ts.map +1 -1
  71. package/lib/project-schema/v3.3.0.d.ts +42 -43
  72. package/lib/project-schema/v3.3.0.d.ts.map +1 -1
  73. package/lib/project-schema/v3.4.0.d.ts +42 -43
  74. package/lib/project-schema/v3.4.0.d.ts.map +1 -1
  75. package/lib/project-schema/v3.5.0.d.ts +42 -43
  76. package/lib/project-schema/v3.5.0.d.ts.map +1 -1
  77. package/lib/project-schema/v3.5.1.d.ts +42 -43
  78. package/lib/project-schema/v3.5.1.d.ts.map +1 -1
  79. package/lib/project-schema/v3.6.0.d.ts +42 -43
  80. package/lib/project-schema/v3.6.0.d.ts.map +1 -1
  81. package/lib/project-schema/v3.7.0.d.ts +42 -43
  82. package/lib/project-schema/v3.7.0.d.ts.map +1 -1
  83. package/lib/project-schema/v3.8.0.d.ts +42 -43
  84. package/lib/project-schema/v3.8.0.d.ts.map +1 -1
  85. package/lib/project-schema/v3.9.0.d.ts +42 -43
  86. package/lib/project-schema/v3.9.0.d.ts.map +1 -1
  87. package/lib/project-schema/v4.0.0.d.ts +54 -52
  88. package/lib/project-schema/v4.0.0.d.ts.map +1 -1
  89. package/lib/refs.d.ts +8 -8
  90. package/lib/refs.d.ts.map +1 -1
  91. package/lib/refs.js +19 -19
  92. package/lib/schema-util.d.ts +23 -23
  93. package/lib/schema-util.d.ts.map +1 -1
  94. package/lib/schema-util.js +11 -7
  95. package/lib/schemas/index.d.ts +3421 -3420
  96. package/lib/schemas/index.d.ts.map +1 -1
  97. package/lib/schemas/index.js +26 -30
  98. package/lib/schemas/index.ts +26 -25
  99. package/lib/schemas/project-schema/v3.10.0.json +2091 -0
  100. package/lib/schemas/project-schema/v4.0.0.json +8 -6
  101. package/lib/schemas/project-schema.json +2 -1
  102. package/lib/types/types.d.ts +8 -7
  103. package/lib/types/types.d.ts.map +1 -1
  104. package/lib/types/types.js +1 -1
  105. package/lib/types/utils.d.ts +9 -8
  106. package/lib/types/utils.d.ts.map +1 -1
  107. package/lib/types/utils.js +25 -23
  108. package/lib/unions.d.ts +8 -8
  109. package/lib/unions.d.ts.map +1 -1
  110. package/lib/util/detect-cycles.d.ts +2 -2
  111. package/lib/util/detect-cycles.d.ts.map +1 -1
  112. package/lib/util/detect-cycles.js +1 -1
  113. package/lib/validate.d.ts.map +1 -1
  114. package/lib/validate.js +5 -4
  115. package/lib/workflows.d.ts +2 -2
  116. package/lib/workflows.d.ts.map +1 -1
  117. package/package.json +5 -5
@@ -9,6 +9,24 @@
9
9
  ],
10
10
  "defaultLocale": "en-us",
11
11
  "workflows": {},
12
+ "created": "2016-06-21T15:16:19.051Z",
13
+ "updated": "2016-06-21T15:16:19.051Z",
14
+ "forms": {
15
+ "User": {
16
+ "default": {
17
+ "order": [
18
+ "firstName",
19
+ "lastName",
20
+ "username",
21
+ "email",
22
+ "password",
23
+ "roles",
24
+ "locations"
25
+ ]
26
+ }
27
+ }
28
+ },
29
+ "dataKey": "supersecret",
12
30
  "queries": {
13
31
  "getUser": {
14
32
  "shape": "User",
@@ -73,9 +91,6 @@
73
91
  "args": "DeleteArgs<User>"
74
92
  }
75
93
  },
76
- "schemaVersion": "3.9.0",
77
- "created": "2016-06-21T15:16:19.051Z",
78
- "updated": "2016-06-21T15:16:19.051Z",
79
94
  "shapes": {
80
95
  "User": {
81
96
  "id": "<userContentTypeId>",
@@ -154,20 +169,5 @@
154
169
  }
155
170
  }
156
171
  },
157
- "forms": {
158
- "User": {
159
- "default": {
160
- "order": [
161
- "firstName",
162
- "lastName",
163
- "username",
164
- "email",
165
- "password",
166
- "roles",
167
- "locations"
168
- ]
169
- }
170
- }
171
- },
172
- "dataKey": "supersecret"
172
+ "schemaVersion": "3.10.0"
173
173
  }
@@ -9,6 +9,25 @@
9
9
  ],
10
10
  "defaultLocale": "en-us",
11
11
  "workflows": {},
12
+ "created": "2016-06-21T15:16:19.051Z",
13
+ "updated": "2016-06-21T15:16:19.051Z",
14
+ "forms": {
15
+ "User": {
16
+ "default": {
17
+ "order": [
18
+ "firstName",
19
+ "lastName",
20
+ "age",
21
+ "username",
22
+ "email",
23
+ "password",
24
+ "roles",
25
+ "locations"
26
+ ]
27
+ }
28
+ }
29
+ },
30
+ "dataKey": "supersecret",
12
31
  "queries": {
13
32
  "getUser": {
14
33
  "shape": "User",
@@ -73,9 +92,6 @@
73
92
  "args": "DeleteArgs<User>"
74
93
  }
75
94
  },
76
- "schemaVersion": "3.9.0",
77
- "created": "2016-06-21T15:16:19.051Z",
78
- "updated": "2016-06-21T15:16:19.051Z",
79
95
  "shapes": {
80
96
  "User": {
81
97
  "id": "<userContentTypeId>",
@@ -178,21 +194,5 @@
178
194
  }
179
195
  }
180
196
  },
181
- "forms": {
182
- "User": {
183
- "default": {
184
- "order": [
185
- "firstName",
186
- "lastName",
187
- "age",
188
- "username",
189
- "email",
190
- "password",
191
- "roles",
192
- "locations"
193
- ]
194
- }
195
- }
196
- },
197
- "dataKey": "supersecret"
197
+ "schemaVersion": "3.10.0"
198
198
  }
@@ -1715,27 +1715,6 @@
1715
1715
  "model": {
1716
1716
  "type": "multiple"
1717
1717
  },
1718
- "resolvers": {
1719
- "rick-and-morty:Character": {
1720
- "mesh": {
1721
- "name": "graphql:query",
1722
- "service": "rick-and-morty",
1723
- "options": {
1724
- "fieldName": "character"
1725
- },
1726
- "argsMapping": {
1727
- "id": [
1728
- [
1729
- "jsonPath",
1730
- {
1731
- "path": "$.source.rickAndMortyCharacterId"
1732
- }
1733
- ]
1734
- ]
1735
- }
1736
- }
1737
- }
1738
- },
1739
1718
  "schema": {
1740
1719
  "type": "object",
1741
1720
  "properties": {
@@ -1,17 +1,17 @@
1
- import type { ProjectSchema, ContentSchema, Shape } from './project-schema';
1
+ import type { ProjectSchema, PropertySchema, Shape } from './project-schema';
2
2
  export declare type SchemaType = '*' | 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean';
3
- export declare function getType(schema: Pick<ContentSchema, 'type'>): SchemaType;
3
+ export declare function getType(schema: Pick<PropertySchema, 'type'>): SchemaType;
4
4
  export declare function toName(name: string): string;
5
- export declare type ContentTransform = (schema: ContentSchema, obj: unknown, name?: string) => unknown;
6
- export declare type SourceKeyTransform = (name: string, schema: ContentSchema) => string | string[];
7
- export declare type KeyTransform = (name: string, schema: ContentSchema, sourceKey?: string) => string;
5
+ export declare type ContentTransform = (schema: PropertySchema, obj: unknown, name?: string) => unknown;
6
+ export declare type SourceKeyTransform = (name: string, schema: PropertySchema) => string | string[];
7
+ export declare type KeyTransform = (name: string, schema: PropertySchema, sourceKey?: string) => string;
8
8
  export interface PropertyTransform {
9
9
  keyTransform?: KeyTransform;
10
- filter(schema: ContentSchema, name: string, shape?: Shape): boolean;
11
- process(value: unknown, schema: ContentSchema, name: string, shape: Shape | undefined, next: (value: unknown, schema: ContentSchema, name: string) => unknown): unknown;
10
+ filter(schema: PropertySchema, name: string, shape?: Shape): boolean;
11
+ process(value: unknown, schema: PropertySchema, name: string, shape: Shape | undefined, next: (value: unknown, schema: PropertySchema, name: string) => unknown): unknown;
12
12
  }
13
13
  export interface Accumulator<T = unknown> {
14
- accumulate(value: unknown, schema: ContentSchema, name: string): void;
14
+ accumulate(value: unknown, schema: PropertySchema, name: string): void;
15
15
  getResults(): T;
16
16
  }
17
17
  export declare type PropertyTransformMap = {
@@ -25,12 +25,12 @@ export interface ContentTransformParams {
25
25
  sourceKeyTransform?: SourceKeyTransform;
26
26
  passThrough?: boolean;
27
27
  }
28
- export declare function preferKey(name: string, schema: ContentSchema): string;
29
- export declare function preferSourceKey(name: string, schema: ContentSchema): string[];
30
- export declare function findTransforms(pluginMap: PropertyTransformMap | undefined, schema: ContentSchema, name: string, shape?: Shape): PropertyTransform | undefined;
28
+ export declare function preferKey(name: string, schema: PropertySchema): string;
29
+ export declare function preferSourceKey(name: string, schema: PropertySchema): string[];
30
+ export declare function findTransforms(pluginMap: PropertyTransformMap | undefined, schema: PropertySchema, name: string, shape?: Shape): PropertyTransform | undefined;
31
31
  export declare function getContentTransform({ transforms, accumulators, keyTransform, sourceKeyTransform, passThrough, projectSchema }: ContentTransformParams): ContentTransform;
32
32
  export interface PropertyInfo {
33
- schema: ContentSchema;
33
+ schema: PropertySchema;
34
34
  key: string;
35
35
  }
36
36
  export interface GetPropertyInfoContext {
@@ -38,5 +38,5 @@ export interface GetPropertyInfoContext {
38
38
  transforms?: PropertyTransformMap;
39
39
  keyTransform?: KeyTransform;
40
40
  }
41
- export declare function getPropertyInfo(context: GetPropertyInfoContext, schema: ContentSchema, path: string): PropertyInfo[];
41
+ export declare function getPropertyInfo(context: GetPropertyInfoContext, schema: PropertySchema, path: string): PropertyInfo[];
42
42
  //# sourceMappingURL=content-schema-transform.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-schema-transform.d.ts","sourceRoot":"","sources":["../../src/content-schema-transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAE,aAAa,EAAE,KAAK,EAAC,MAAM,kBAAkB,CAAC;AAW1E,oBAAY,UAAU,GAAG,GAAG,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAEhG,wBAAgB,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG,UAAU,CAqBvE;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3C;AAMD,oBAAY,gBAAgB,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;AAE/F,oBAAY,kBAAkB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,KAAK,MAAM,GAAG,MAAM,EAAE,CAAC;AAE5F,oBAAY,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAE/F,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;IACpE,OAAO,CACL,KAAK,EAAE,OAAO,EACd,MAAM,EA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,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,YAAY,EACZ,YAAwB,EACxB,kBAAoC,EACpC,WAAkB,EAClB,aAAa,EACd,EAAE,sBAAsB,GAAG,gBAAgB,CAqE3C;AAgBD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,cAAc,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,EAAE,CAkCrH"}
package/lib/enum.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { ContentSchema } from './project-schema';
2
- export declare function isEnumSchema(schema: ContentSchema): boolean;
1
+ import { PropertySchema } from './project-schema';
2
+ export declare function isEnumLikeSchema(schema: PropertySchema): boolean;
3
3
  //# sourceMappingURL=enum.d.ts.map
package/lib/enum.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../src/enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/C,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAY3D"}
1
+ {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../src/enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAYhE"}
package/lib/enum.js CHANGED
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isEnumSchema = isEnumSchema;
6
+ exports.isEnumLikeSchema = isEnumLikeSchema;
7
7
 
8
- function isEnumSchema(schema) {
8
+ function isEnumLikeSchema(schema) {
9
9
  if (schema.enum) {
10
10
  return true;
11
11
  }
@@ -1,4 +1,4 @@
1
- import { ProjectSchema, ContentSchema } from './project-schema';
1
+ import { ProjectSchema, PropertySchema } from './project-schema';
2
2
  export declare type IsLeaf = (key?: string) => boolean;
3
- export declare function getIsLeaf(projectSchema: ProjectSchema, shapeSchema: ContentSchema): IsLeaf;
3
+ export declare function getIsLeaf(projectSchema: ProjectSchema, shapeSchema: PropertySchema): IsLeaf;
4
4
  //# sourceMappingURL=get-is-leaf.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-is-leaf.d.ts","sourceRoot":"","sources":["../../src/get-is-leaf.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAE,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAsB9D,oBAAY,MAAM,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;AAE/C,wBAAgB,SAAS,CAAC,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,GAAG,MAAM,CAwC1F"}
1
+ {"version":3,"file":"get-is-leaf.d.ts","sourceRoot":"","sources":["../../src/get-is-leaf.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAsB/D,oBAAY,MAAM,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;AAE/C,wBAAgB,SAAS,CAAC,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,GAAG,MAAM,CAwC3F"}
@@ -13,13 +13,13 @@ var _refs = require("./refs");
13
13
 
14
14
  const scalarTags = new Set(['draftjs']);
15
15
 
16
- function isLeafTypeV3(projectSchema, contentSchema) {
17
- const type = (0, _contentSchemaTransform.getType)(contentSchema);
16
+ function isLeafTypeV3(projectSchema, propertySchema) {
17
+ const type = (0, _contentSchemaTransform.getType)(propertySchema);
18
18
  return Boolean( // Must have key
19
- (0, _schemaUtil.getKey)(contentSchema) && ( // If is not a structure, then is a leaf
19
+ (0, _schemaUtil.getKey)(propertySchema) && ( // If is not a structure, then is a leaf
20
20
  !['object', 'array'].includes(type) || // If is relationship, then is a leaf
21
- contentSchema['@relationship'] || contentSchema['@tag'] && scalarTags.has(contentSchema['@tag']) || // If is array, then should not be a synchronized structure
22
- type === 'array' && !contentSchema['@syncLocaleStructure'] || (0, _schemaUtil.isBuiltinType)(projectSchema, contentSchema)));
21
+ propertySchema['@relationship'] || propertySchema['@tag'] && scalarTags.has(propertySchema['@tag']) || // If is array, then should not be a synchronized structure
22
+ type === 'array' && !propertySchema['@syncLocaleStructure'] || (0, _schemaUtil.isBuiltinType)(projectSchema, propertySchema)));
23
23
  }
24
24
 
25
25
  function getIsLeaf(projectSchema, shapeSchema) {
@@ -60,7 +60,7 @@ const {
60
60
  restResolver,
61
61
  awsLambdaResolver
62
62
  }
63
- } = _schemas.latestMetaSchemaJson;
63
+ } = _schemas.latestSchemaJson;
64
64
 
65
65
  function isTakeshapeResolver(resolver) {
66
66
  return takeshapeResolver.properties.name.enum.includes(resolver.name);
@@ -1,4 +1,4 @@
1
- import type { ProjectSchema, AnyProjectSchema, ProjectSchemaV1_0_0, ProjectSchemaV3_0_0, ProjectSchemaV3_1_0, ProjectSchemaV3_2_0, ProjectSchemaV3_3_0, ProjectSchemaV3_4_0, ProjectSchemaV3_5_0, ProjectSchemaV3_5_1, ProjectSchemaV3_6_0, ProjectSchemaV3_7_0, ProjectSchemaV3_8_0, ProjectSchemaV3_9_0, ContentSchema, ContentTypeV1_0_0, ShapeMap, ContentSchemaV1_0_0, Relationship, FormConfig, Workflow, Shape } from './project-schema';
1
+ import type { ProjectSchema, AnyProjectSchema, ProjectSchemaV1_0_0, ProjectSchemaV3_0_0, ProjectSchemaV3_1_0, ProjectSchemaV3_2_0, ProjectSchemaV3_3_0, ProjectSchemaV3_4_0, ProjectSchemaV3_5_0, ProjectSchemaV3_5_1, ProjectSchemaV3_6_0, ProjectSchemaV3_7_0, ProjectSchemaV3_8_0, ProjectSchemaV3_9_0, ProjectSchemaV3_10_0, PropertySchema, ContentTypeV1_0_0, ContentSchemaV1_0_0, Relationship, FormConfig, Workflow, Shape, ShapeMapV3_0_0, ContentSchemaV3_0_0 } from './project-schema';
2
2
  import type { EncryptFn } from './services';
3
3
  import { SafeDecryptFn } from './services';
4
4
  export declare const listTypePrefix = "PaginatedList";
@@ -26,12 +26,12 @@ export interface ProjectSchemaMigrationContext {
26
26
  encryptFn: EncryptFn;
27
27
  decryptFn: SafeDecryptFn;
28
28
  }
29
- export declare function getRelationshipSchema(relationship: Relationship): ContentSchema;
29
+ export declare function getRelationshipSchema(relationship: Relationship): PropertySchema;
30
30
  export declare function migrateToContentSchemaV3(params: ConversionParams): {
31
- schema: ContentSchema;
32
- hoistedShapes?: ShapeMap;
31
+ schema: ContentSchemaV3_0_0;
32
+ hoistedShapes?: ShapeMapV3_0_0;
33
33
  };
34
- export declare function contentTypeToShape(contentType: ContentTypeV1_0_0, contentTypeId: string): ShapeMap;
34
+ export declare function contentTypeToShape(contentType: ContentTypeV1_0_0, contentTypeId: string): ShapeMapV3_0_0;
35
35
  export declare function migrateToV3(projectSchema: ProjectSchemaV1_0_0): ProjectSchemaV3_0_0;
36
36
  export declare function migrateToV3_1(context: ProjectSchemaMigrationContext, projectSchema: ProjectSchemaV3_0_0): Promise<ProjectSchemaV3_1_0>;
37
37
  export declare function migrateToV3_2(projectSchema: ProjectSchemaV3_1_0): ProjectSchemaV3_2_0;
@@ -43,6 +43,7 @@ export declare function migrateToV3_6(projectSchema: ProjectSchemaV3_5_1): Proje
43
43
  export declare function migrateToV3_7(projectSchema: ProjectSchemaV3_6_0): ProjectSchemaV3_7_0;
44
44
  export declare function migrateToV3_8(projectSchema: ProjectSchemaV3_7_0): ProjectSchemaV3_8_0;
45
45
  export declare function migrateToV3_9_0(projectSchema: ProjectSchemaV3_8_0): ProjectSchemaV3_9_0;
46
+ export declare function migrateToV3_10(projectSchema: ProjectSchemaV3_9_0): ProjectSchemaV3_10_0;
46
47
  export declare function migrateToLatestProjectSchema(context: ProjectSchemaMigrationContext, projectSchema: AnyProjectSchema): Promise<ProjectSchema>;
47
48
  export declare function normalizeSchemaVersion(version?: string): string;
48
49
  export declare function isV1Like(schema: {
@@ -1 +1 @@
1
- {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EAUnB,aAAa,EACb,iBAAiB,EAEjB,QAAQ,EACR,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,QAAQ,EAER,KAAK,EAEN,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AAc1C,OAAO,EAAC,aAAa,EAA8B,MAAM,YAAY,CAAC;AAiBtE,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAQ9C,UAAU,gBAAgB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,mBAAmB,CAAC;CACpC;AAED,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,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AAa,EAAE,mBAAmB,GAAG,mBAAmB,CAqEvF;AAsCD,wBAAgB,cAAc,CAAC,aAAa,EAAE,mBAAmB,GAAG,oBAAoB,CAUvF;AAED,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,6BAA6B,EACtC,aAAa,EAAE,gBAAgB,GAC9B,OAAO,CAAC,aAAa,CAAC,CAsDxB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAC,GAAG,OAAO,CAElE;AAED,wBAAgB,IAAI,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,IAAI,mBAAmB,CAE5E;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAC,GAAG,OAAO,CAElE;AAED,wBAAgB,IAAI,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,IAAI,mBAAmB,CAE5E;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,6BAA6B,EACtC,MAAM,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAMpC"}
package/lib/migration.js CHANGED
@@ -15,6 +15,7 @@ exports.migrateToContentSchemaV3 = migrateToContentSchemaV3;
15
15
  exports.migrateToLatestProjectSchema = migrateToLatestProjectSchema;
16
16
  exports.migrateToV3 = migrateToV3;
17
17
  exports.migrateToV3_1 = migrateToV3_1;
18
+ exports.migrateToV3_10 = migrateToV3_10;
18
19
  exports.migrateToV3_2 = migrateToV3_2;
19
20
  exports.migrateToV3_3 = migrateToV3_3;
20
21
  exports.migrateToV3_4 = migrateToV3_4;
@@ -40,6 +41,8 @@ var _services = require("./services");
40
41
 
41
42
  var _utils = require("./types/utils");
42
43
 
44
+ var _mapValues = _interopRequireDefault(require("lodash/mapValues"));
45
+
43
46
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
44
47
 
45
48
  const listTypePrefix = 'PaginatedList';
@@ -493,6 +496,59 @@ function migrateToV3_9_0(projectSchema) {
493
496
  };
494
497
  }
495
498
 
499
+ function migrateQueryToV3_10(query, queryName) {
500
+ const {
501
+ args,
502
+ shape
503
+ } = query;
504
+
505
+ if (typeof args === 'object' && ('oneOf' in args || 'allOf' in args || '$ref' in args || '@ref' in args)) {
506
+ // As of 11/15/2021 no production schemas contained queries with these args
507
+ throw new Error(`Query "${queryName}" contains an unsupported arg schema ${JSON.stringify(args)}. Please contact support`);
508
+ }
509
+
510
+ if (typeof shape === 'object' && !shape.items['@ref']) {
511
+ // As of 11/15/2021 no production schemas contained queries with array return shapes that are not @refs
512
+ throw new Error(`Query "${queryName}" contains an unsupported shape schema ${JSON.stringify(shape)}. Please contact support`);
513
+ }
514
+
515
+ return query;
516
+ }
517
+
518
+ function migrateShapeToV3_10(shape) {
519
+ const {
520
+ schema,
521
+ ...rest
522
+ } = shape; // As of 11/15/2021 no production schemas contained shapes with array schemas
523
+
524
+ if ('type' in schema && schema.type === 'array') {
525
+ throw new Error(`Shape ${shape.name} uses an unsupported array schema. Please contact support`);
526
+ }
527
+
528
+ const newSchema = '$ref' in schema || '@ref' in schema ? {
529
+ allOf: [schema]
530
+ } : schema;
531
+ return { ...rest,
532
+ schema: newSchema
533
+ };
534
+ }
535
+
536
+ function migrateToV3_10(projectSchema) {
537
+ const {
538
+ queries,
539
+ mutations,
540
+ shapes,
541
+ schemaVersion,
542
+ ...rest
543
+ } = projectSchema;
544
+ return { ...rest,
545
+ queries: (0, _mapValues.default)(queries, migrateQueryToV3_10),
546
+ mutations: (0, _mapValues.default)(mutations, migrateQueryToV3_10),
547
+ shapes: (0, _mapValues.default)(shapes, migrateShapeToV3_10),
548
+ schemaVersion: '3.10.0'
549
+ };
550
+ }
551
+
496
552
  async function migrateToLatestProjectSchema(context, projectSchema) {
497
553
  if (projectSchema.schemaVersion === '4.0.0') {
498
554
  throw new Error('You are using an unreleased schema version. Migration is not possible');
@@ -542,6 +598,10 @@ async function migrateToLatestProjectSchema(context, projectSchema) {
542
598
  projectSchema = migrateToV3_9_0(projectSchema);
543
599
  }
544
600
 
601
+ if ((0, _utils.isProjectSchemaV3_9)(projectSchema)) {
602
+ projectSchema = migrateToV3_10(projectSchema);
603
+ }
604
+
545
605
  return projectSchema;
546
606
  }
547
607
 
@@ -1,5 +1,6 @@
1
1
  export * from './latest';
2
2
  export * from './v4.0.0';
3
+ export * from './v3.10.0';
3
4
  export * from './v3.9.0';
4
5
  export * from './v3.8.0';
5
6
  export * from './v3.7.0';
@@ -13,6 +14,7 @@ export * from './v3.1.0';
13
14
  export * from './v3.0.0';
14
15
  export * from './v1.0.0';
15
16
  import { ProjectSchemaV4_0_0 } from './v4.0.0';
17
+ import { ProjectSchemaV3_10_0 } from './v3.10.0';
16
18
  import { ProjectSchemaV3_9_0 } from './v3.9.0';
17
19
  import { ProjectSchemaV3_8_0 } from './v3.8.0';
18
20
  import { ProjectSchemaV3_7_0 } from './v3.7.0';
@@ -26,5 +28,5 @@ import { ProjectSchemaV3_1_0 } from './v3.1.0';
26
28
  import { ProjectSchemaV3_0_0 } from './v3.0.0';
27
29
  import { ProjectSchemaV1_0_0 } from './v1.0.0';
28
30
  import { ProjectSchema } from './latest';
29
- export declare type AnyProjectSchema = ProjectSchemaV4_0_0 | ProjectSchemaV3_9_0 | ProjectSchemaV3_8_0 | ProjectSchemaV3_7_0 | ProjectSchemaV3_6_0 | ProjectSchemaV3_5_1 | ProjectSchemaV3_5_0 | ProjectSchemaV3_4_0 | ProjectSchemaV3_3_0 | ProjectSchemaV3_2_0 | ProjectSchemaV3_1_0 | ProjectSchemaV3_0_0 | ProjectSchemaV1_0_0 | ProjectSchema;
31
+ export declare type AnyProjectSchema = ProjectSchemaV4_0_0 | ProjectSchemaV3_10_0 | ProjectSchemaV3_9_0 | ProjectSchemaV3_8_0 | ProjectSchemaV3_7_0 | ProjectSchemaV3_6_0 | ProjectSchemaV3_5_1 | ProjectSchemaV3_5_0 | ProjectSchemaV3_4_0 | ProjectSchemaV3_3_0 | ProjectSchemaV3_2_0 | ProjectSchemaV3_1_0 | ProjectSchemaV3_0_0 | ProjectSchemaV1_0_0 | ProjectSchema;
30
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/project-schema/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,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AM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,oBAAY,gBAAgB,GACxB,mBAAmB,GACnB,oBAAoB,GACpB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,aAAa,CAAC"}
@@ -30,7 +30,7 @@ Object.keys(_v).forEach(function (key) {
30
30
  });
31
31
  });
32
32
 
33
- var _v2 = require("./v3.9.0");
33
+ var _v2 = require("./v3.10.0");
34
34
 
35
35
  Object.keys(_v2).forEach(function (key) {
36
36
  if (key === "default" || key === "__esModule") return;
@@ -43,7 +43,7 @@ Object.keys(_v2).forEach(function (key) {
43
43
  });
44
44
  });
45
45
 
46
- var _v3 = require("./v3.8.0");
46
+ var _v3 = require("./v3.9.0");
47
47
 
48
48
  Object.keys(_v3).forEach(function (key) {
49
49
  if (key === "default" || key === "__esModule") return;
@@ -56,7 +56,7 @@ Object.keys(_v3).forEach(function (key) {
56
56
  });
57
57
  });
58
58
 
59
- var _v4 = require("./v3.7.0");
59
+ var _v4 = require("./v3.8.0");
60
60
 
61
61
  Object.keys(_v4).forEach(function (key) {
62
62
  if (key === "default" || key === "__esModule") return;
@@ -69,7 +69,7 @@ Object.keys(_v4).forEach(function (key) {
69
69
  });
70
70
  });
71
71
 
72
- var _v5 = require("./v3.6.0");
72
+ var _v5 = require("./v3.7.0");
73
73
 
74
74
  Object.keys(_v5).forEach(function (key) {
75
75
  if (key === "default" || key === "__esModule") return;
@@ -82,7 +82,7 @@ Object.keys(_v5).forEach(function (key) {
82
82
  });
83
83
  });
84
84
 
85
- var _v6 = require("./v3.5.1");
85
+ var _v6 = require("./v3.6.0");
86
86
 
87
87
  Object.keys(_v6).forEach(function (key) {
88
88
  if (key === "default" || key === "__esModule") return;
@@ -95,7 +95,7 @@ Object.keys(_v6).forEach(function (key) {
95
95
  });
96
96
  });
97
97
 
98
- var _v7 = require("./v3.5.0");
98
+ var _v7 = require("./v3.5.1");
99
99
 
100
100
  Object.keys(_v7).forEach(function (key) {
101
101
  if (key === "default" || key === "__esModule") return;
@@ -108,7 +108,7 @@ Object.keys(_v7).forEach(function (key) {
108
108
  });
109
109
  });
110
110
 
111
- var _v8 = require("./v3.4.0");
111
+ var _v8 = require("./v3.5.0");
112
112
 
113
113
  Object.keys(_v8).forEach(function (key) {
114
114
  if (key === "default" || key === "__esModule") return;
@@ -121,7 +121,7 @@ Object.keys(_v8).forEach(function (key) {
121
121
  });
122
122
  });
123
123
 
124
- var _v9 = require("./v3.3.0");
124
+ var _v9 = require("./v3.4.0");
125
125
 
126
126
  Object.keys(_v9).forEach(function (key) {
127
127
  if (key === "default" || key === "__esModule") return;
@@ -134,7 +134,7 @@ Object.keys(_v9).forEach(function (key) {
134
134
  });
135
135
  });
136
136
 
137
- var _v10 = require("./v3.2.0");
137
+ var _v10 = require("./v3.3.0");
138
138
 
139
139
  Object.keys(_v10).forEach(function (key) {
140
140
  if (key === "default" || key === "__esModule") return;
@@ -147,7 +147,7 @@ Object.keys(_v10).forEach(function (key) {
147
147
  });
148
148
  });
149
149
 
150
- var _v11 = require("./v3.1.0");
150
+ var _v11 = require("./v3.2.0");
151
151
 
152
152
  Object.keys(_v11).forEach(function (key) {
153
153
  if (key === "default" || key === "__esModule") return;
@@ -160,7 +160,7 @@ Object.keys(_v11).forEach(function (key) {
160
160
  });
161
161
  });
162
162
 
163
- var _v12 = require("./v3.0.0");
163
+ var _v12 = require("./v3.1.0");
164
164
 
165
165
  Object.keys(_v12).forEach(function (key) {
166
166
  if (key === "default" || key === "__esModule") return;
@@ -173,7 +173,7 @@ Object.keys(_v12).forEach(function (key) {
173
173
  });
174
174
  });
175
175
 
176
- var _v13 = require("./v1.0.0");
176
+ var _v13 = require("./v3.0.0");
177
177
 
178
178
  Object.keys(_v13).forEach(function (key) {
179
179
  if (key === "default" || key === "__esModule") return;
@@ -184,4 +184,17 @@ Object.keys(_v13).forEach(function (key) {
184
184
  return _v13[key];
185
185
  }
186
186
  });
187
+ });
188
+
189
+ var _v14 = require("./v1.0.0");
190
+
191
+ Object.keys(_v14).forEach(function (key) {
192
+ if (key === "default" || key === "__esModule") return;
193
+ if (key in exports && exports[key] === _v14[key]) return;
194
+ Object.defineProperty(exports, key, {
195
+ enumerable: true,
196
+ get: function () {
197
+ return _v14[key];
198
+ }
199
+ });
187
200
  });