contensis-cli 1.5.1-beta.6 → 1.5.1-beta.8
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/commands/get.js +9 -3
- package/dist/commands/get.js.map +2 -2
- package/dist/commands/globalOptions.js +8 -1
- package/dist/commands/globalOptions.js.map +2 -2
- package/dist/commands/import.js +2 -2
- package/dist/commands/import.js.map +2 -2
- package/dist/mappers/MixedFileData.js +83 -0
- package/dist/mappers/MixedFileData.js.map +7 -0
- package/dist/services/ContensisCliService.js +59 -83
- package/dist/services/ContensisCliService.js.map +2 -2
- package/dist/util/index.js +0 -21
- package/dist/util/index.js.map +2 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +2 -2
- package/src/commands/get.ts +10 -3
- package/src/commands/globalOptions.ts +11 -0
- package/src/commands/import.ts +4 -1
- package/src/mappers/MixedFileData.ts +80 -0
- package/src/services/ContensisCliService.ts +67 -118
- package/src/util/index.ts +0 -26
- package/src/version.ts +1 -1
|
@@ -28,17 +28,17 @@ import {
|
|
|
28
28
|
import ContensisAuthService from './ContensisAuthService';
|
|
29
29
|
|
|
30
30
|
import { LogMessages } from '~/localisation/en-GB';
|
|
31
|
+
import { MixedFileData } from '~/mappers/MixedFileData';
|
|
31
32
|
import {
|
|
32
33
|
CliUrls,
|
|
33
34
|
OutputFormat,
|
|
34
35
|
OutputOptionsConstructorArg,
|
|
35
36
|
} from '~/models/CliService';
|
|
36
37
|
|
|
37
|
-
import { readFileAsJSON } from '~/providers/file-provider';
|
|
38
38
|
import SessionCacheProvider from '../providers/SessionCacheProvider';
|
|
39
39
|
import CredentialProvider from '~/providers/CredentialProvider';
|
|
40
40
|
|
|
41
|
-
import {
|
|
41
|
+
import { url } from '~/util';
|
|
42
42
|
import { sanitiseIds } from '~/util/api-ids';
|
|
43
43
|
import {
|
|
44
44
|
isPassword,
|
|
@@ -67,16 +67,6 @@ import { promiseDelay } from '~/util/timers';
|
|
|
67
67
|
import { GetTagsArgs } from 'migratortron/dist/services/TagsMigrationService';
|
|
68
68
|
import { GetTagGroupsArgs } from 'migratortron/dist/services/TagGroupsMigrationService';
|
|
69
69
|
|
|
70
|
-
type ImportDataType =
|
|
71
|
-
| 'entries'
|
|
72
|
-
| 'contentTypes'
|
|
73
|
-
| 'components'
|
|
74
|
-
| 'models'
|
|
75
|
-
| 'nodes'
|
|
76
|
-
| 'tagGroups'
|
|
77
|
-
| 'tags'
|
|
78
|
-
| 'user-input';
|
|
79
|
-
|
|
80
70
|
let insecurePasswordWarningShown = false;
|
|
81
71
|
|
|
82
72
|
class ContensisCli {
|
|
@@ -344,27 +334,21 @@ class ContensisCli {
|
|
|
344
334
|
|
|
345
335
|
ConnectContensisImport = async ({
|
|
346
336
|
commit = false,
|
|
337
|
+
noSource = false,
|
|
347
338
|
fromFile,
|
|
348
|
-
importDataType,
|
|
349
339
|
importData,
|
|
350
|
-
mixedData,
|
|
351
340
|
}: {
|
|
352
341
|
commit?: boolean;
|
|
342
|
+
noSource?: boolean;
|
|
353
343
|
fromFile?: string;
|
|
354
|
-
|
|
355
|
-
importData?: any[];
|
|
356
|
-
mixedData?: {
|
|
357
|
-
[K in ImportDataType]?: any[];
|
|
358
|
-
};
|
|
344
|
+
importData?: MixedFileData;
|
|
359
345
|
}) => {
|
|
360
|
-
const source: 'contensis' | '
|
|
361
|
-
fromFile || importData ||
|
|
362
|
-
|
|
363
|
-
const fileData =
|
|
364
|
-
importData || (fromFile ? (await readFileAsJSON(fromFile)) || [] : []);
|
|
346
|
+
const source: 'contensis' | 'user-input' =
|
|
347
|
+
fromFile || importData || noSource ? 'user-input' : 'contensis';
|
|
365
348
|
|
|
366
|
-
|
|
367
|
-
|
|
349
|
+
const mixedData = fromFile
|
|
350
|
+
? await new MixedFileData().readFile(fromFile)
|
|
351
|
+
: importData;
|
|
368
352
|
|
|
369
353
|
const { contensisOpts, currentEnv, env, log, messages, sourceAlias } = this;
|
|
370
354
|
const environments = this.cache.environments || {};
|
|
@@ -405,7 +389,7 @@ class ContensisCli {
|
|
|
405
389
|
const cachedTargetPassword = targetCredentials?.current?.password;
|
|
406
390
|
|
|
407
391
|
if (cachedSourcePassword && cachedTargetPassword) {
|
|
408
|
-
if (source === '
|
|
392
|
+
if (source === 'user-input') {
|
|
409
393
|
this.contensis = new ContensisMigrationService(
|
|
410
394
|
{
|
|
411
395
|
concurrency: 2,
|
|
@@ -420,7 +404,6 @@ class ContensisCli {
|
|
|
420
404
|
targetProjects: [env.currentProject || ''],
|
|
421
405
|
assetHostname: this.urls?.previewWeb,
|
|
422
406
|
},
|
|
423
|
-
...(importDataType ? { [importDataType]: fileData } : {}),
|
|
424
407
|
...(mixedData || {}),
|
|
425
408
|
},
|
|
426
409
|
!commit
|
|
@@ -1175,14 +1158,17 @@ class ContensisCli {
|
|
|
1175
1158
|
}) => {
|
|
1176
1159
|
const { currentEnv, currentProject, log, messages } = this;
|
|
1177
1160
|
|
|
1161
|
+
let importData;
|
|
1162
|
+
if (tags) {
|
|
1163
|
+
importData = new MixedFileData();
|
|
1164
|
+
importData.tags = tags;
|
|
1165
|
+
importData.tagGroups = data || [];
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1178
1168
|
const contensis = await this.ConnectContensisImport({
|
|
1179
1169
|
commit,
|
|
1180
1170
|
fromFile,
|
|
1181
|
-
|
|
1182
|
-
mixedData: {
|
|
1183
|
-
tagGroups: data,
|
|
1184
|
-
tags: tags,
|
|
1185
|
-
},
|
|
1171
|
+
importData,
|
|
1186
1172
|
});
|
|
1187
1173
|
|
|
1188
1174
|
if (contensis) {
|
|
@@ -1304,10 +1290,7 @@ class ContensisCli {
|
|
|
1304
1290
|
});
|
|
1305
1291
|
|
|
1306
1292
|
if (Array.isArray(result)) {
|
|
1307
|
-
|
|
1308
|
-
const groups: ICreateTagGroup[] = [];
|
|
1309
|
-
if (withDependents) splitTagsAndGroups(result, tags, groups);
|
|
1310
|
-
else tags = result;
|
|
1293
|
+
const { tags, tagGroups } = new MixedFileData(result);
|
|
1311
1294
|
|
|
1312
1295
|
log.success(messages.tags.list(currentEnv, tags.length));
|
|
1313
1296
|
|
|
@@ -1318,11 +1301,13 @@ class ContensisCli {
|
|
|
1318
1301
|
log.raw('');
|
|
1319
1302
|
log.object(tag);
|
|
1320
1303
|
}
|
|
1321
|
-
if (
|
|
1304
|
+
if (tagGroups.length) {
|
|
1322
1305
|
log.raw('');
|
|
1323
|
-
log.success(
|
|
1306
|
+
log.success(
|
|
1307
|
+
messages.taggroups.list(currentEnv, tagGroups.length)
|
|
1308
|
+
);
|
|
1324
1309
|
|
|
1325
|
-
for (const group of
|
|
1310
|
+
for (const group of tagGroups) {
|
|
1326
1311
|
log.raw('');
|
|
1327
1312
|
log.object(group);
|
|
1328
1313
|
}
|
|
@@ -1346,25 +1331,22 @@ class ContensisCli {
|
|
|
1346
1331
|
});
|
|
1347
1332
|
|
|
1348
1333
|
if (Array.isArray(result)) {
|
|
1349
|
-
|
|
1350
|
-
const groups: TagGroup[] = [];
|
|
1351
|
-
if (withDependents) splitTagsAndGroups(result, tags, groups);
|
|
1352
|
-
else tags = result;
|
|
1334
|
+
const { tags, tagGroups } = new MixedFileData(result);
|
|
1353
1335
|
log.success(messages.tags.list(currentEnv, tags.length));
|
|
1354
1336
|
|
|
1355
1337
|
if (!tags.length) log.help(messages.tags.noneExist());
|
|
1356
1338
|
|
|
1357
1339
|
await this.HandleFormattingAndOutput(result, () => {
|
|
1358
1340
|
// print the tags to console
|
|
1359
|
-
for (const { version, ...tag } of tags) {
|
|
1341
|
+
for (const { version, ...tag } of tags as Tag[]) {
|
|
1360
1342
|
log.raw('');
|
|
1361
1343
|
log.object(tag);
|
|
1362
1344
|
}
|
|
1363
|
-
if (
|
|
1345
|
+
if (tagGroups.length) {
|
|
1364
1346
|
log.raw('');
|
|
1365
|
-
log.success(messages.taggroups.list(currentEnv,
|
|
1347
|
+
log.success(messages.taggroups.list(currentEnv, tagGroups.length));
|
|
1366
1348
|
|
|
1367
|
-
for (const { version, ...group } of
|
|
1349
|
+
for (const { version, ...group } of tagGroups as TagGroup[]) {
|
|
1368
1350
|
log.raw('');
|
|
1369
1351
|
log.object(group);
|
|
1370
1352
|
}
|
|
@@ -1391,30 +1373,23 @@ class ContensisCli {
|
|
|
1391
1373
|
}) => {
|
|
1392
1374
|
const { currentEnv, currentProject, log, messages } = this;
|
|
1393
1375
|
|
|
1394
|
-
|
|
1395
|
-
tags: ICreateTag[];
|
|
1396
|
-
tagGroups: ICreateTagGroup[];
|
|
1397
|
-
} = { tags: [], tagGroups: [] };
|
|
1376
|
+
let importData;
|
|
1398
1377
|
|
|
1399
1378
|
if (data) {
|
|
1400
|
-
|
|
1401
|
-
|
|
1379
|
+
importData = new MixedFileData();
|
|
1380
|
+
importData.tags = data;
|
|
1381
|
+
importData.tagGroups = [...new Set(data.map(t => t.groupId))].map(
|
|
1402
1382
|
id =>
|
|
1403
1383
|
({
|
|
1404
1384
|
id,
|
|
1405
1385
|
}) as ICreateTagGroup
|
|
1406
1386
|
);
|
|
1407
1387
|
}
|
|
1408
|
-
if (fromFile) {
|
|
1409
|
-
// File may contain mix of tags and tag groups, separate those here
|
|
1410
|
-
const fileData = fromFile ? (await readFileAsJSON(fromFile)) || [] : [];
|
|
1411
|
-
splitTagsAndGroups(fileData, mixedData.tags, mixedData.tagGroups);
|
|
1412
|
-
}
|
|
1413
1388
|
|
|
1414
1389
|
const contensis = await this.ConnectContensisImport({
|
|
1415
1390
|
commit,
|
|
1416
|
-
|
|
1417
|
-
|
|
1391
|
+
fromFile,
|
|
1392
|
+
importData,
|
|
1418
1393
|
});
|
|
1419
1394
|
|
|
1420
1395
|
if (contensis) {
|
|
@@ -1492,7 +1467,7 @@ class ContensisCli {
|
|
|
1492
1467
|
this.contensisOpts.concurrency = 1;
|
|
1493
1468
|
const contensis = await this.ConnectContensisImport({
|
|
1494
1469
|
commit,
|
|
1495
|
-
|
|
1470
|
+
noSource: true,
|
|
1496
1471
|
});
|
|
1497
1472
|
if (contensis) {
|
|
1498
1473
|
log.line();
|
|
@@ -1839,25 +1814,9 @@ class ContensisCli {
|
|
|
1839
1814
|
}) => {
|
|
1840
1815
|
const { currentProject, log, messages } = this;
|
|
1841
1816
|
|
|
1842
|
-
const mixedData: {
|
|
1843
|
-
models: (ContentType | Component)[];
|
|
1844
|
-
tagGroups: ICreateTagGroup[];
|
|
1845
|
-
} = { models: [], tagGroups: [] };
|
|
1846
|
-
|
|
1847
|
-
if (fromFile) {
|
|
1848
|
-
// File may contain mix of content types, components and tag groups, separate those here
|
|
1849
|
-
const fileData = fromFile ? (await readFileAsJSON(fromFile)) || [] : [];
|
|
1850
|
-
splitTagGroupsInModels(fileData, mixedData.models, mixedData.tagGroups);
|
|
1851
|
-
}
|
|
1852
|
-
// const fileData = fromFile
|
|
1853
|
-
// ? (await readFileAsJSON<(ContentType | Component | TagGroup)[]>(fromFile)) || []
|
|
1854
|
-
// : [];
|
|
1855
|
-
// if (typeof fileData === 'string')
|
|
1856
|
-
// throw new Error(`Import file format must be of type JSON`);
|
|
1857
|
-
|
|
1858
1817
|
const contensis = await this.ConnectContensisImport({
|
|
1859
1818
|
commit,
|
|
1860
|
-
|
|
1819
|
+
fromFile,
|
|
1861
1820
|
});
|
|
1862
1821
|
|
|
1863
1822
|
if (contensis) {
|
|
@@ -2013,7 +1972,7 @@ class ContensisCli {
|
|
|
2013
1972
|
const { currentProject, log, messages } = this;
|
|
2014
1973
|
const contensis = await this.ConnectContensisImport({
|
|
2015
1974
|
commit,
|
|
2016
|
-
|
|
1975
|
+
noSource: true,
|
|
2017
1976
|
});
|
|
2018
1977
|
if (contensis) {
|
|
2019
1978
|
const [err, result] = await contensis.DeleteContentTypes(contentTypeIds);
|
|
@@ -2036,6 +1995,7 @@ class ContensisCli {
|
|
|
2036
1995
|
);
|
|
2037
1996
|
// print the results to console
|
|
2038
1997
|
await this.HandleFormattingAndOutput(result, log.object);
|
|
1998
|
+
if (!commit) log.help(messages.migrate.commitTip());
|
|
2039
1999
|
}
|
|
2040
2000
|
}
|
|
2041
2001
|
};
|
|
@@ -2052,23 +2012,18 @@ class ContensisCli {
|
|
|
2052
2012
|
) => {
|
|
2053
2013
|
const { currentProject, log, messages } = this;
|
|
2054
2014
|
|
|
2055
|
-
let
|
|
2056
|
-
|
|
2057
|
-
: [];
|
|
2058
|
-
if (typeof fileData === 'string')
|
|
2059
|
-
throw new Error(`Import file format must be of type JSON`);
|
|
2060
|
-
|
|
2061
|
-
if (!Array.isArray(fileData)) fileData = [fileData];
|
|
2015
|
+
let importData;
|
|
2016
|
+
if (fromFile) importData = await new MixedFileData().readFile(fromFile);
|
|
2062
2017
|
|
|
2063
2018
|
const contensis = await this.ConnectContensisImport({
|
|
2064
2019
|
commit,
|
|
2065
|
-
|
|
2020
|
+
noSource: !!fromFile,
|
|
2066
2021
|
});
|
|
2067
2022
|
|
|
2068
2023
|
if (contensis) {
|
|
2069
2024
|
if (fromFile)
|
|
2070
2025
|
// Pass each content type to the target repo
|
|
2071
|
-
for (const contentType of
|
|
2026
|
+
for (const contentType of importData.models) {
|
|
2072
2027
|
// Fix invalid data
|
|
2073
2028
|
contentType.projectId = currentProject;
|
|
2074
2029
|
delete contentType.uuid;
|
|
@@ -2097,6 +2052,7 @@ class ContensisCli {
|
|
|
2097
2052
|
);
|
|
2098
2053
|
await this.HandleFormattingAndOutput(result, log.object);
|
|
2099
2054
|
}
|
|
2055
|
+
if (!commit) log.help(messages.migrate.commitTip());
|
|
2100
2056
|
}
|
|
2101
2057
|
};
|
|
2102
2058
|
|
|
@@ -2110,22 +2066,16 @@ class ContensisCli {
|
|
|
2110
2066
|
) => {
|
|
2111
2067
|
const { log } = this;
|
|
2112
2068
|
|
|
2113
|
-
let
|
|
2114
|
-
|
|
2115
|
-
: [];
|
|
2116
|
-
if (typeof fileData === 'string')
|
|
2117
|
-
throw new Error(`Import file format must be of type JSON`);
|
|
2118
|
-
|
|
2119
|
-
if (!Array.isArray(fileData)) fileData = [fileData];
|
|
2069
|
+
let importData;
|
|
2070
|
+
if (fromFile) importData = await new MixedFileData().readFile(fromFile);
|
|
2120
2071
|
|
|
2121
|
-
const contensis = await this.ConnectContensisImport({
|
|
2122
|
-
fromFile,
|
|
2123
|
-
importDataType: 'models',
|
|
2124
|
-
});
|
|
2072
|
+
const contensis = await this.ConnectContensisImport({ fromFile });
|
|
2125
2073
|
|
|
2126
2074
|
if (contensis) {
|
|
2127
2075
|
const [err, result] = (await to(
|
|
2128
|
-
contensis.models.Diff(
|
|
2076
|
+
contensis.models.Diff(
|
|
2077
|
+
importData.models.length ? importData.models : modelIds
|
|
2078
|
+
)
|
|
2129
2079
|
)) as [Error | null, ContentTypesResult | undefined];
|
|
2130
2080
|
|
|
2131
2081
|
if (err) log.error(err.message, err);
|
|
@@ -2199,10 +2149,12 @@ class ContensisCli {
|
|
|
2199
2149
|
|
|
2200
2150
|
RemoveComponents = async (componentIds: string[], commit = false) => {
|
|
2201
2151
|
const { currentProject, log, messages } = this;
|
|
2152
|
+
|
|
2202
2153
|
const contensis = await this.ConnectContensisImport({
|
|
2203
2154
|
commit,
|
|
2204
|
-
|
|
2155
|
+
noSource: true,
|
|
2205
2156
|
});
|
|
2157
|
+
|
|
2206
2158
|
if (contensis) {
|
|
2207
2159
|
const [err, result] = await contensis.DeleteContentTypes(
|
|
2208
2160
|
undefined,
|
|
@@ -2227,6 +2179,8 @@ class ContensisCli {
|
|
|
2227
2179
|
);
|
|
2228
2180
|
// print the results to console
|
|
2229
2181
|
await this.HandleFormattingAndOutput(result, log.object);
|
|
2182
|
+
|
|
2183
|
+
if (!commit) log.help(messages.migrate.commitTip());
|
|
2230
2184
|
}
|
|
2231
2185
|
}
|
|
2232
2186
|
};
|
|
@@ -2243,23 +2197,18 @@ class ContensisCli {
|
|
|
2243
2197
|
) => {
|
|
2244
2198
|
const { currentProject, log, messages } = this;
|
|
2245
2199
|
|
|
2246
|
-
let
|
|
2247
|
-
|
|
2248
|
-
: [];
|
|
2249
|
-
if (typeof fileData === 'string')
|
|
2250
|
-
throw new Error(`Import file format must be of type JSON`);
|
|
2251
|
-
|
|
2252
|
-
if (!Array.isArray(fileData)) fileData = [fileData];
|
|
2200
|
+
let importData;
|
|
2201
|
+
if (fromFile) importData = await new MixedFileData().readFile(fromFile);
|
|
2253
2202
|
|
|
2254
2203
|
const contensis = await this.ConnectContensisImport({
|
|
2255
2204
|
commit,
|
|
2256
|
-
|
|
2205
|
+
noSource: !!fromFile,
|
|
2257
2206
|
});
|
|
2258
2207
|
|
|
2259
2208
|
if (contensis) {
|
|
2260
2209
|
// Pass each component to the target repo
|
|
2261
2210
|
if (fromFile)
|
|
2262
|
-
for (const component of
|
|
2211
|
+
for (const component of importData.models) {
|
|
2263
2212
|
// Fix invalid data
|
|
2264
2213
|
component.projectId = currentProject;
|
|
2265
2214
|
delete component.uuid;
|
|
@@ -2288,6 +2237,7 @@ class ContensisCli {
|
|
|
2288
2237
|
);
|
|
2289
2238
|
await this.HandleFormattingAndOutput(result, log.object);
|
|
2290
2239
|
}
|
|
2240
|
+
if (!commit) log.help(messages.migrate.commitTip());
|
|
2291
2241
|
}
|
|
2292
2242
|
};
|
|
2293
2243
|
|
|
@@ -2297,7 +2247,7 @@ class ContensisCli {
|
|
|
2297
2247
|
this.contensisOpts.concurrency = 1;
|
|
2298
2248
|
const contensis = await this.ConnectContensisImport({
|
|
2299
2249
|
commit,
|
|
2300
|
-
|
|
2250
|
+
noSource: true,
|
|
2301
2251
|
});
|
|
2302
2252
|
|
|
2303
2253
|
if (contensis) {
|
|
@@ -2387,11 +2337,13 @@ class ContensisCli {
|
|
|
2387
2337
|
}) => {
|
|
2388
2338
|
const { currentEnv, currentProject, log, messages } = this;
|
|
2389
2339
|
|
|
2340
|
+
let importData;
|
|
2341
|
+
if (data) importData = new MixedFileData(data);
|
|
2342
|
+
|
|
2390
2343
|
const contensis = await this.ConnectContensisImport({
|
|
2391
2344
|
commit,
|
|
2392
2345
|
fromFile,
|
|
2393
|
-
|
|
2394
|
-
importData: data,
|
|
2346
|
+
importData,
|
|
2395
2347
|
});
|
|
2396
2348
|
|
|
2397
2349
|
if (contensis) {
|
|
@@ -2505,7 +2457,6 @@ class ContensisCli {
|
|
|
2505
2457
|
const contensis = await this.ConnectContensisImport({
|
|
2506
2458
|
commit,
|
|
2507
2459
|
fromFile,
|
|
2508
|
-
importDataType: 'entries',
|
|
2509
2460
|
});
|
|
2510
2461
|
|
|
2511
2462
|
if (contensis) {
|
|
@@ -2586,7 +2537,6 @@ class ContensisCli {
|
|
|
2586
2537
|
const contensis = await this.ConnectContensisImport({
|
|
2587
2538
|
commit,
|
|
2588
2539
|
fromFile,
|
|
2589
|
-
importDataType: 'entries',
|
|
2590
2540
|
});
|
|
2591
2541
|
|
|
2592
2542
|
if (contensis) {
|
|
@@ -2693,7 +2643,6 @@ class ContensisCli {
|
|
|
2693
2643
|
const contensis = await this.ConnectContensisImport({
|
|
2694
2644
|
commit,
|
|
2695
2645
|
fromFile,
|
|
2696
|
-
importDataType: 'nodes',
|
|
2697
2646
|
});
|
|
2698
2647
|
|
|
2699
2648
|
if (contensis) {
|
|
@@ -2768,7 +2717,7 @@ class ContensisCli {
|
|
|
2768
2717
|
const { currentEnv, currentProject, log, messages } = this;
|
|
2769
2718
|
const contensis = await this.ConnectContensisImport({
|
|
2770
2719
|
commit,
|
|
2771
|
-
|
|
2720
|
+
noSource: true,
|
|
2772
2721
|
});
|
|
2773
2722
|
|
|
2774
2723
|
if (contensis) {
|
package/src/util/index.ts
CHANGED
|
@@ -41,29 +41,3 @@ export const Logging = async (language = 'en-GB') => {
|
|
|
41
41
|
Log: Logger,
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
export const splitTagsAndGroups = (
|
|
46
|
-
tagsAndGroups: unknown[] = [],
|
|
47
|
-
tags: ICreateTag[] = [],
|
|
48
|
-
groups: ICreateTagGroup[] = []
|
|
49
|
-
) => {
|
|
50
|
-
for (const item of tagsAndGroups) {
|
|
51
|
-
if (isObject(item) && 'id' in item) {
|
|
52
|
-
if ('name' in item) groups.push(item as ICreateTagGroup);
|
|
53
|
-
else tags.push(item as ICreateTag);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const splitTagGroupsInModels = (
|
|
59
|
-
mixedData: unknown[] = [],
|
|
60
|
-
models: (ContentType | Component)[] = [],
|
|
61
|
-
groups: ICreateTagGroup[] = []
|
|
62
|
-
) => {
|
|
63
|
-
for (const item of mixedData) {
|
|
64
|
-
if (isObject(item) && 'id' in item) {
|
|
65
|
-
if (!('dataFormat' in item)) groups.push(item as ICreateTagGroup);
|
|
66
|
-
else models.push(item as ContentType | Component);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "1.5.1-beta.
|
|
1
|
+
export const LIB_VERSION = "1.5.1-beta.8";
|