@payloadcms/db-postgres 0.1.0-beta.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/connect.js +82 -0
- package/dist/create.js +32 -0
- package/dist/createGlobal.js +32 -0
- package/dist/createGlobalVersion.js +48 -0
- package/dist/createMigration.js +85 -0
- package/dist/createVersion.js +54 -0
- package/dist/deleteMany.js +44 -0
- package/dist/deleteOne.js +47 -0
- package/dist/deleteVersions.js +46 -0
- package/dist/destroy.js +16 -0
- package/dist/find/buildFindManyArgs.js +61 -0
- package/dist/find/chainMethods.js +21 -0
- package/dist/find/findMany.js +197 -0
- package/dist/find/traverseFields.js +118 -0
- package/dist/find.js +35 -0
- package/dist/findGlobal.js +38 -0
- package/dist/findGlobalVersions.js +39 -0
- package/dist/findOne.js +49 -0
- package/dist/findVersions.js +39 -0
- package/dist/index.js +95 -0
- package/dist/init.js +74 -0
- package/dist/migrate.js +81 -0
- package/dist/migrateStatus.js +54 -0
- package/dist/mock.js +13 -0
- package/dist/queries/buildAndOrConditions.js +39 -0
- package/dist/queries/buildQuery.js +80 -0
- package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js +24 -0
- package/dist/queries/createJSONQuery/formatJSONPathSegment.js +15 -0
- package/dist/queries/createJSONQuery/index.js +64 -0
- package/dist/queries/getTableColumnFromPath.js +333 -0
- package/dist/queries/operatorMap.js +34 -0
- package/dist/queries/parseParams.js +146 -0
- package/dist/queries/sanitizeQueryValue.js +79 -0
- package/dist/queryDrafts.js +56 -0
- package/dist/reference.js +76 -0
- package/dist/schema/build.js +245 -0
- package/dist/schema/createIndex.js +19 -0
- package/dist/schema/parentIDColumnMap.js +18 -0
- package/dist/schema/traverseFields.js +430 -0
- package/dist/schema/validateExistingBlockIsIdentical.js +34 -0
- package/dist/transactions/beginTransaction.js +51 -0
- package/dist/transactions/commitTransaction.js +24 -0
- package/dist/transactions/rollbackTransaction.js +20 -0
- package/dist/transform/read/hasManyNumber.js +20 -0
- package/dist/transform/read/index.js +42 -0
- package/dist/transform/read/relationship.js +74 -0
- package/dist/transform/read/traverseFields.js +325 -0
- package/dist/transform/write/array.js +55 -0
- package/dist/transform/write/blocks.js +56 -0
- package/dist/transform/write/index.js +46 -0
- package/dist/transform/write/numbers.js +21 -0
- package/dist/transform/write/relationships.js +33 -0
- package/dist/transform/write/selects.js +29 -0
- package/dist/transform/write/traverseFields.js +379 -0
- package/dist/transform/write/types.js +6 -0
- package/dist/types.js +6 -0
- package/dist/update.js +48 -0
- package/dist/updateGlobal.js +39 -0
- package/dist/updateGlobalVersion.js +50 -0
- package/dist/updateVersion.js +50 -0
- package/dist/upsertRow/deleteExistingArrayRows.js +20 -0
- package/dist/upsertRow/deleteExistingRowsByPath.js +43 -0
- package/dist/upsertRow/index.js +243 -0
- package/dist/upsertRow/insertArrays.js +64 -0
- package/dist/upsertRow/types.js +6 -0
- package/dist/utilities/appendPrefixToKeys.js +16 -0
- package/dist/utilities/createBlocksMap.js +39 -0
- package/dist/utilities/createMigrationTable.js +23 -0
- package/dist/utilities/createRelationshipMap.js +29 -0
- package/dist/utilities/hasLocalesTable.js +21 -0
- package/dist/utilities/isArrayOfRows.js +15 -0
- package/dist/utilities/migrationTableExists.js +19 -0
- package/dist/webpack.js +30 -0
- package/package.json +47 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
/* eslint-disable no-param-reassign */ "use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "transformBlocks", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return transformBlocks;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
|
12
|
+
const _traverseFields = require("./traverseFields");
|
13
|
+
function _interop_require_default(obj) {
|
14
|
+
return obj && obj.__esModule ? obj : {
|
15
|
+
default: obj
|
16
|
+
};
|
17
|
+
}
|
18
|
+
const transformBlocks = ({ baseTableName, blocks, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects })=>{
|
19
|
+
data.forEach((blockRow, i)=>{
|
20
|
+
if (typeof blockRow.blockType !== 'string') return;
|
21
|
+
const matchedBlock = field.blocks.find(({ slug })=>slug === blockRow.blockType);
|
22
|
+
if (!matchedBlock) return;
|
23
|
+
const blockType = (0, _tosnakecase.default)(blockRow.blockType);
|
24
|
+
if (!blocks[blockType]) blocks[blockType] = [];
|
25
|
+
const newRow = {
|
26
|
+
arrays: {},
|
27
|
+
locales: {},
|
28
|
+
row: {
|
29
|
+
_order: i + 1,
|
30
|
+
_path: `${path}${field.name}`
|
31
|
+
}
|
32
|
+
};
|
33
|
+
if (field.localized && locale) newRow.row._locale = locale;
|
34
|
+
const blockTableName = `${baseTableName}_blocks_${blockType}`;
|
35
|
+
(0, _traverseFields.traverseFields)({
|
36
|
+
arrays: newRow.arrays,
|
37
|
+
baseTableName,
|
38
|
+
blocks,
|
39
|
+
columnPrefix: '',
|
40
|
+
data: blockRow,
|
41
|
+
fieldPrefix: '',
|
42
|
+
fields: matchedBlock.fields,
|
43
|
+
locales: newRow.locales,
|
44
|
+
numbers,
|
45
|
+
parentTableName: blockTableName,
|
46
|
+
path: `${path || ''}${field.name}.${i}.`,
|
47
|
+
relationships,
|
48
|
+
relationshipsToDelete,
|
49
|
+
row: newRow.row,
|
50
|
+
selects
|
51
|
+
});
|
52
|
+
blocks[blockType].push(newRow);
|
53
|
+
});
|
54
|
+
};
|
55
|
+
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90cmFuc2Zvcm0vd3JpdGUvYmxvY2tzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLXBhcmFtLXJlYXNzaWduICovXG5pbXBvcnQgdHlwZSB7IEJsb2NrRmllbGQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgdG9TbmFrZUNhc2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SxHQUFHLEVBQUVILE1BQU1xQixJQUFJLENBQUMsQ0FBQyxFQUFFWixFQUFFLENBQUMsQ0FBQztZQUN4Q0w7WUFDQUM7WUFDQWEsS0FBS0gsT0FBT0csR0FBRztZQUNmWjtRQUNGO1FBRUFSLE1BQU0sQ0FBQ1ksVUFBVSxDQUFDb0IsSUFBSSxDQUFDZjtJQUN6QjtBQUNGIn0=
|
@@ -0,0 +1,46 @@
|
|
1
|
+
/* eslint-disable no-param-reassign */ "use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "transformForWrite", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return transformForWrite;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
const _traverseFields = require("./traverseFields");
|
12
|
+
const transformForWrite = ({ data, fields, path = '', tableName })=>{
|
13
|
+
// Split out the incoming data into rows to insert / delete
|
14
|
+
const rowToInsert = {
|
15
|
+
arrays: {},
|
16
|
+
blocks: {},
|
17
|
+
locales: {},
|
18
|
+
numbers: [],
|
19
|
+
relationships: [],
|
20
|
+
relationshipsToDelete: [],
|
21
|
+
row: {},
|
22
|
+
selects: {}
|
23
|
+
};
|
24
|
+
// This function is responsible for building up the
|
25
|
+
// above rowToInsert
|
26
|
+
(0, _traverseFields.traverseFields)({
|
27
|
+
arrays: rowToInsert.arrays,
|
28
|
+
baseTableName: tableName,
|
29
|
+
blocks: rowToInsert.blocks,
|
30
|
+
columnPrefix: '',
|
31
|
+
data,
|
32
|
+
fieldPrefix: '',
|
33
|
+
fields,
|
34
|
+
locales: rowToInsert.locales,
|
35
|
+
numbers: rowToInsert.numbers,
|
36
|
+
parentTableName: tableName,
|
37
|
+
path,
|
38
|
+
relationships: rowToInsert.relationships,
|
39
|
+
relationshipsToDelete: rowToInsert.relationshipsToDelete,
|
40
|
+
row: rowToInsert.row,
|
41
|
+
selects: rowToInsert.selects
|
42
|
+
});
|
43
|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ibGVOYW1lIl0sIm1hcHBpbmdzIjoiQUFBQSxvQ0FBb0M7Ozs7K0JBY3ZCQTs7O2VBQUFBOzs7Z0NBVGtCO0FBU3hCLE1BQU1BLG9CQUFvQixDQUFDLEVBQUVDLElBQUksRUFBRUMsTUFBTSxFQUFFQyxPQUFPLEVBQUUsRUFBRUMsU0FBUyxFQUFRO0lBQzVFLDJEQUEyRDtJQUMzRCxNQUFNQyxjQUEyQjtRQUMvQkMsUUFBUSxDQUFDO1FBQ1RDLFFBQVEsQ0FBQztRQUNUQyxTQUFTLENBQUM7UUFDVkMsU0FBUyxFQUFFO1FBQ1hDLGVBQWUsRUFBRTtRQUNqQkMsdUJBQXVCLEVBQUU7UUFDekJDLEtBQUssQ0FBQztRQUNOQyxTQUFTLENBQUM7SUFDWjtJQUVBLG1EQUFtRDtJQUNuRCxvQkFBb0I7SUFDcEJDLElBQUFBLDhCQUFjLEVBQUM7UUFDYlIsUUFBUUQsWUFBWUMsTUFBTTtRQUMxQlMsZUFBZVg7UUFDZkcsUUFBUUYsWUFBWUUsTUFBTTtRQUMxQlMsY0FBYztRQUNkZjtRQUNBZ0IsYUFBYTtRQUNiZjtRQUNBTSxTQUFTSCxZQUFZRyxPQUFPO1FBQzVCQyxTQUFTSixZQUFZSSxPQUFPO1FBQzVCUyxpQkFBaUJkO1FBQ2pCRDtRQUNBTyxlQUFlTCxZQUFZSyxhQUFhO1FBQ3hDQyx1QkFBdUJOLFlBQVlNLHFCQUFxQjtRQUN4REMsS0FBS1AsWUFBWU8sR0FBRztRQUNwQkMsU0FBU1IsWUFBWVEsT0FBTztJQUM5QjtJQUVBLE9BQU9SO0FBQ1QifQ==
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "transformNumbers", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return transformNumbers;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
const transformNumbers = ({ baseRow, data, numbers })=>{
|
12
|
+
data.forEach((val, i)=>{
|
13
|
+
numbers.push({
|
14
|
+
...baseRow,
|
15
|
+
number: val,
|
16
|
+
order: i + 1
|
17
|
+
});
|
18
|
+
});
|
19
|
+
};
|
20
|
+
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90cmFuc2Zvcm0vd3JpdGUvbnVtYmVycy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJ0eXBlIEFyZ3MgPSB7XG4gIGJhc2VSb3c6IFJlY29yZDxzdHJpbmcsIHVua25vd24+XG4gIGRhdGE6IHVua25vd25bXVxuICBudW1iZXJzOiBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPltdXG59XG5cbmV4cG9ydCBjb25zdCB0cmFuc2Zvcm1OdW1iZXJzID0gKHsgYmFzZVJvdywgZGF0YSwgbnVtYmVycyB9OiBBcmdzKSA9PiB7XG4gIGRhdGEuZm9yRWFjaCgodmFsLCBpKSA9PiB7XG4gICAgbnVtYmVycy5wdXNoKHtcbiAgICAgIC4uLmJhc2VSb3csXG4gICAgICBudW1iZXI6IHZhbCxcbiAgICAgIG9yZGVyOiBpICsgMSxcbiAgICB9KVxuICB9KVxufVxuIl0sIm5hbWVzIjpbInRyYW5zZm9ybU51bWJlcnMiLCJiYXNlUm93IiwiZGF0YSIsIm51bWJlcnMiLCJmb3JFYWNoIiwidmFsIiwiaSIsInB1c2giLCJudW1iZXIiLCJvcmRlciJdLCJtYXBwaW5ncyI6Ijs7OzsrQkFNYUE7OztlQUFBQTs7O0FBQU4sTUFBTUEsbUJBQW1CLENBQUMsRUFBRUMsT0FBTyxFQUFFQyxJQUFJLEVBQUVDLE9BQU8sRUFBUTtJQUMvREQsS0FBS0UsT0FBTyxDQUFDLENBQUNDLEtBQUtDO1FBQ2pCSCxRQUFRSSxJQUFJLENBQUM7WUFDWCxHQUFHTixPQUFPO1lBQ1ZPLFFBQVFIO1lBQ1JJLE9BQU9ILElBQUk7UUFDYjtJQUNGO0FBQ0YifQ==
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "transformRelationship", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return transformRelationship;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
const _types = require("payload/types");
|
12
|
+
const transformRelationship = ({ baseRow, data, field, relationships })=>{
|
13
|
+
const relations = Array.isArray(data) ? data : [
|
14
|
+
data
|
15
|
+
];
|
16
|
+
relations.forEach((relation, i)=>{
|
17
|
+
if (relation) {
|
18
|
+
const relationRow = {
|
19
|
+
...baseRow
|
20
|
+
};
|
21
|
+
if ('hasMany' in field && field.hasMany) relationRow.order = i + 1;
|
22
|
+
if (Array.isArray(field.relationTo) && (0, _types.valueIsValueWithRelation)(relation)) {
|
23
|
+
relationRow[`${relation.relationTo}ID`] = relation.value;
|
24
|
+
relationships.push(relationRow);
|
25
|
+
} else {
|
26
|
+
relationRow[`${field.relationTo}ID`] = relation;
|
27
|
+
if (relation) relationships.push(relationRow);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
});
|
31
|
+
};
|
32
|
+
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90cmFuc2Zvcm0vd3JpdGUvcmVsYXRpb25zaGlwcy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IFJlbGF0aW9uc2hpcEZpZWxkLCBVcGxvYWRGaWVsZCB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB7IHZhbHVlSXNWYWx1ZVdpdGhSZWxhdGlvbiB9IGZyb20gJ3BheWxvYWQvdHlwZXMn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MsR0FBR0w7Z0JBQ3ZDLElBQUlBLFVBQVVMLGNBQWNhLElBQUksQ0FBQ047WUFDbkM7UUFDRjtJQUNGO0FBQ0YifQ==
|
@@ -0,0 +1,29 @@
|
|
1
|
+
/* eslint-disable no-param-reassign */ "use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "transformSelects", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return transformSelects;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
const _isArrayOfRows = require("../../utilities/isArrayOfRows");
|
12
|
+
const transformSelects = ({ data, locale })=>{
|
13
|
+
const newRows = [];
|
14
|
+
if ((0, _isArrayOfRows.isArrayOfRows)(data)) {
|
15
|
+
data.forEach((value, i)=>{
|
16
|
+
const newRow = {
|
17
|
+
order: i + 1,
|
18
|
+
value
|
19
|
+
};
|
20
|
+
if (locale) {
|
21
|
+
newRow.locale = locale;
|
22
|
+
}
|
23
|
+
newRows.push(newRow);
|
24
|
+
});
|
25
|
+
}
|
26
|
+
return newRows;
|
27
|
+
};
|
28
|
+
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90cmFuc2Zvcm0vd3JpdGUvc2VsZWN0cy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBuby1wYXJhbS1yZWFzc2lnbiAqL1xuaW1wb3J0IHsgaXNBcnJheU9mUm93cyB9IGZyb20gJy4uLy4uL3V0aWxpdGllcy9pc0FycmF5T2ZSb3dzJ1xuXG50eXBlIEFyZ3MgPSB7XG4gIGRhdGE6IHVua25vd25cbiAgbG9jYWxlPzogc3RyaW5nXG59XG5cbmV4cG9ydCBjb25zdCB0cmFuc2Zvcm1TZWxlY3RzID0gKHsgZGF0YSwgbG9jYWxlIH06IEFyZ3MpID0+IHtcbiAg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9
|
@@ -0,0 +1,379 @@
|
|
1
|
+
/* eslint-disable no-param-reassign */ "use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "traverseFields", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return traverseFields;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
const _types = require("payload/types");
|
12
|
+
const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
|
13
|
+
const _isArrayOfRows = require("../../utilities/isArrayOfRows");
|
14
|
+
const _array = require("./array");
|
15
|
+
const _blocks = require("./blocks");
|
16
|
+
const _numbers = require("./numbers");
|
17
|
+
const _relationships = require("./relationships");
|
18
|
+
const _selects = require("./selects");
|
19
|
+
function _interop_require_default(obj) {
|
20
|
+
return obj && obj.__esModule ? obj : {
|
21
|
+
default: obj
|
22
|
+
};
|
23
|
+
}
|
24
|
+
const traverseFields = ({ arrays, baseTableName, blocks, columnPrefix, data, existingLocales, fieldPrefix, fields, forcedLocale, locales, numbers, parentTableName, path, relationships, relationshipsToDelete, row, selects })=>{
|
25
|
+
fields.forEach((field)=>{
|
26
|
+
let columnName = '';
|
27
|
+
let fieldName = '';
|
28
|
+
let fieldData;
|
29
|
+
if ((0, _types.fieldAffectsData)(field)) {
|
30
|
+
columnName = `${columnPrefix || ''}${(0, _tosnakecase.default)(field.name)}`;
|
31
|
+
fieldName = `${fieldPrefix || ''}${field.name}`;
|
32
|
+
fieldData = data[field.name];
|
33
|
+
}
|
34
|
+
if (field.type === 'array') {
|
35
|
+
const arrayTableName = `${parentTableName}_${columnName}`;
|
36
|
+
if (!arrays[arrayTableName]) arrays[arrayTableName] = [];
|
37
|
+
if (field.localized) {
|
38
|
+
if (typeof data[field.name] === 'object' && data[field.name] !== null) {
|
39
|
+
Object.entries(data[field.name]).forEach(([localeKey, localeData])=>{
|
40
|
+
if (Array.isArray(localeData)) {
|
41
|
+
const newRows = (0, _array.transformArray)({
|
42
|
+
arrayTableName,
|
43
|
+
baseTableName,
|
44
|
+
blocks,
|
45
|
+
data: localeData,
|
46
|
+
field,
|
47
|
+
locale: localeKey,
|
48
|
+
numbers,
|
49
|
+
path,
|
50
|
+
relationships,
|
51
|
+
relationshipsToDelete,
|
52
|
+
selects
|
53
|
+
});
|
54
|
+
arrays[arrayTableName] = arrays[arrayTableName].concat(newRows);
|
55
|
+
}
|
56
|
+
});
|
57
|
+
}
|
58
|
+
} else {
|
59
|
+
const newRows = (0, _array.transformArray)({
|
60
|
+
arrayTableName,
|
61
|
+
baseTableName,
|
62
|
+
blocks,
|
63
|
+
data: data[field.name],
|
64
|
+
field,
|
65
|
+
numbers,
|
66
|
+
path,
|
67
|
+
relationships,
|
68
|
+
relationshipsToDelete,
|
69
|
+
selects
|
70
|
+
});
|
71
|
+
arrays[arrayTableName] = arrays[arrayTableName].concat(newRows);
|
72
|
+
}
|
73
|
+
return;
|
74
|
+
}
|
75
|
+
if (field.type === 'blocks') {
|
76
|
+
if (field.localized) {
|
77
|
+
if (typeof data[field.name] === 'object' && data[field.name] !== null) {
|
78
|
+
Object.entries(data[field.name]).forEach(([localeKey, localeData])=>{
|
79
|
+
if (Array.isArray(localeData)) {
|
80
|
+
(0, _blocks.transformBlocks)({
|
81
|
+
baseTableName,
|
82
|
+
blocks,
|
83
|
+
data: localeData,
|
84
|
+
field,
|
85
|
+
locale: localeKey,
|
86
|
+
numbers,
|
87
|
+
path,
|
88
|
+
relationships,
|
89
|
+
relationshipsToDelete,
|
90
|
+
selects
|
91
|
+
});
|
92
|
+
}
|
93
|
+
});
|
94
|
+
}
|
95
|
+
} else if ((0, _isArrayOfRows.isArrayOfRows)(fieldData)) {
|
96
|
+
(0, _blocks.transformBlocks)({
|
97
|
+
baseTableName,
|
98
|
+
blocks,
|
99
|
+
data: fieldData,
|
100
|
+
field,
|
101
|
+
numbers,
|
102
|
+
path,
|
103
|
+
relationships,
|
104
|
+
relationshipsToDelete,
|
105
|
+
selects
|
106
|
+
});
|
107
|
+
}
|
108
|
+
return;
|
109
|
+
}
|
110
|
+
if (field.type === 'group') {
|
111
|
+
if (typeof data[field.name] === 'object' && data[field.name] !== null) {
|
112
|
+
if (field.localized) {
|
113
|
+
Object.entries(data[field.name]).forEach(([localeKey, localeData])=>{
|
114
|
+
traverseFields({
|
115
|
+
arrays,
|
116
|
+
baseTableName,
|
117
|
+
blocks,
|
118
|
+
columnPrefix: `${columnName}_`,
|
119
|
+
data: localeData,
|
120
|
+
existingLocales,
|
121
|
+
fieldPrefix: `${fieldName}_`,
|
122
|
+
fields: field.fields,
|
123
|
+
forcedLocale: localeKey,
|
124
|
+
locales,
|
125
|
+
numbers,
|
126
|
+
parentTableName,
|
127
|
+
path: `${path || ''}${field.name}.`,
|
128
|
+
relationships,
|
129
|
+
relationshipsToDelete,
|
130
|
+
row,
|
131
|
+
selects
|
132
|
+
});
|
133
|
+
});
|
134
|
+
} else {
|
135
|
+
traverseFields({
|
136
|
+
arrays,
|
137
|
+
baseTableName,
|
138
|
+
blocks,
|
139
|
+
columnPrefix: `${columnName}_`,
|
140
|
+
data: data[field.name],
|
141
|
+
existingLocales,
|
142
|
+
fieldPrefix: `${fieldName}_`,
|
143
|
+
fields: field.fields,
|
144
|
+
locales,
|
145
|
+
numbers,
|
146
|
+
parentTableName,
|
147
|
+
path: `${path || ''}${field.name}.`,
|
148
|
+
relationships,
|
149
|
+
relationshipsToDelete,
|
150
|
+
row,
|
151
|
+
selects
|
152
|
+
});
|
153
|
+
}
|
154
|
+
}
|
155
|
+
return;
|
156
|
+
}
|
157
|
+
if (field.type === 'tabs') {
|
158
|
+
field.tabs.forEach((tab)=>{
|
159
|
+
if ('name' in tab) {
|
160
|
+
if (typeof data[tab.name] === 'object' && data[tab.name] !== null) {
|
161
|
+
if (tab.localized) {
|
162
|
+
Object.entries(data[tab.name]).forEach(([localeKey, localeData])=>{
|
163
|
+
traverseFields({
|
164
|
+
arrays,
|
165
|
+
baseTableName,
|
166
|
+
blocks,
|
167
|
+
columnPrefix: `${columnPrefix || ''}${(0, _tosnakecase.default)(tab.name)}_`,
|
168
|
+
data: localeData,
|
169
|
+
existingLocales,
|
170
|
+
fieldPrefix: `${fieldPrefix || ''}${tab.name}_`,
|
171
|
+
fields: tab.fields,
|
172
|
+
forcedLocale: localeKey,
|
173
|
+
locales,
|
174
|
+
numbers,
|
175
|
+
parentTableName,
|
176
|
+
path: `${path || ''}${tab.name}.`,
|
177
|
+
relationships,
|
178
|
+
relationshipsToDelete,
|
179
|
+
row,
|
180
|
+
selects
|
181
|
+
});
|
182
|
+
});
|
183
|
+
} else {
|
184
|
+
traverseFields({
|
185
|
+
arrays,
|
186
|
+
baseTableName,
|
187
|
+
blocks,
|
188
|
+
columnPrefix: `${columnPrefix || ''}${(0, _tosnakecase.default)(tab.name)}_`,
|
189
|
+
data: data[tab.name],
|
190
|
+
existingLocales,
|
191
|
+
fieldPrefix: `${fieldPrefix || ''}${tab.name}_`,
|
192
|
+
fields: tab.fields,
|
193
|
+
locales,
|
194
|
+
numbers,
|
195
|
+
parentTableName,
|
196
|
+
path: `${path || ''}${tab.name}.`,
|
197
|
+
relationships,
|
198
|
+
relationshipsToDelete,
|
199
|
+
row,
|
200
|
+
selects
|
201
|
+
});
|
202
|
+
}
|
203
|
+
}
|
204
|
+
} else {
|
205
|
+
traverseFields({
|
206
|
+
arrays,
|
207
|
+
baseTableName,
|
208
|
+
blocks,
|
209
|
+
columnPrefix,
|
210
|
+
data,
|
211
|
+
existingLocales,
|
212
|
+
fieldPrefix,
|
213
|
+
fields: tab.fields,
|
214
|
+
locales,
|
215
|
+
numbers,
|
216
|
+
parentTableName,
|
217
|
+
path,
|
218
|
+
relationships,
|
219
|
+
relationshipsToDelete,
|
220
|
+
row,
|
221
|
+
selects
|
222
|
+
});
|
223
|
+
}
|
224
|
+
});
|
225
|
+
}
|
226
|
+
if (field.type === 'row' || field.type === 'collapsible') {
|
227
|
+
traverseFields({
|
228
|
+
arrays,
|
229
|
+
baseTableName,
|
230
|
+
blocks,
|
231
|
+
columnPrefix,
|
232
|
+
data,
|
233
|
+
existingLocales,
|
234
|
+
fieldPrefix,
|
235
|
+
fields: field.fields,
|
236
|
+
locales,
|
237
|
+
numbers,
|
238
|
+
parentTableName,
|
239
|
+
path,
|
240
|
+
relationships,
|
241
|
+
relationshipsToDelete,
|
242
|
+
row,
|
243
|
+
selects
|
244
|
+
});
|
245
|
+
}
|
246
|
+
if (field.type === 'relationship' || field.type === 'upload') {
|
247
|
+
const relationshipPath = `${path || ''}${field.name}`;
|
248
|
+
if (field.localized) {
|
249
|
+
if (typeof fieldData === 'object') {
|
250
|
+
Object.entries(fieldData).forEach(([localeKey, localeData])=>{
|
251
|
+
if (localeData === null) {
|
252
|
+
relationshipsToDelete.push({
|
253
|
+
locale: localeKey,
|
254
|
+
path: relationshipPath
|
255
|
+
});
|
256
|
+
return;
|
257
|
+
}
|
258
|
+
(0, _relationships.transformRelationship)({
|
259
|
+
baseRow: {
|
260
|
+
locale: localeKey,
|
261
|
+
path: relationshipPath
|
262
|
+
},
|
263
|
+
data: localeData,
|
264
|
+
field,
|
265
|
+
relationships
|
266
|
+
});
|
267
|
+
});
|
268
|
+
}
|
269
|
+
} else {
|
270
|
+
if (fieldData === null) {
|
271
|
+
relationshipsToDelete.push({
|
272
|
+
path: relationshipPath
|
273
|
+
});
|
274
|
+
return;
|
275
|
+
}
|
276
|
+
(0, _relationships.transformRelationship)({
|
277
|
+
baseRow: {
|
278
|
+
path: relationshipPath
|
279
|
+
},
|
280
|
+
data: fieldData,
|
281
|
+
field,
|
282
|
+
relationships
|
283
|
+
});
|
284
|
+
}
|
285
|
+
return;
|
286
|
+
}
|
287
|
+
if (field.type === 'number' && field.hasMany) {
|
288
|
+
const numberPath = `${path || ''}${field.name}`;
|
289
|
+
if (field.localized) {
|
290
|
+
if (typeof fieldData === 'object') {
|
291
|
+
Object.entries(fieldData).forEach(([localeKey, localeData])=>{
|
292
|
+
if (Array.isArray(localeData)) {
|
293
|
+
(0, _numbers.transformNumbers)({
|
294
|
+
baseRow: {
|
295
|
+
locale: localeKey,
|
296
|
+
path: numberPath
|
297
|
+
},
|
298
|
+
data: localeData,
|
299
|
+
numbers
|
300
|
+
});
|
301
|
+
}
|
302
|
+
});
|
303
|
+
}
|
304
|
+
} else if (Array.isArray(fieldData)) {
|
305
|
+
(0, _numbers.transformNumbers)({
|
306
|
+
baseRow: {
|
307
|
+
path: numberPath
|
308
|
+
},
|
309
|
+
data: fieldData,
|
310
|
+
numbers
|
311
|
+
});
|
312
|
+
}
|
313
|
+
return;
|
314
|
+
}
|
315
|
+
if (field.type === 'select' && field.hasMany) {
|
316
|
+
const selectTableName = `${parentTableName}_${columnName}`;
|
317
|
+
if (!selects[selectTableName]) selects[selectTableName] = [];
|
318
|
+
if (field.localized) {
|
319
|
+
if (typeof data[field.name] === 'object' && data[field.name] !== null) {
|
320
|
+
Object.entries(data[field.name]).forEach(([localeKey, localeData])=>{
|
321
|
+
if (Array.isArray(localeData)) {
|
322
|
+
const newRows = (0, _selects.transformSelects)({
|
323
|
+
data: localeData,
|
324
|
+
locale: localeKey
|
325
|
+
});
|
326
|
+
selects[selectTableName] = selects[selectTableName].concat(newRows);
|
327
|
+
}
|
328
|
+
});
|
329
|
+
}
|
330
|
+
} else if (Array.isArray(data[field.name])) {
|
331
|
+
const newRows = (0, _selects.transformSelects)({
|
332
|
+
data: data[field.name]
|
333
|
+
});
|
334
|
+
selects[selectTableName] = selects[selectTableName].concat(newRows);
|
335
|
+
}
|
336
|
+
return;
|
337
|
+
}
|
338
|
+
if ((0, _types.fieldAffectsData)(field)) {
|
339
|
+
const valuesToTransform = [];
|
340
|
+
if (field.localized) {
|
341
|
+
if (typeof fieldData === 'object' && fieldData !== null) {
|
342
|
+
Object.entries(fieldData).forEach(([localeKey, localeData])=>{
|
343
|
+
if (!locales[localeKey]) locales[localeKey] = {};
|
344
|
+
valuesToTransform.push({
|
345
|
+
localeKey,
|
346
|
+
ref: locales,
|
347
|
+
value: localeData
|
348
|
+
});
|
349
|
+
});
|
350
|
+
}
|
351
|
+
} else {
|
352
|
+
let ref = row;
|
353
|
+
if (forcedLocale) {
|
354
|
+
if (!locales[forcedLocale]) locales[forcedLocale] = {};
|
355
|
+
ref = locales[forcedLocale];
|
356
|
+
}
|
357
|
+
valuesToTransform.push({
|
358
|
+
ref,
|
359
|
+
value: fieldData
|
360
|
+
});
|
361
|
+
}
|
362
|
+
valuesToTransform.forEach(({ localeKey, ref, value })=>{
|
363
|
+
if (typeof value !== 'undefined') {
|
364
|
+
let formattedValue = value;
|
365
|
+
if (field.type === 'date' && field.name === 'updatedAt') {
|
366
|
+
formattedValue = new Date().toISOString();
|
367
|
+
}
|
368
|
+
if (localeKey) {
|
369
|
+
ref[localeKey][fieldName] = formattedValue;
|
370
|
+
} else {
|
371
|
+
ref[fieldName] = formattedValue;
|
372
|
+
}
|
373
|
+
}
|
374
|
+
});
|
375
|
+
}
|
376
|
+
});
|
377
|
+
};
|
378
|
+
|
379
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90cmFuc2Zvcm0vd3JpdGUvdHJhdmVyc2VGaWVsZHMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcGFyYW0tcmVhc3NpZ24gKi9cbmltcG9ydCB0eXBlIHsgRmllbGQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBmaWVsZEFmZmVjdHNEYXRhIH0gZnJvbSAncGF5bG9hZC90eXBlcydcbmltcG9ydCB0b1NuYWtlQ2FzZSBmcm9tICd0by1zbmFrZS1jYXNlJ1xuXG5pbXBvcnQgdHlwZSB7IEFycmF5Um93VG9JbnNlcnQsIEJsb2NrUm93VG9JbnNlcnQsIFJlbGF0aW9uc2hpcFRvRGVsZXRlIH0gZnJvbSAnLi90eXBlcydcblxuaW1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ICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgIGRhdGE6IGxvY2FsZURhdGEsXG4gICAgICAgICAgICAgICAgZmllbGQsXG4gICAgICAgICAgICAgICAgbG9jYWxlOiBsb2NhbGVLZXksXG4gICAgICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgICAgICBwYXRoLFxuICAgICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwc1RvRGVsZXRlLFxuICAgICAgICAgICAgICAgIHNlbGVjdHMsXG4gICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgYXJyYXlzW2FycmF5VGFibGVOYW1lXSA9IGFycmF5c1thcnJheVRhYmxlTmFtZV0uY29uY2F0KG5ld1Jvd3MpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgY29uc3QgbmV3Um93cyA9IHRyYW5zZm9ybUFycmF5KHtcbiAgICAgICAgICBhcnJheVRhYmxlTmFtZSxcbiAgICAgICAgICBiYXNlVGFibGVOYW1lLFxuICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICBkYXRhOiBkYXRhW2ZpZWxkLm5hbWVdLFxuICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgcGF0aCxcbiAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgIHJlbGF0aW9uc2hpcHNUb0RlbGV0ZSxcbiAgICAgICAgICBzZWxlY3RzLFxuICAgICAgICB9KVxuXG4gICAgICAgIGFycmF5c1thcnJheVRhYmxlTmFtZV0gPSBhcnJheXNbYXJyYXlUYWJsZU5hbWVdLmNvbmNhdChuZXdSb3dzKVxuICAgICAgfVxuXG4gICAgICByZXR1cm5cbiAgICB9XG5cbiAgICBpZiAoZmllbGQudHlwZSA9PT0gJ2Jsb2NrcycpIHtcbiAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBkYXRhW2ZpZWxkLm5hbWVdID09PSAnb2JqZWN0JyAmJiBkYXRhW2ZpZWxkLm5hbWVdICE9PSBudWxsKSB7XG4gICAgICAgICAgT2JqZWN0LmVudHJpZXMoZGF0YVtmaWVsZC5uYW1lXSkuZm9yRWFjaCgoW2xvY2FsZUtleSwgbG9jYWxlRGF0YV0pID0+IHtcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGxvY2FsZURhdGEpKSB7XG4gICAgICAgICAgICAgIHRyYW5zZm9ybUJsb2Nrcyh7XG4gICAgICAgICAgICAgICAgYmFzZVRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgICBibG9ja3MsXG4gICAgICAgICAgICAgICAgZGF0YTogbG9jYWxlRGF0YSxcbiAgICAgICAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICAgICAgICBsb2NhbGU6IGxvY2FsZUtleSxcbiAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgIHBhdGgsXG4gICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzVG9EZWxldGUsXG4gICAgICAgICAgICAgICAgc2VsZWN0cyxcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKGlzQXJyYXlPZlJvd3MoZmllbGREYXRhKSkge1xuICAgICAgICB0cmFuc2Zvcm1CbG9ja3Moe1xuICAgICAgICAgIGJhc2VUYWJsZU5hbWUsXG4gICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgIGRhdGE6IGZpZWxkRGF0YSxcbiAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgIHBhdGgsXG4gICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICByZWxhdGlvbnNoaXBzVG9EZWxldGUsXG4gICAgICAgICAgc2VsZWN0cyxcbiAgICAgICAgfSlcbiAgICAgIH1cblxuICAgICAgcmV0dXJuXG4gICAgfVxuXG4gICAgaWYgKGZpZWxkLnR5cGUgPT09ICdncm91cCcpIHtcbiAgICAgIGlmICh0eXBlb2YgZGF0YVtmaWVsZC5uYW1lXSA9PT0gJ29iamVjdCcgJiYgZGF0YVtmaWVsZC5uYW1lXSAhPT0gbnVsbCkge1xuICAgICAgICBpZiAoZmllbGQubG9jYWxpemVkKSB7XG4gICAgICAgICAgT2JqZWN0LmVudHJpZXMoZGF0YVtmaWVsZC5uYW1lXSkuZm9yRWFjaCgoW2xvY2FsZUtleSwgbG9jYWxlRGF0YV0pID0+IHtcbiAgICAgICAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgICAgICAgYXJyYXlzLFxuICAgICAgICAgICAgICBiYXNlVGFibGVOYW1lLFxuICAgICAgICAgICAgICBibG9ja3MsXG4gICAgICAgICAgICAgIGNvbHVtblByZWZpeDogYCR7Y29sdW1uTmFtZX1fYCxcbiAgICAgICAgICAgICAgZGF0YTogbG9jYWxlRGF0YSBhcyBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPixcbiAgICAgICAgICAgICAgZXhpc3RpbmdMb2NhbGVzLFxuICAgICAgICAgICAgICBmaWVsZFByZWZpeDogYCR7ZmllbGROYW1lfV9gLFxuICAgICAgICAgICAgICBmaWVsZHM6IGZpZWxkLmZpZWxkcyxcbiAgICAgICAgICAgICAgZm9yY2VkTG9jYWxlOiBsb2NhbGVLZXksXG4gICAgICAgICAgICAgIGxvY2FsZXMsXG4gICAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICAgIHBhcmVudFRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgcGF0aDogYCR7cGF0aCB8fCAnJ30ke2ZpZWxkLm5hbWV9LmAsXG4gICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHNUb0RlbGV0ZSxcbiAgICAgICAgICAgICAgcm93LFxuICAgICAgICAgICAgICBzZWxlY3RzLFxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9KVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgICAgIGFycmF5cyxcbiAgICAgICAgICAgIGJhc2VUYWJsZU5hbWUsXG4gICAgICAgICAgICBibG9ja3MsXG4gICAgICAgICAgICBjb2x1bW5QcmVmaXg6IGAke2NvbHVtbk5hbWV9X2AsXG4gICAgICAgICAgICBkYXRhOiBkYXRhW2ZpZWxkLm5hbWVdIGFzIFJlY29yZDxzdHJpbmcsIHVua25vd24+LFxuICAgICAgICAgICAgZXhpc3RpbmdMb2NhbGVzLFxuICAgICAgICAgICAgZmllbGRQcmVmaXg6IGAke2ZpZWxkTmFtZX1fYCxcbiAgICAgICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICAgICAgbG9jYWxlcyxcbiAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICBwYXJlbnRUYWJsZU5hbWUsXG4gICAgICAgICAgICBwYXRoOiBgJHtwYXRoIHx8ICcnfSR7ZmllbGQubmFtZX0uYCxcbiAgICAgICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgICByZWxhdGlvbnNoaXBzVG9EZWxldGUsXG4gICAgICAgICAgICByb3csXG4gICAgICAgICAgICBzZWxlY3RzLFxuICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgcmV0dXJuXG4gICAgfVxuXG4gICAgaWYgKGZpZWxkLnR5cGUgPT09ICd0YWJzJykge1xuICAgICAgZmllbGQudGFicy5mb3JFYWNoKCh0YWIpID0+IHtcbiAgICAgICAgaWYgKCduYW1lJyBpbiB0YWIpIHtcbiAgICAgICAgICBpZiAodHlwZW9mIGRhdGFbdGFiLm5hbWVdID09PSAnb2JqZWN0JyAmJiBkYXRhW3RhYi5uYW1lXSAhPT0gbnVsbCkge1xuICAgICAgICAgICAgaWYgKHRhYi5sb2NhbGl6ZWQpIHtcbiAgICAgICAgICAgICAgT2JqZWN0LmVudHJpZXMoZGF0YVt0YWIubmFtZV0pLmZvckVhY2goKFtsb2NhbGVLZXksIGxvY2FsZURhdGFdKSA9PiB7XG4gICAgICAgICAgICAgICAgdHJhdmVyc2VGaWVsZHMoe1xuICAgICAgICAgICAgICAgICAgYXJyYXlzLFxuICAgICAgICAgICAgICAgICAgYmFzZVRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICAgICAgICAgIGNvbHVtblByZWZpeDogYCR7Y29sdW1uUHJlZml4IHx8ICcnfSR7dG9TbmFrZUNhc2UodGFiLm5hbWUpfV9gLFxuICAgICAgICAgICAgICAgICAgZGF0YTogbG9jYWxlRGF0YSBhcyBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPixcbiAgICAgICAgICAgICAgICAgIGV4aXN0aW5nTG9jYWxlcyxcbiAgICAgICAgICAgICAgICAgIGZpZWxkUHJlZml4OiBgJHtmaWVsZFByZWZpeCB8fCAnJ30ke3RhYi5uYW1lfV9gLFxuICAgICAgICAgICAgICAgICAgZmllbGRzOiB0YWIuZmllbGRzLFxuICAgICAgICAgICAgICAgICAgZm9yY2VkTG9jYWxlOiBsb2NhbGVLZXksXG4gICAgICAgICAgICAgICAgICBsb2NhbGVzLFxuICAgICAgICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgICAgICAgIHBhcmVudFRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgICAgIHBhdGg6IGAke3BhdGggfHwgJyd9JHt0YWIubmFtZX0uYCxcbiAgICAgICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzVG9EZWxldGUsXG4gICAgICAgICAgICAgICAgICByb3csXG4gICAgICAgICAgICAgICAgICBzZWxlY3RzLFxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgICAgICAgICAgYXJyYXlzLFxuICAgICAgICAgICAgICAgIGJhc2VUYWJsZU5hbWUsXG4gICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgIGNvbHVtblByZWZpeDogYCR7Y29sdW1uUHJlZml4IHx8ICcnfSR7dG9TbmFrZUNhc2UodGFiLm5hbWUpfV9gLFxuICAgICAgICAgICAgICAgIGRhdGE6IGRhdGFbdGFiLm5hbWVdIGFzIFJlY29yZDxzdHJpbmcsIHVua25vd24+LFxuICAgICAgICAgICAgICAgIGV4aXN0aW5nTG9jYWxlcyxcbiAgICAgICAgICAgICAgICBmaWVsZFByZWZpeDogYCR7ZmllbGRQcmVmaXggfHwgJyd9JHt0YWIubmFtZX1fYCxcbiAgICAgICAgICAgICAgICBmaWVsZHM6IHRhYi5maWVsZHMsXG4gICAgICAgICAgICAgICAgbG9jYWxlcyxcbiAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgIHBhcmVudFRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgICBwYXRoOiBgJHtwYXRoIHx8ICcnfSR7dGFiLm5hbWV9LmAsXG4gICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzVG9EZWxldGUsXG4gICAgICAgICAgICAgICAgcm93LFxuICAgICAgICAgICAgICAgIHNlbGVjdHMsXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgICAgIGFycmF5cyxcbiAgICAgICAgICAgIGJhc2VUYWJsZU5hbWUsXG4gICAgICAgICAgICBibG9ja3MsXG4gICAgICAgICAgICBjb2x1bW5QcmVmaXgsXG4gICAgICAgICAgICBkYXRhLFxuICAgICAgICAgICAgZXhpc3RpbmdMb2NhbGVzLFxuICAgICAgICAgICAgZmllbGRQcmVmaXgsXG4gICAgICAgICAgICBmaWVsZHM6IHRhYi5maWVsZHMsXG4gICAgICAgICAgICBsb2NhbGVzLFxuICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgIHBhcmVudFRhYmxlTmFtZSxcbiAgICAgICAgICAgIHBhdGgsXG4gICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgcmVsYXRpb25zaGlwc1RvRGVsZXRlLFxuICAgICAgICAgICAgcm93LFxuICAgICAgICAgICAgc2VsZWN0cyxcbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9KVxuICAgIH1cblxuICAgIGlmIChmaWVsZC50eXBlID09PSAncm93JyB8fCBmaWVsZC50eXBlID09PSAnY29sbGFwc2libGUnKSB7XG4gICAgICB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgIGFycmF5cyxcbiAgICAgICAgYmFzZVRhYmxlTmFtZSxcbiAgICAgICAgYmxvY2tzLFxuICAgICAgICBjb2x1bW5QcmVmaXgsXG4gICAgICAgIGRhdGEsXG4gICAgICAgIGV4aXN0aW5nTG9jYWxlcyxcbiAgICAgICAgZmllbGRQcmVmaXgsXG4gICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICBsb2NhbGVzLFxuICAgICAgICBudW1iZXJzLFxuICAgICAgICBwYXJlbnRUYWJsZU5hbWUsXG4gICAgICAgIHBhdGgsXG4gICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgIHJlbGF0aW9uc2hpcHNUb0RlbGV0ZSxcbiAgICAgICAgcm93LFxuICAgICAgICBzZWxlY3RzLFxuICAgICAgfSlcbiAgICB9XG5cbiAgICBpZiAoZmllbGQudHlwZSA9PT0gJ3JlbGF0aW9uc2hpcCcgfHwgZmllbGQudHlwZSA9PT0gJ3VwbG9hZCcpIHtcbiAgICAgIGNvbnN0IHJlbGF0aW9uc2hpcFBhdGggPSBgJHtwYXRoIHx8ICcnfSR7ZmllbGQubmFtZX1gXG5cbiAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBmaWVsZERhdGEgPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgT2JqZWN0LmVudHJpZXMoZmllbGREYXRhKS5mb3JFYWNoKChbbG9jYWxlS2V5LCBsb2NhbGVEYXRhXSkgPT4ge1xuICAgICAgICAgICAgaWYgKGxvY2FsZURhdGEgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgcmVsYXRpb25zaGlwc1RvRGVsZXRlLnB1c2goe1xuICAgICAgICAgICAgICAgIGxvY2FsZTogbG9jYWxlS2V5LFxuICAgICAgICAgICAgICAgIHBhdGg6IHJlbGF0aW9uc2hpcFBhdGgsXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIHJldHVyblxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0cmFuc2Zvcm1SZWxhdGlvbnNoaXAoe1xuICAgICAgICAgICAgICBiYXNlUm93OiB7XG4gICAgICAgICAgICAgICAgbG9jYWxlOiBsb2NhbGVLZXksXG4gICAgICAgICAgICAgICAgcGF0aDogcmVsYXRpb25zaGlwUGF0aCxcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgZGF0YTogbG9jYWxlRGF0YSxcbiAgICAgICAgICAgICAgZmllbGQsXG4gICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChmaWVsZERhdGEgPT09IG51bGwpIHtcbiAgICAgICAgICByZWxhdGlvbnNoaXBzVG9EZWxldGUucHVzaCh7IHBhdGg6IHJlbGF0aW9uc2hpcFBhdGggfSlcbiAgICAgICAgICByZXR1cm5cbiAgICAgICAgfVxuXG4gICAgICAgIHRyYW5zZm9ybVJlbGF0aW9uc2hpcCh7XG4gICAgICAgICAgYmFzZVJvdzoge1xuICAgICAgICAgICAgcGF0aDogcmVsYXRpb25zaGlwUGF0aCxcbiAgICAgICAgICB9LFxuICAgICAgICAgIGRhdGE6IGZpZWxkRGF0YSxcbiAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICB9KVxuICAgICAgfVxuXG4gICAgICByZXR1cm5cbiAgICB9XG5cbiAgICBpZiAoZmllbGQudHlwZSA9PT0gJ251bWJlcicgJiYgZmllbGQuaGFzTWFueSkge1xuICAgICAgY29uc3QgbnVtYmVyUGF0aCA9IGAke3BhdGggfHwgJyd9JHtmaWVsZC5uYW1lfWBcblxuICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCkge1xuICAgICAgICBpZiAodHlwZW9mIGZpZWxkRGF0YSA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICBPYmplY3QuZW50cmllcyhmaWVsZERhdGEpLmZvckVhY2goKFtsb2NhbGVLZXksIGxvY2FsZURhdGFdKSA9PiB7XG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShsb2NhbGVEYXRhKSkge1xuICAgICAgICAgICAgICB0cmFuc2Zvcm1OdW1iZXJzKHtcbiAgICAgICAgICAgICAgICBiYXNlUm93OiB7XG4gICAgICAgICAgICAgICAgICBsb2NhbGU6IGxvY2FsZUtleSxcbiAgICAgICAgICAgICAgICAgIHBhdGg6IG51bWJlclBhdGgsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBkYXRhOiBsb2NhbGVEYXRhLFxuICAgICAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcbiAgICAgICAgfVx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