@takeshape/schema 8.64.0 → 8.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/es/index.js +2 -1
  2. package/es/migration/index.js +8 -2
  3. package/es/migration/to/v3.14.0.js +10 -0
  4. package/es/project-schema/index.js +1 -0
  5. package/es/project-schema/v3.13.1.js +1 -0
  6. package/es/project-schema/v3.14.0.js +1 -0
  7. package/es/rewrite.js +59 -0
  8. package/es/schema-util.js +3 -3
  9. package/es/schemas/index.js +4 -3
  10. package/es/schemas/index.ts +4 -2
  11. package/es/schemas/project-schema/v3.14.0.json +2379 -0
  12. package/es/schemas/project-schema.json +2 -1
  13. package/es/template-shapes/templates.js +56 -45
  14. package/es/template-shapes/types.js +8 -1
  15. package/es/types/utils.js +1 -0
  16. package/examples/latest/betzino.json +1 -1
  17. package/examples/latest/blog-schema.json +1 -1
  18. package/examples/latest/brewery-schema.json +1 -1
  19. package/examples/latest/complex-project-schema.json +1 -1
  20. package/examples/latest/fabric-ecommerce.json +1 -1
  21. package/examples/latest/frank-and-fred-schema.json +1 -1
  22. package/examples/latest/massive-schema.json +1 -1
  23. package/examples/latest/mill-components-schema.json +1 -1
  24. package/examples/latest/pet-oneof-array.json +1 -1
  25. package/examples/latest/post-schema.json +1 -1
  26. package/examples/latest/pruned-shopify-product-schema.json +1 -1
  27. package/examples/latest/real-world-schema.json +1 -1
  28. package/examples/latest/recursive-repeater-schema.json +1 -1
  29. package/examples/latest/recursive-schema.json +1 -1
  30. package/examples/latest/rick-and-morty-ast.json +1 -1
  31. package/examples/latest/rick-and-morty-graphql.json +1 -1
  32. package/examples/latest/rick-and-morty-rest.json +1 -1
  33. package/examples/latest/schema-with-repeater-draftjs.json +1 -1
  34. package/examples/latest/shape-books-v3_2_0.json +1 -1
  35. package/examples/latest/shape-books.json +1 -1
  36. package/examples/latest/shopify-lookbook.json +1 -1
  37. package/examples/latest/shopify-store-with-widget.json +1 -1
  38. package/examples/latest/stripe-starter-resolved.json +1 -1
  39. package/examples/latest/user-schema-no-required.json +1 -1
  40. package/examples/latest/user-schema-with-defaults.json +1 -1
  41. package/lib/index.d.ts +1 -0
  42. package/lib/index.d.ts.map +1 -1
  43. package/lib/index.js +14 -0
  44. package/lib/migration/index.d.ts.map +1 -1
  45. package/lib/migration/index.js +8 -1
  46. package/lib/migration/to/v3.14.0.d.ts +4 -0
  47. package/lib/migration/to/v3.14.0.d.ts.map +1 -0
  48. package/lib/migration/to/v3.14.0.js +18 -0
  49. package/lib/project-schema/index.d.ts +3 -1
  50. package/lib/project-schema/index.d.ts.map +1 -1
  51. package/lib/project-schema/index.js +32 -19
  52. package/lib/project-schema/latest.d.ts +120 -1
  53. package/lib/project-schema/latest.d.ts.map +1 -1
  54. package/lib/project-schema/v3.13.1.d.ts +1413 -0
  55. package/lib/project-schema/v3.13.1.d.ts.map +1 -0
  56. package/lib/project-schema/v3.13.1.js +5 -0
  57. package/lib/project-schema/v3.14.0.d.ts +1437 -0
  58. package/lib/project-schema/v3.14.0.d.ts.map +1 -0
  59. package/lib/project-schema/v3.14.0.js +5 -0
  60. package/lib/rewrite.d.ts +10 -0
  61. package/lib/rewrite.d.ts.map +1 -0
  62. package/lib/rewrite.js +69 -0
  63. package/lib/schema-util.d.ts +1 -1
  64. package/lib/schema-util.d.ts.map +1 -1
  65. package/lib/schema-util.js +5 -4
  66. package/lib/schemas/index.d.ts +2 -2
  67. package/lib/schemas/index.d.ts.map +1 -1
  68. package/lib/schemas/index.js +23 -21
  69. package/lib/schemas/index.ts +4 -2
  70. package/lib/schemas/project-schema/v3.14.0.json +2379 -0
  71. package/lib/schemas/project-schema.json +2 -1
  72. package/lib/template-shapes/templates.d.ts +11 -4
  73. package/lib/template-shapes/templates.d.ts.map +1 -1
  74. package/lib/template-shapes/templates.js +60 -49
  75. package/lib/template-shapes/types.d.ts +6 -0
  76. package/lib/template-shapes/types.d.ts.map +1 -1
  77. package/lib/template-shapes/types.js +11 -1
  78. package/lib/types/types.d.ts +2 -2
  79. package/lib/types/types.d.ts.map +1 -1
  80. package/lib/types/utils.d.ts +2 -1
  81. package/lib/types/utils.d.ts.map +1 -1
  82. package/lib/types/utils.js +3 -1
  83. package/package.json +4 -4
@@ -20,6 +20,7 @@
20
20
  {"$ref": "https://schema.takeshape.io/project-schema/v3.12.0#"},
21
21
  {"$ref": "https://schema.takeshape.io/project-schema/v3.12.1#"},
22
22
  {"$ref": "https://schema.takeshape.io/project-schema/v3.12.2#"},
23
- {"$ref": "https://schema.takeshape.io/project-schema/v3.13.0#"}
23
+ {"$ref": "https://schema.takeshape.io/project-schema/v3.13.0#"},
24
+ {"$ref": "https://schema.takeshape.io/project-schema/v3.14.0#"}
24
25
  ]
25
26
  }
@@ -1,27 +1,25 @@
1
+ import { TemplateVerbs } from './types';
1
2
  import { listTypePrefix } from '../migration';
2
3
  import { isDefined, pascalCase } from '@takeshape/util';
3
4
  import keyBy from 'lodash/keyBy';
4
5
  import { createShape, getShapeDependencies, isIndexedRemoteShape, mergeSchemaProperties } from '../schema-util';
6
+ import { rewriteSchema } from '../rewrite';
5
7
  import { getFlattenedTemplateShapeName, getRefShapeName } from '../refs';
6
8
  import { getWhereSearchArg } from './where';
7
- const CREATE = 'create';
8
- const UPDATE = 'update';
9
- const DELETE = 'delete';
10
- const DUPLICATE = 'duplicate';
11
9
  export const TSGetArgs = getIDQueryArgs('TSGetArgs');
12
10
  export const TSGetSingletonArgs = getIDQueryArgs('TSGetSingletonArgs');
13
11
  export const TSListArgs = getShapeListQueryArgs('TSListArgs', true);
14
12
  export const TSSearchArgs = getShapeListQueryArgs('TSSearchArgs', false);
15
- export const CreateArgs = getMutationArgs('CreateArgs', CREATE);
16
- export const UpdateArgs = getMutationArgs('UpdateArgs', UPDATE);
17
- export const DuplicateArgs = getMutationArgs('DuplicateArgs', DUPLICATE);
18
- export const DeleteArgs = getMutationArgs('DeleteArgs', DELETE);
13
+ export const CreateArgs = getMutationArgs('CreateArgs', TemplateVerbs.Create);
14
+ export const UpdateArgs = getMutationArgs('UpdateArgs', TemplateVerbs.Update);
15
+ export const DuplicateArgs = getMutationArgs('DuplicateArgs', TemplateVerbs.Duplicate);
16
+ export const DeleteArgs = getMutationArgs('DeleteArgs', TemplateVerbs.Delete);
19
17
  export const PaginatedList = getPaginatedListShape;
20
18
  export const SearchResults = getSearchResultsShape;
21
- export const CreateResult = getMutationResultType(CREATE);
22
- export const UpdateResult = getMutationResultType(UPDATE);
23
- export const DuplicateResult = getMutationResultType(DUPLICATE);
24
- export const DeleteResult = getMutationResultType(DELETE);
19
+ export const CreateResult = getMutationResultType(TemplateVerbs.Create);
20
+ export const UpdateResult = getMutationResultType(TemplateVerbs.Update);
21
+ export const DuplicateResult = getMutationResultType(TemplateVerbs.Duplicate);
22
+ export const DeleteResult = getMutationResultType(TemplateVerbs.Delete);
25
23
  export const TSSearchSortInput = createShape('TSSearchSortInput', {
26
24
  type: 'object',
27
25
  properties: {
@@ -166,25 +164,6 @@ const idSchema = {
166
164
  },
167
165
  required: ['_id']
168
166
  };
169
- export function rewriteSchema(shapeSchema) {
170
- return JSON.parse(JSON.stringify(shapeSchema), (key, value) => {
171
- if (typeof value === 'object') {
172
- var _value$required;
173
-
174
- // Remove required
175
- if ((_value$required = value.required) !== null && _value$required !== void 0 && _value$required.length) {
176
- delete value.required;
177
- } // Remove default
178
-
179
-
180
- if (value.type !== undefined && value.default !== undefined) {
181
- delete value.default;
182
- }
183
- }
184
-
185
- return value;
186
- });
187
- }
188
167
  export function getIDQueryArgs(templateName) {
189
168
  return (context, shape) => {
190
169
  var _shape$model;
@@ -206,18 +185,49 @@ function mergeObjectSchemas(...args) {
206
185
  properties: {}
207
186
  });
208
187
  }
188
+ /**
189
+ * Construct a shape name used for a mutation input shape.
190
+ */
191
+
192
+
193
+ export function getMutationInputShapeName(verb) {
194
+ return shapeName => {
195
+ return pascalCase([verb, shapeName, 'input']);
196
+ };
197
+ }
198
+
199
+ /**
200
+ * Create a shape name variant for an input. Updates will typically want a partial input.
201
+ */
202
+ function getInputShapeName(shapeName, {
203
+ isPartial
204
+ }) {
205
+ return isPartial ? `${shapeName}PartialInput` : `${shapeName}Input`;
206
+ }
207
+ /**
208
+ * Construct shapes for a mutation inputs, given source shape info.
209
+ */
210
+
209
211
 
210
212
  export function getMutationArgs(templateName, verb) {
213
+ const getShapeName = getMutationInputShapeName(verb);
214
+ const addLocale = verb === TemplateVerbs.Update || verb === TemplateVerbs.Duplicate;
215
+ const addStructure = verb === TemplateVerbs.Update;
216
+ const isUpdate = verb === TemplateVerbs.Update || verb === TemplateVerbs.Duplicate;
211
217
  return ({
212
218
  projectSchema
213
219
  }, shape) => {
214
- const addLocale = verb === UPDATE || verb === DUPLICATE;
215
- const addStructure = verb === UPDATE;
216
- const inputName = pascalCase([verb, shape.name, 'input']);
220
+ const inputName = getShapeName(shape.name);
217
221
  const isSingleton = shape.model && shape.model.type === 'single';
218
- const requireId = !isSingleton && (verb === UPDATE || verb === DELETE || verb === DUPLICATE);
219
- const isUpdate = verb === UPDATE || verb === DUPLICATE;
220
- const inputShape = createShape(inputName, mergeObjectSchemas(requireId ? idSchema : undefined, verb !== DELETE ? isUpdate ? rewriteSchema(shape.schema) : shape.schema : undefined), {
222
+ const shouldRequireId = !isSingleton && (verb === TemplateVerbs.Update || verb === TemplateVerbs.Delete || verb === TemplateVerbs.Duplicate);
223
+ const rewrittenSchema = verb !== TemplateVerbs.Delete ? rewriteSchema(shape.schema, isUpdate ? {
224
+ removeDefault: true,
225
+ removeRequired: true,
226
+ replaceInput: true
227
+ } : {
228
+ replaceInput: true
229
+ }) : undefined;
230
+ const inputShape = createShape(inputName, mergeObjectSchemas(shouldRequireId ? idSchema : undefined, rewrittenSchema), {
221
231
  description: `${verb} ${shape.name} input`
222
232
  });
223
233
  const argsShapeName = getFlattenedTemplateShapeName(shape.name, templateName);
@@ -233,15 +243,12 @@ export function getMutationArgs(templateName, verb) {
233
243
  },
234
244
  required: ['input']
235
245
  }, addStructure ? contentStructureFields : undefined, addLocale ? localeProps : undefined));
236
-
237
- const getInputShapeName = shapeName => isUpdate ? `${shapeName}PartialInput` : `${shapeName}Input`;
238
-
239
246
  return {
240
247
  shapeName: argsShapeName,
241
248
  dependencies: {
242
249
  [inputName]: inputShape,
243
250
  [argsShapeName]: argsShape,
244
- ...(verb !== DELETE && keyBy(getShapeDependencies(projectSchema, shape, propSchema => {
251
+ ...(verb !== TemplateVerbs.Delete && keyBy(getShapeDependencies(projectSchema, shape, propSchema => {
245
252
  if (!propSchema['@resolver']) {
246
253
  return false;
247
254
  }
@@ -249,17 +256,21 @@ export function getMutationArgs(templateName, verb) {
249
256
  const shapeName = getRefShapeName(projectSchema, propSchema);
250
257
 
251
258
  if (shapeName) {
252
- return shapeName !== 'TSRelationship' && !projectSchema.shapes[getInputShapeName(shapeName)];
259
+ return shapeName !== 'TSRelationship' && !projectSchema.shapes[getInputShapeName(shapeName, {
260
+ isPartial: isUpdate
261
+ })];
253
262
  }
254
263
 
255
264
  return true;
256
265
  }).map(shapeName => {
257
266
  const shape = projectSchema.shapes[shapeName];
258
- const name = getInputShapeName(shapeName);
267
+ const name = getInputShapeName(shapeName, {
268
+ isPartial: isUpdate
269
+ });
259
270
  return { ...shape,
260
271
  name,
261
272
  id: name,
262
- schema: isUpdate ? rewriteSchema(shape.schema) : shape.schema
273
+ schema: rewrittenSchema
263
274
  };
264
275
  }), 'name')),
265
276
  ...(addStructure ? {
@@ -272,7 +283,7 @@ export function getMutationArgs(templateName, verb) {
272
283
  export function getMutationResultType(verb) {
273
284
  return (context, shape) => {
274
285
  const shapeName = pascalCase([verb, shape.name, 'result']);
275
- const result = verb === DELETE ? {
286
+ const result = verb === TemplateVerbs.Delete ? {
276
287
  type: 'boolean'
277
288
  } : {
278
289
  '@ref': `local:${shape.name}`
@@ -1 +1,8 @@
1
- export {};
1
+ export let TemplateVerbs;
2
+
3
+ (function (TemplateVerbs) {
4
+ TemplateVerbs["Create"] = "create";
5
+ TemplateVerbs["Update"] = "update";
6
+ TemplateVerbs["Duplicate"] = "duplicate";
7
+ TemplateVerbs["Delete"] = "delete";
8
+ })(TemplateVerbs || (TemplateVerbs = {}));
package/es/types/utils.js CHANGED
@@ -75,6 +75,7 @@ export const isProjectSchemaV3_12_1 = createVersionPredicate('3.12.1');
75
75
  export const isProjectSchemaV3_12_2 = createVersionPredicate('3.12.2');
76
76
  export const isProjectSchemaV3_12_3 = createVersionPredicate('3.12.3');
77
77
  export const isProjectSchemaV3_13_0 = createVersionPredicate('3.13.0');
78
+ export const isProjectSchemaV3_14_0 = createVersionPredicate('3.14.0');
78
79
  export const isLatestProjectSchema = createVersionPredicate(CURRENT_SCHEMA_VERSION);
79
80
  export function isV1XSchema(maybeSchema) {
80
81
  return isObject(maybeSchema) && isString(maybeSchema.projectId) && isObject(maybeSchema.contentTypes) && (isUndefined(maybeSchema.schemaVersion) || maybeSchema.schemaVersion === '1' || maybeSchema.schemaVersion === '1.0.0');
@@ -45168,6 +45168,6 @@
45168
45168
  }
45169
45169
  }
45170
45170
  },
45171
- "schemaVersion": "3.13.0",
45171
+ "schemaVersion": "3.14.0",
45172
45172
  "services": {}
45173
45173
  }
@@ -382,6 +382,6 @@
382
382
  }
383
383
  }
384
384
  },
385
- "schemaVersion": "3.13.0",
385
+ "schemaVersion": "3.14.0",
386
386
  "services": {}
387
387
  }
@@ -381,6 +381,6 @@
381
381
  }
382
382
  }
383
383
  },
384
- "schemaVersion": "3.13.0",
384
+ "schemaVersion": "3.14.0",
385
385
  "services": {}
386
386
  }
@@ -3991,6 +3991,6 @@
3991
3991
  }
3992
3992
  }
3993
3993
  },
3994
- "schemaVersion": "3.13.0",
3994
+ "schemaVersion": "3.14.0",
3995
3995
  "services": {}
3996
3996
  }
@@ -10516,5 +10516,5 @@
10516
10516
  }
10517
10517
  }
10518
10518
  },
10519
- "schemaVersion": "3.13.0"
10519
+ "schemaVersion": "3.14.0"
10520
10520
  }
@@ -20505,6 +20505,6 @@
20505
20505
  }
20506
20506
  }
20507
20507
  },
20508
- "schemaVersion": "3.13.0",
20508
+ "schemaVersion": "3.14.0",
20509
20509
  "services": {}
20510
20510
  }
@@ -7276,6 +7276,6 @@
7276
7276
  }
7277
7277
  }
7278
7278
  },
7279
- "schemaVersion": "3.13.0",
7279
+ "schemaVersion": "3.14.0",
7280
7280
  "services": {}
7281
7281
  }
@@ -1826,6 +1826,6 @@
1826
1826
  }
1827
1827
  }
1828
1828
  },
1829
- "schemaVersion": "3.13.0",
1829
+ "schemaVersion": "3.14.0",
1830
1830
  "services": {}
1831
1831
  }
@@ -404,6 +404,6 @@
404
404
  }
405
405
  }
406
406
  },
407
- "schemaVersion": "3.13.0",
407
+ "schemaVersion": "3.14.0",
408
408
  "services": {}
409
409
  }
@@ -223,6 +223,6 @@
223
223
  }
224
224
  }
225
225
  },
226
- "schemaVersion": "3.13.0",
226
+ "schemaVersion": "3.14.0",
227
227
  "services": {}
228
228
  }
@@ -9760,5 +9760,5 @@
9760
9760
  }
9761
9761
  }
9762
9762
  },
9763
- "schemaVersion": "3.13.0"
9763
+ "schemaVersion": "3.14.0"
9764
9764
  }
@@ -1005,6 +1005,6 @@
1005
1005
  }
1006
1006
  }
1007
1007
  },
1008
- "schemaVersion": "3.13.0",
1008
+ "schemaVersion": "3.14.0",
1009
1009
  "services": {}
1010
1010
  }
@@ -141,6 +141,6 @@
141
141
  }
142
142
  }
143
143
  },
144
- "schemaVersion": "3.13.0",
144
+ "schemaVersion": "3.14.0",
145
145
  "services": {}
146
146
  }
@@ -148,6 +148,6 @@
148
148
  }
149
149
  }
150
150
  },
151
- "schemaVersion": "3.13.0",
151
+ "schemaVersion": "3.14.0",
152
152
  "services": {}
153
153
  }
@@ -2706,5 +2706,5 @@
2706
2706
  }
2707
2707
  }
2708
2708
  },
2709
- "schemaVersion": "3.13.0"
2709
+ "schemaVersion": "3.14.0"
2710
2710
  }
@@ -2216,5 +2216,5 @@
2216
2216
  }
2217
2217
  }
2218
2218
  },
2219
- "schemaVersion": "3.13.0"
2219
+ "schemaVersion": "3.14.0"
2220
2220
  }
@@ -96,5 +96,5 @@
96
96
  }
97
97
  }
98
98
  },
99
- "schemaVersion": "3.13.0"
99
+ "schemaVersion": "3.14.0"
100
100
  }
@@ -386,6 +386,6 @@
386
386
  }
387
387
  }
388
388
  },
389
- "schemaVersion": "3.13.0",
389
+ "schemaVersion": "3.14.0",
390
390
  "services": {}
391
391
  }
@@ -1110,6 +1110,6 @@
1110
1110
  }
1111
1111
  }
1112
1112
  },
1113
- "schemaVersion": "3.13.0",
1113
+ "schemaVersion": "3.14.0",
1114
1114
  "services": {}
1115
1115
  }
@@ -1070,6 +1070,6 @@
1070
1070
  }
1071
1071
  }
1072
1072
  },
1073
- "schemaVersion": "3.13.0",
1073
+ "schemaVersion": "3.14.0",
1074
1074
  "services": {}
1075
1075
  }
@@ -1182,5 +1182,5 @@
1182
1182
  }
1183
1183
  }
1184
1184
  },
1185
- "schemaVersion": "3.13.0"
1185
+ "schemaVersion": "3.14.0"
1186
1186
  }
@@ -12534,5 +12534,5 @@
12534
12534
  }
12535
12535
  }
12536
12536
  },
12537
- "schemaVersion": "3.13.0"
12537
+ "schemaVersion": "3.14.0"
12538
12538
  }
@@ -29315,5 +29315,5 @@
29315
29315
  }
29316
29316
  }
29317
29317
  },
29318
- "schemaVersion": "3.13.0"
29318
+ "schemaVersion": "3.14.0"
29319
29319
  }
@@ -169,6 +169,6 @@
169
169
  }
170
170
  }
171
171
  },
172
- "schemaVersion": "3.13.0",
172
+ "schemaVersion": "3.14.0",
173
173
  "services": {}
174
174
  }
@@ -194,6 +194,6 @@
194
194
  }
195
195
  }
196
196
  },
197
- "schemaVersion": "3.13.0",
197
+ "schemaVersion": "3.14.0",
198
198
  "services": {}
199
199
  }
package/lib/index.d.ts CHANGED
@@ -26,4 +26,5 @@ export * from './types/types';
26
26
  export * from './types/utils';
27
27
  export * from './flatten-templates';
28
28
  export * from './relationships';
29
+ export * from './rewrite';
29
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,mBAAmB,EAAE,6BAA6B,EAAC,MAAM,mBAAmB,CAAC;AAE1F,YAAY,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,mBAAmB,EAAE,6BAA6B,EAAC,MAAM,mBAAmB,CAAC;AAE1F,YAAY,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
package/lib/index.js CHANGED
@@ -361,4 +361,18 @@ Object.keys(_relationships).forEach(function (key) {
361
361
  return _relationships[key];
362
362
  }
363
363
  });
364
+ });
365
+
366
+ var _rewrite = require("./rewrite");
367
+
368
+ Object.keys(_rewrite).forEach(function (key) {
369
+ if (key === "default" || key === "__esModule") return;
370
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
371
+ if (key in exports && exports[key] === _rewrite[key]) return;
372
+ Object.defineProperty(exports, key, {
373
+ enumerable: true,
374
+ get: function () {
375
+ return _rewrite[key];
376
+ }
377
+ });
364
378
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migration/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EAAC,6BAA6B,EAAC,MAAM,SAAS,CAAC;AAyC3D,cAAc,SAAS,CAAC;AAExB,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAE9C,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,6BAA6B,EACtC,aAAa,EAAE,gBAAgB,GAC9B,OAAO,CAAC,aAAa,CAAC,CA8ExB;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,6BAA6B,EACtC,MAAM,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAMpC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migration/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EAAC,6BAA6B,EAAC,MAAM,SAAS,CAAC;AA2C3D,cAAc,SAAS,CAAC;AAExB,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAG9C,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,6BAA6B,EACtC,aAAa,EAAE,gBAAgB,GAC9B,OAAO,CAAC,aAAa,CAAC,CAkFxB;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,6BAA6B,EACtC,MAAM,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAMpC"}
@@ -50,6 +50,8 @@ var _v17 = _interopRequireDefault(require("./to/v3.12.3"));
50
50
 
51
51
  var _v18 = _interopRequireDefault(require("./to/v3.13.0"));
52
52
 
53
+ var _v19 = _interopRequireDefault(require("./to/v3.14.0"));
54
+
53
55
  var _utils2 = require("./utils");
54
56
 
55
57
  Object.keys(_utils2).forEach(function (key) {
@@ -66,7 +68,8 @@ Object.keys(_utils2).forEach(function (key) {
66
68
 
67
69
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
68
70
 
69
- const listTypePrefix = 'PaginatedList';
71
+ const listTypePrefix = 'PaginatedList'; // eslint-disable-next-line complexity
72
+
70
73
  exports.listTypePrefix = listTypePrefix;
71
74
 
72
75
  async function migrateToLatestProjectSchema(context, projectSchema) {
@@ -146,6 +149,10 @@ async function migrateToLatestProjectSchema(context, projectSchema) {
146
149
  projectSchema = (0, _v18.default)(projectSchema);
147
150
  }
148
151
 
152
+ if ((0, _utils.isProjectSchemaV3_13_0)(projectSchema)) {
153
+ projectSchema = (0, _v19.default)(projectSchema);
154
+ }
155
+
149
156
  return projectSchema;
150
157
  }
151
158
 
@@ -0,0 +1,4 @@
1
+ import type { ProjectSchemaV3_13_0, ProjectSchemaV3_14_0 } from '../../project-schema';
2
+ declare function migrateToV3_14_0(projectSchema: ProjectSchemaV3_13_0): ProjectSchemaV3_14_0;
3
+ export default migrateToV3_14_0;
4
+ //# sourceMappingURL=v3.14.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3.14.0.d.ts","sourceRoot":"","sources":["../../../../src/migration/to/v3.14.0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAE,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAErF,iBAAS,gBAAgB,CAAC,aAAa,EAAE,oBAAoB,GAAG,oBAAoB,CAQnF;AAED,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ function migrateToV3_14_0(projectSchema) {
9
+ /**
10
+ * No migration needed all changes are backwards compatible.
11
+ */
12
+ return { ...projectSchema,
13
+ schemaVersion: '3.14.0'
14
+ };
15
+ }
16
+
17
+ var _default = migrateToV3_14_0;
18
+ exports.default = _default;
@@ -1,5 +1,6 @@
1
1
  export * from './latest';
2
2
  export * from './v4.0.0';
3
+ export * from './v3.14.0';
3
4
  export * from './v3.13.0';
4
5
  export * from './v3.12.3';
5
6
  export * from './v3.12.2';
@@ -20,6 +21,7 @@ export * from './v3.1.0';
20
21
  export * from './v3.0.0';
21
22
  export * from './v1.0.0';
22
23
  import { ProjectSchemaV4_0_0 } from './v4.0.0';
24
+ import { ProjectSchemaV3_14_0 } from './v3.14.0';
23
25
  import { ProjectSchemaV3_13_0 } from './v3.13.0';
24
26
  import { ProjectSchemaV3_12_3 } from './v3.12.3';
25
27
  import { ProjectSchemaV3_12_2 } from './v3.12.2';
@@ -40,5 +42,5 @@ import { ProjectSchemaV3_1_0 } from './v3.1.0';
40
42
  import { ProjectSchemaV3_0_0 } from './v3.0.0';
41
43
  import { ProjectSchemaV1_0_0 } from './v1.0.0';
42
44
  import { ProjectSchema } from './latest';
43
- export declare type AnyProjectSchema = ProjectSchemaV4_0_0 | ProjectSchemaV3_13_0 | ProjectSchemaV3_12_3 | ProjectSchemaV3_12_2 | ProjectSchemaV3_12_1 | ProjectSchemaV3_12_0 | ProjectSchemaV3_11_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;
45
+ export declare type AnyProjectSchema = ProjectSchemaV4_0_0 | ProjectSchemaV3_14_0 | ProjectSchemaV3_13_0 | ProjectSchemaV3_12_3 | ProjectSchemaV3_12_2 | ProjectSchemaV3_12_1 | ProjectSchemaV3_12_0 | ProjectSchemaV3_11_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;
44
46
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","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