@fraym/projections 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cmd/projections.js +18 -4
- package/package.json +1 -1
package/dist/cmd/projections.js
CHANGED
|
@@ -223,14 +223,20 @@ const addNestedTypesToSchema = (definitions, nestedTypeName, nestedTypes) => {
|
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
225
|
let newSchema = definitions[nestedTypeName].schema;
|
|
226
|
-
nestedTypes.
|
|
226
|
+
if (!nestedTypes.includes(nestedTypeName)) {
|
|
227
|
+
nestedTypes.push(nestedTypeName);
|
|
228
|
+
}
|
|
227
229
|
nestedTypeDefinition.nestedTypes.forEach(nestedNestedTypeName => {
|
|
228
230
|
const nestedSchemaData = addNestedTypesToSchema(definitions, nestedNestedTypeName, nestedTypes);
|
|
229
231
|
if (nestedSchemaData.schema === "") {
|
|
230
232
|
return;
|
|
231
233
|
}
|
|
232
234
|
newSchema += `\n${nestedSchemaData.schema}`;
|
|
233
|
-
nestedTypes.
|
|
235
|
+
nestedSchemaData.nestedTypes.forEach(nestedType => {
|
|
236
|
+
if (!nestedTypes.includes(nestedType)) {
|
|
237
|
+
nestedTypes.push(nestedType);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
234
240
|
});
|
|
235
241
|
return {
|
|
236
242
|
schema: newSchema,
|
|
@@ -262,7 +268,11 @@ const migrateSchemas = async (definitions, serverAddress, namespace) => {
|
|
|
262
268
|
return;
|
|
263
269
|
}
|
|
264
270
|
updateSchema += `\n${nestedSchemaData.schema}`;
|
|
265
|
-
|
|
271
|
+
nestedSchemaData.nestedTypes.forEach(nestedType => {
|
|
272
|
+
if (!nestedTypesToUpdate.includes(nestedType)) {
|
|
273
|
+
nestedTypesToUpdate.push(nestedType);
|
|
274
|
+
}
|
|
275
|
+
});
|
|
266
276
|
});
|
|
267
277
|
}
|
|
268
278
|
});
|
|
@@ -278,7 +288,11 @@ const migrateSchemas = async (definitions, serverAddress, namespace) => {
|
|
|
278
288
|
return;
|
|
279
289
|
}
|
|
280
290
|
createSchema += `\n${nestedSchemaData.schema}`;
|
|
281
|
-
|
|
291
|
+
nestedSchemaData.nestedTypes.forEach(nestedType => {
|
|
292
|
+
if (!nestedTypesToCreate.includes(nestedType)) {
|
|
293
|
+
nestedTypesToCreate.push(nestedType);
|
|
294
|
+
}
|
|
295
|
+
});
|
|
282
296
|
});
|
|
283
297
|
});
|
|
284
298
|
if (projectionsToCreate.length > 0) {
|