@payloadcms/db-postgres 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ Object.defineProperty(exports, "traverseFields", {
11
11
  const _types = require("payload/types");
12
12
  const _hasManyNumber = require("./hasManyNumber");
13
13
  const _relationship = require("./relationship");
14
- const traverseFields = ({ blocks, config, dataRef, fieldPrefix, fields, numbers, path, relationships, table })=>{
14
+ const traverseFields = ({ blocks, config, dataRef, deletions, fieldPrefix, fields, numbers, path, relationships, table })=>{
15
15
  const sanitizedPath = path ? `${path}.` : path;
16
16
  const formatted = fields.reduce((result, field)=>{
17
17
  if (field.type === 'tabs') {
@@ -19,6 +19,7 @@ const traverseFields = ({ blocks, config, dataRef, fieldPrefix, fields, numbers,
19
19
  blocks,
20
20
  config,
21
21
  dataRef,
22
+ deletions,
22
23
  fieldPrefix,
23
24
  fields: field.tabs.map((tab)=>({
24
25
  ...tab,
@@ -35,6 +36,7 @@ const traverseFields = ({ blocks, config, dataRef, fieldPrefix, fields, numbers,
35
36
  blocks,
36
37
  config,
37
38
  dataRef,
39
+ deletions,
38
40
  fieldPrefix,
39
41
  fields: field.fields,
40
42
  numbers,
@@ -55,10 +57,15 @@ const traverseFields = ({ blocks, config, dataRef, fieldPrefix, fields, numbers,
55
57
  const locale = row._locale;
56
58
  const data = {};
57
59
  delete row._locale;
60
+ if (row._uuid) {
61
+ row.id = row._uuid;
62
+ delete row._uuid;
63
+ }
58
64
  const rowResult = traverseFields({
59
65
  blocks,
60
66
  config,
61
67
  dataRef: data,
68
+ deletions,
62
69
  fieldPrefix: '',
63
70
  fields: field.fields,
64
71
  numbers,
@@ -72,10 +79,15 @@ const traverseFields = ({ blocks, config, dataRef, fieldPrefix, fields, numbers,
72
79
  }, {});
73
80
  } else {
74
81
  result[field.name] = fieldData.map((row, i)=>{
82
+ if (row._uuid) {
83
+ row.id = row._uuid;
84
+ delete row._uuid;
85
+ }
75
86
  return traverseFields({
76
87
  blocks,
77
88
  config,
78
89
  dataRef: row,
90
+ deletions,
79
91
  fieldPrefix: '',
80
92
  fields: field.fields,
81
93
  numbers,
@@ -94,6 +106,10 @@ const traverseFields = ({ blocks, config, dataRef, fieldPrefix, fields, numbers,
94
106
  if (field.localized) {
95
107
  result[field.name] = {};
96
108
  blocks[blockFieldPath].forEach((row)=>{
109
+ if (row._uuid) {
110
+ row.id = row._uuid;
111
+ delete row._uuid;
112
+ }
97
113
  if (typeof row._locale === 'string') {
98
114
  if (!result[field.name][row._locale]) result[field.name][row._locale] = [];
99
115
  result[field.name][row._locale].push(row);
@@ -108,6 +124,7 @@ const traverseFields = ({ blocks, config, dataRef, fieldPrefix, fields, numbers,
108
124
  blocks,
109
125
  config,
110
126
  dataRef: row,
127
+ deletions,
111
128
  fieldPrefix: '',
112
129
  fields: block.fields,
113
130
  numbers,
@@ -124,12 +141,17 @@ const traverseFields = ({ blocks, config, dataRef, fieldPrefix, fields, numbers,
124
141
  } else {
125
142
  result[field.name] = blocks[blockFieldPath].map((row, i)=>{
126
143
  delete row._order;
144
+ if (row._uuid) {
145
+ row.id = row._uuid;
146
+ delete row._uuid;
147
+ }
127
148
  const block = field.blocks.find(({ slug })=>slug === row.blockType);
128
149
  if (block) {
129
150
  return traverseFields({
130
151
  blocks,
131
152
  config,
132
153
  dataRef: row,
154
+ deletions,
133
155
  fieldPrefix: '',
134
156
  fields: block.fields,
135
157
  numbers,
@@ -262,6 +284,7 @@ const traverseFields = ({ blocks, config, dataRef, fieldPrefix, fields, numbers,
262
284
  blocks,
263
285
  config,
264
286
  dataRef: groupLocaleData,
287
+ deletions,
265
288
  fieldPrefix: groupFieldPrefix,
266
289
  fields: field.fields,
267
290
  numbers,
@@ -276,6 +299,7 @@ const traverseFields = ({ blocks, config, dataRef, fieldPrefix, fields, numbers,
276
299
  blocks,
277
300
  config,
278
301
  dataRef: groupData,
302
+ deletions,
279
303
  fieldPrefix: groupFieldPrefix,
280
304
  fields: field.fields,
281
305
  numbers,
@@ -330,7 +354,10 @@ const traverseFields = ({ blocks, config, dataRef, fieldPrefix, fields, numbers,
330
354
  }
331
355
  return result;
332
356
  }, dataRef);
357
+ if (Array.isArray(table._locales)) {
358
+ deletions.push(()=>delete table._locales);
359
+ }
333
360
  return formatted;
334
361
  };
335
362
 
336
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90cmFuc2Zvcm0vcmVhZC90cmF2ZXJzZUZpZWxkcy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBuby1wYXJhbS1yZWFzc2lnbiAqL1xuaW1wb3J0IHR5cGUgeyBTYW5pdGl6ZWRDb25maWcgfSBmcm9tICdwYXlsb2FkL2NvbmZpZydcbmltcG9ydCB0eXBlIHsgRmllbGQsIFRhYkFzRmllbGQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBmaWVsZEFmZmVjdHNEYXRhIH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHR5cGUgeyBCbG9ja3NNYXAgfSBmcm9tICcuLi8uLi91dGlsaXRpZXMvY3JlYXRlQmxvY2tzTWFwJ1xuXG5pbXBvcnQgeyB0cmFuc2Zvcm1IYXNNYW55TnVtYmVyIH0gZnJvbSAnLi9oYXNNYW55TnVtYmVyJ1xuaW1wb3J0IHsgdHJhbnNmb3JtUmVsYXRpb25zaGlwIH0gZnJvbSAnLi9yZWxhdGlvbnNoaXAnXG5cbnR5cGUgVHJhdmVyc2VGaWVsZHNBcmdzID0ge1xuICAvKipcbiAgICogUHJlLWZvcm1hdHRlZCBibG9ja3MgbWFwXG4gICAqL1xuICBibG9ja3M6IEJsb2Nrc01hcFxuICAvKipcbiAgICogVGhlIGZ1bGwgUGF5bG9hZCBjb25maWdcbiAgICovXG4gIGNvbmZpZzogU2FuaXRpemVkQ29uZmlnXG4gIC8qKlxuICAgKiBUaGUgZGF0YSByZWZlcmVuY2UgdG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mVzdWx0ID0gdHJhdmVyc2VGaWVsZHM8VD4oe1xuICAgICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgICAgY29uZmlnLFxuICAgICAgICAgICAgICAgICAgZGF0YVJlZjogZGF0YSxcbiAgICAgICAgICAgICAgICAgIGZpZWxkUHJlZml4OiAnJyxcbiAgICAgICAgICAgICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgICAgICAgIHBhdGg6IGAke3Nhbml0aXplZFBhdGh9JHtmaWVsZC5uYW1lfS4ke3Jvdy5fb3JkZXIgLSAxfWAsXG4gICAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgICAgdGFibGU6IHJvdyxcbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgYXJyYXlSZXN1bHRbbG9jYWxlXS5wdXNoKHJvd1Jlc3VsdClcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHJldHVybiBhcnJheVJlc3VsdFxuICAgICAgICAgICAgfSwge30pXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc3VsdFtmaWVsZC5uYW1lXSA9IGZpZWxkRGF0YS5tYXAoKHJvdywgaSkgPT4ge1xuICAgICAgICAgICAgICByZXR1cm4gdHJhdmVyc2VGaWVsZHM8VD4oe1xuICAgICAgICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICAgICAgICBjb25maWcsXG4gICAgICAgICAgICAgICAgZGF0YVJlZjogcm93LFxuICAgICAgICAgICAgICAgIGZpZWxkUHJlZml4OiAnJyxcbiAgICAgICAgICAgICAgICBmaWVsZHM6IGZpZWxkLmZpZWxkcyxcbiAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgIHBhdGg6IGAke3Nhbml0aXplZFBhdGh9JHtmaWVsZC5uYW1lfS4ke2l9YCxcbiAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgIHRhYmxlOiByb3csXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgIH1cblxuICAgICAgaWYgKGZpZWxkLnR5cGUgPT09ICdibG9ja3MnKSB7XG4gICAgICAgIGNvbnN0IGJsb2NrRmllbGRQYXRoID0gYCR7c2FuaXRpemVkUGF0aH0ke2ZpZWxkLm5hbWV9YFxuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KGJsb2Nrc1tibG9ja0ZpZWxkUGF0aF0pKSB7XG4gICAgICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCkge1xuICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0ge31cblxuICAgICAgICAgICAgYmxvY2tzW2Jsb2NrRmllbGRQYXRoXS5mb3JFYWNoKChyb3cpID0+IHtcbiAgICAgICAgICAgICAgaWYgKHR5cGVvZiByb3cuX2xvY2FsZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXJlc3VsdFtmaWVsZC5uYW1lXVtyb3cuX2xvY2FsZV0pIHJlc3VsdFtmaWVsZC5uYW1lXVtyb3cuX2xvY2FsZV0gPSBbXVxuICAgICAgICAgICAgICAgIHJlc3VsdFtmaWVsZC5uYW1lXVtyb3cuX2xvY2FsZV0ucHVzaChyb3cpXG4gICAgICAgICAgICAgICAgZGVsZXRlIHJvdy5fbG9jYWxlXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgIE9iamVjdC5lbnRyaWVzKHJlc3VsdFtmaWVsZC5uYW1lXSkuZm9yRWFjaCgoW2xvY2FsZSwgbG9jYWxpemVkQmxvY2tzXSkgPT4ge1xuICAgICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV1bbG9jYWxlXSA9IGxvY2FsaXplZEJsb2Nrcy5tYXAoKHJvdykgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnN0IGJsb2NrID0gZmllbGQuYmxvY2tzLmZpbmQoKHsgc2x1ZyB9KSA9PiBzbHVnID09PSByb3cuYmxvY2tUeXBlKVxuXG4gICAgICAgICAgICAgICAgaWYgKGJsb2NrKSB7XG4gICAgICAgICAgICAgICAgICBjb25zdCBibG9ja1Jlc3VsdCA9IHRyYXZlcnNlRmllbGRzPFQ+KHtcbiAgICAgICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgICAgICBjb25maWcsXG4gICAgICAgICAgICAgICAgICAgIGRhdGFSZWY6IHJvdyxcbiAgICAgICAgICAgICAgICAgICAgZmllbGRQcmVmaXg6ICcnLFxuICAgICAgICAgICAgICAgICAgICBmaWVsZHM6IGJsb2NrLmZpZWxkcyxcbiAgICAgICAgICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgICAgICAgICAgcGF0aDogYCR7YmxvY2tGaWVsZFBhdGh9LiR7cm93Ll9vcmRlciAtIDF9YCxcbiAgICAgICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgICAgICAgdGFibGU6IHJvdyxcbiAgICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAgIGRlbGV0ZSBibG9ja1Jlc3VsdC5fb3JkZXJcbiAgICAgICAgICAgICAgICAgIHJldHVybiBibG9ja1Jlc3VsdFxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiB7fVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0gYmxvY2tzW2Jsb2NrRmllbGRQYXRoXS5tYXAoKHJvdywgaSkgPT4ge1xuICAgICAgICAgICAgICBkZWxldGUgcm93Ll9vcmRlclxuICAgICAgICAgICAgICBjb25zdCBibG9jayA9IGZpZWxkLmJsb2Nrcy5maW5kKCh7IHNsdWcgfSkgPT4gc2x1ZyA9PT0gcm93LmJsb2NrVHlwZSlcblxuICAgICAgICAgICAgICBpZiAoYmxvY2spIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJhdmVyc2VGaWVsZHM8VD4oe1xuICAgICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgICAgY29uZmlnLFxuICAgICAgICAgICAgICAgICAgZGF0YVJlZjogcm93LFxuICAgICAgICAgICAgICAgICAgZmllbGRQcmVmaXg6ICcnLFxuICAgICAgICAgICAgICAgICAgZmllbGRzOiBibG9jay5maWVsZHMsXG4gICAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgICAgcGF0aDogYCR7YmxvY2tGaWVsZFBhdGh9LiR7aX1gLFxuICAgICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgICAgIHRhYmxlOiByb3csXG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHJldHVybiB7fVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0XG4gICAgICB9XG5cbiAgICAgIGlmIChmaWVsZC50eXBlID09PSAncmVsYXRpb25zaGlwJyB8fCBmaWVsZC50eXBlID09PSAndXBsb2FkJykge1xuICAgICAgICBjb25zdCByZWxhdGlvblBhdGhNYXRjaCA9IHJlbGF0aW9uc2hpcHNbYCR7c2FuaXRpemVkUGF0aH0ke2ZpZWxkLm5hbWV9YF1cbiAgICAgICAgaWYgKCFyZWxhdGlvblBhdGhNYXRjaCkge1xuICAgICAgICAgIGlmICgnaGFzTWFueScgaW4gZmllbGQgJiYgZmllbGQuaGFzTWFueSkge1xuICAgICAgICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCAmJiBjb25maWcubG9jYWxpemF0aW9uICYmIGNvbmZpZy5sb2NhbGl6YXRpb24ubG9jYWxlcykge1xuICAgICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSB7XG4gICAgICAgICAgICAgICAgW2NvbmZpZy5sb2NhbGl6YXRpb24uZGVmYXVsdExvY2FsZV06IFtdLFxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSBbXVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQpIHtcbiAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSB7fVxuICAgICAgICAgIGNvbnN0IHJlbGF0aW9uc0J5TG9jYWxlOiBSZWNvcmQ8c3RyaW5nLCBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPltdPiA9IHt9XG5cbiAgICAgICAgICByZWxhdGlvblBhdGhNYXRjaC5mb3JFYWNoKChyb3cpID0+IHtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygcm93LmxvY2FsZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgaWYgKCFyZWxhdGlvbnNCeUxvY2FsZVtyb3cubG9jYWxlXSkgcmVsYXRpb25zQnlMb2NhbGVbcm93LmxvY2FsZV0gPSBbXVxuICAgICAgICAgICAgICByZWxhdGlvbnNCeUxvY2FsZVtyb3cubG9jYWxlXS5wdXNoKHJvdylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgT2JqZWN0LmVudHJpZXMocmVsYXRpb25zQnlMb2NhbGUpLmZvckVhY2goKFtsb2NhbGUsIHJlbGF0aW9uc10pID0+IHtcbiAgICAgICAgICAgIHRyYW5zZm9ybVJlbGF0aW9uc2hpcCh7XG4gICAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgICBsb2NhbGUsXG4gICAgICAgICAgICAgIHJlZjogcmVzdWx0LFxuICAgICAgICAgICAgICByZWxhdGlvbnMsXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH0pXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdHJhbnNmb3JtUmVsYXRpb25zaGlwKHtcbiAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgcmVmOiByZXN1bHQsXG4gICAgICAgICAgICByZWxhdGlvbnM6IHJlbGF0aW9uUGF0aE1hdGNoLFxuICAgICAgICAgIH0pXG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0XG4gICAgICB9XG5cbiAgICAgIGlmIChmaWVsZC50eXBlID09PSAnbnVtYmVyJyAmJiBmaWVsZC5oYXNNYW55KSB7XG4gICAgICAgIGNvbnN0IG51bWJlclBhdGhNYXRjaCA9IG51bWJlcnNbYCR7c2FuaXRpemVkUGF0aH0ke2ZpZWxkLm5hbWV9YF1cbiAgICAgICAgaWYgKCFudW1iZXJQYXRoTWF0Y2gpIHJldHVybiByZXN1bHRcblxuICAgICAgICBpZiAoZmllbGQubG9jYWxpemVkKSB7XG4gICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0ge31cbiAgICAgICAgICBjb25zdCBudW1iZXJzQnlMb2NhbGU6IFJlY29yZDxzdHJpbmcsIFJlY29yZDxzdHJpbmcsIHVua25vd24+W10+ID0ge31cblxuICAgICAgICAgIG51bWJlclBhdGhNYXRjaC5mb3JFYWNoKChyb3cpID0+IHtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygcm93LmxvY2FsZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgaWYgKCFudW1iZXJzQnlMb2NhbGVbcm93LmxvY2FsZV0pIG51bWJlcnNCeUxvY2FsZVtyb3cubG9jYWxlXSA9IFtdXG4gICAgICAgICAgICAgIG51bWJlcnNCeUxvY2FsZVtyb3cubG9jYWxlXS5wdXNoKHJvdylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgT2JqZWN0LmVudHJpZXMobnVtYmVyc0J5TG9jYWxlKS5mb3JFYWNoKChbbG9jYWxlLCBudW1iZXJzXSkgPT4ge1xuICAgICAgICAgICAgdHJhbnNmb3JtSGFzTWFueU51bWJlcih7XG4gICAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgICBsb2NhbGUsXG4gICAgICAgICAgICAgIG51bWJlclJvd3M6IG51bWJlcnMsXG4gICAgICAgICAgICAgIHJlZjogcmVzdWx0LFxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9KVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRyYW5zZm9ybUhhc01hbnlOdW1iZXIoe1xuICAgICAgICAgICAgZmllbGQsXG4gICAgICAgICAgICBudW1iZXJSb3dzOiBudW1iZXJQYXRoTWF0Y2gsXG4gICAgICAgICAgICByZWY6IHJlc3VsdCxcbiAgICAgICAgICB9KVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlc3VsdFxuICAgICAgfVxuXG4gICAgICBpZiAoZmllbGQudHlwZSA9PT0gJ3NlbGVjdCcgJiYgZmllbGQuaGFzTWFueSkge1xuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShmaWVsZERhdGEpKSB7XG4gICAgICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCkge1xuICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0gZmllbGREYXRhLnJlZHVjZSgoc2VsZWN0UmVzdWx0LCByb3cpID0+IHtcbiAgICAgICAgICAgICAgaWYgKHR5cGVvZiByb3cubG9jYWxlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGlmICghc2VsZWN0UmVzdWx0W3Jvdy5sb2NhbGVdKSBzZWxlY3RSZXN1bHRbcm93LmxvY2FsZV0gPSBbXVxuICAgICAgICAgICAgICAgIHNlbGVjdFJlc3VsdFtyb3cub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IGxvY2FsZSA9IHRhYmxlPy5fbG9jYWxlXG5cbiAgICAgICAgc3dpdGNoIChmaWVsZC50eXBlKSB7XG4gICAgICAgICAgY2FzZSAndGFiJzpcbiAgICAgICAgICBjYXNlICdncm91cCc6IHtcbiAgICAgICAgICAgIGNvbnN0IGdyb3VwRmllbGRQcmVmaXggPSBgJHtmaWVsZFByZWZpeCB8fCAnJ30ke2ZpZWxkLm5hbWV9X2BcblxuICAgICAgICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCkge1xuICAgICAgICAgICAgICBpZiAodHlwZW9mIGxvY2FsZSA9PT0gJ3N0cmluZycgJiYgIXJlZltsb2NhbGVdKSB7XG4gICAgICAgICAgICAgICAgcmVmW2xvY2FsZV0gPSB7fVxuICAgICAgICAgICAgICAgIGRlbGV0ZSB0YWJsZS5fbG9jYWxlXG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBPYmplY3QuZW50cmllcyhyZWYpLmZvckVhY2goKFtncm91cExvY2FsZSwgZ3JvdXBMb2NhbGVEYXRhXSkgPT4ge1xuICAgICAgICAgICAgICAgIHJlZltncm91cExvY2FsZV0gPSB0cmF2ZXJzZUZpZWxkczxSZWNvcmQ8c3RyaW5nLCB1bmtub3duPj4oe1xuICAgICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgICAgY29uZmlnLFxuICAgICAgICAgICAgICAgICAgZGF0YVJlZjogZ3JvdXBMb2NhbGVEYXRhIGFzIFJlY29yZDxzdHJpbmcsIHVua25vd24+LFxuICAgICAgICAgICAgICAgICAgZmllbGRQcmVmaXg6IGdyb3VwRmllbGRQcmVmaXgsXG4gICAgICAgICAgICAgICAgICBmaWVsZHM6IGZpZWxkLmZpZWxkcyxcbiAgICAgICAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICAgICAgICBwYXRoOiBgJHtzYW5pdGl6ZWRQYXRofSR7ZmllbGQubmFtZX1gLFxuICAgICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgICAgIHRhYmxlLFxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBjb25zdCBncm91cERhdGEgPSB7fVxuXG4gICAgICAgICAgICAgIHJlZltmaWVsZC5uYW1lXSA9IHRyYXZlcnNlRmllbGRzPFJlY29yZDxzdHJpbmcsIHVua25vd24+Pih7XG4gICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgIGNvbmZpZyxcbiAgICAgICAgICAgICAgICBkYXRhUmVmOiBncm91cERhdGEgYXMgUmVjb3JkPHN0cmluZywgdW5rbm93bj4sXG4gICAgICAgICAgICAgICAgZmllbGRQcmVmaXg6IGdyb3VwRmllbGRQcmVmaXgsXG4gICAgICAgICAgICAgICAgZmllbGRzOiBmaWVsZC5maWVsZHMsXG4gICAgICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgICAgICBwYXRoOiBgJHtzYW5pdGl6ZWRQYXRofSR7ZmllbGQubmFtZX1gLFxuICAgICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgICAgICAgdGFibGUsXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY2FzZSAnbnVtYmVyJzoge1xuICAgICAgICAgICAgbGV0IHZhbCA9IGZpZWxkRGF0YVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBmaWVsZERhdGEgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIHZhbCA9IE51bWJlci5wYXJzZUZsb2F0KGZpZWxkRGF0YSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHR5cGVvZiBsb2NhbGUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIHJlZltsb2NhbGVdID0gdmFsXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSB2YWxcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjYXNlICdkYXRlJzoge1xuICAgICAgICAgICAgbGV0IHZhbCA9IGZpZWxkRGF0YVxuXG4gICAgICAgICAgICBpZiAodHlwZW9mIGZpZWxkRGF0YSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgdmFsID0gbmV3IERhdGUoZmllbGREYXRhKS50b0lTT1N0cmluZygpXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0eXBlb2YgbG9jYWxlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICByZWZbbG9jYWxlXSA9IHZhbFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0gdmFsXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgZGVmYXVsdDoge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBsb2NhbGUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIHJlZltsb2NhbGVdID0gZmllbGREYXRhXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSBmaWVsZERhdGFcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0pXG5cbiAgICAgIGlmIChPYmplY3Qua2V5cyhsb2NhbGl6ZWRGaWVsZERhdGEpLmxlbmd0aCA+IDApIHtcbiAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0gbG9jYWxpemVkRmllbGREYXRhXG4gICAgICB9XG5cbiAgICAgIHJldHVybiByZXN1bHRcbiA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FByZWZpeCxcbiAgICAgICAgZmllbGRzOiBmaWVsZC50YWJzLm1hcCgodGFiKSA9PiAoeyAuLi50YWIsIHR5cGU6ICd0YWInIH0pKSxcbiAgICAgICAgbnVtYmVycyxcbiAgICAgICAgcGF0aCxcbiAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgdGFibGUsXG4gICAgICB9KVxuICAgIH1cblxuICAgIGlmIChcbiAgICAgIGZpZWxkLnR5cGUgPT09ICdjb2xsYXBzaWJsZScgfHxcbiAgICAgIGZpZWxkLnR5cGUgPT09ICdyb3cnIHx8XG4gICAgICAoZmllbGQudHlwZSA9PT0gJ3RhYicgJiYgISgnbmFtZScgaW4gZmllbGQpKVxuICAgICkge1xuICAgICAgdHJhdmVyc2VGaWVsZHMoe1xuICAgICAgICBibG9ja3MsXG4gICAgICAgIGNvbmZpZyxcbiAgICAgICAgZGF0YVJlZixcbiAgICAgICAgZGVsZXRpb25zLFxuICAgICAgICBmaWVsZFByZWZpeCxcbiAgICAgICAgZmllbGRzOiBmaWVsZC5maWVsZHMsXG4gICAgICAgIG51bWJlcnMsXG4gICAgICAgIHBhdGgsXG4gICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgIHRhYmxlLFxuICAgICAgfSlcbiAgICB9XG5cbiAgICBpZiAoZmllbGRBZmZlY3RzRGF0YShmaWVsZCkpIHtcbiAgICAgIGNvbnN0IGZpZWxkTmFtZSA9IGAke2ZpZWxkUHJlZml4IHx8ICcnfSR7ZmllbGQubmFtZX1gXG4gICAgICBjb25zdCBmaWVsZERhdGEgPSB0YWJsZVtmaWVsZE5hbWVdXG4gICAgICBpZiAoZmllbGQudHlwZSA9PT0gJ2FycmF5Jykge1xuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShmaWVsZERhdGEpKSB7XG4gICAgICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCkge1xuICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0gZmllbGREYXRhLnJlZHVjZSgoYXJyYXlSZXN1bHQsIHJvdykgPT4ge1xuICAgICAgICAgICAgICBpZiAodHlwZW9mIHJvdy5fbG9jYWxlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGlmICghYXJyYXlSZXN1bHRbcm93Ll9sb2NhbGVdKSBhcnJheVJlc3VsdFtyb3cuX2xvY2FsZV0gPSBbXVxuICAgICAgICAgICAgICAgIGNvbnN0IGxvY2FsZSA9IHJvdy5fbG9jYWxlXG4gICAgICAgICAgICAgICAgY29uc3QgZGF0YSA9IHt9XG4gICAgICAgICAgICAgICAgZGVsZXRlIHJvdy5fbG9jYWxlXG4gICAgICAgICAgICAgICAgaWYgKHJvdy5fdXVpZCkge1xuICAgICAgICAgICAgICAgICAgcm93LmlkID0gcm93Ll91dWlkXG4gICAgICAgICAgICAgICAgICBkZWxldGUgcm93Ll91dWlkXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29uc3Qgcm93UmVzdWx0ID0gdHJhdmVyc2VGaWVsZHM8VD4oe1xuICAgICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgICAgY29uZmlnLFxuICAgICAgICAgICAgICAgICAgZGF0YVJlZjogZGF0YSxcbiAgICAgICAgICAgICAgICAgIGRlbGV0aW9ucyxcbiAgICAgICAgICAgICAgICAgIGZpZWxkUHJlZml4OiAnJyxcbiAgICAgICAgICAgICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgICAgICAgIHBhdGg6IGAke3Nhbml0aXplZFBhdGh9JHtmaWVsZC5uYW1lfS4ke3Jvdy5fb3JkZXIgLSAxfWAsXG4gICAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgICAgdGFibGU6IHJvdyxcbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgYXJyYXlSZXN1bHRbbG9jYWxlXS5wdXNoKHJvd1Jlc3VsdClcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHJldHVybiBhcnJheVJlc3VsdFxuICAgICAgICAgICAgfSwge30pXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc3VsdFtmaWVsZC5uYW1lXSA9IGZpZWxkRGF0YS5tYXAoKHJvdywgaSkgPT4ge1xuICAgICAgICAgICAgICBpZiAocm93Ll91dWlkKSB7XG4gICAgICAgICAgICAgICAgcm93LmlkID0gcm93Ll91dWlkXG4gICAgICAgICAgICAgICAgZGVsZXRlIHJvdy5fdXVpZFxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHJldHVybiB0cmF2ZXJzZUZpZWxkczxUPih7XG4gICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgIGNvbmZpZyxcbiAgICAgICAgICAgICAgICBkYXRhUmVmOiByb3csXG4gICAgICAgICAgICAgICAgZGVsZXRpb25zLFxuICAgICAgICAgICAgICAgIGZpZWxkUHJlZml4OiAnJyxcbiAgICAgICAgICAgICAgICBmaWVsZHM6IGZpZWxkLmZpZWxkcyxcbiAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgIHBhdGg6IGAke3Nhbml0aXplZFBhdGh9JHtmaWVsZC5uYW1lfS4ke2l9YCxcbiAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgIHRhYmxlOiByb3csXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgIH1cblxuICAgICAgaWYgKGZpZWxkLnR5cGUgPT09ICdibG9ja3MnKSB7XG4gICAgICAgIGNvbnN0IGJsb2NrRmllbGRQYXRoID0gYCR7c2FuaXRpemVkUGF0aH0ke2ZpZWxkLm5hbWV9YFxuXG4gICAgICAgIGlmIChB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Y2spIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IGJsb2NrUmVzdWx0ID0gdHJhdmVyc2VGaWVsZHM8VD4oe1xuICAgICAgICAgICAgICAgICAgICBibG9ja3MsXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZyxcbiAgICAgICAgICAgICAgICAgICAgZGF0YVJlZjogcm93LFxuICAgICAgICAgICAgICAgICAgICBkZWxldGlvbnMsXG4gICAgICAgICAgICAgICAgICAgIGZpZWxkUHJlZml4OiAnJyxcbiAgICAgICAgICAgICAgICAgICAgZmllbGRzOiBibG9jay5maWVsZHMsXG4gICAgICAgICAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICAgICAgICAgIHBhdGg6IGAke2Jsb2NrRmllbGRQYXRofS4ke3Jvdy5fb3JkZXIgLSAxfWAsXG4gICAgICAgICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgICAgICAgICAgIHRhYmxlOiByb3csXG4gICAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgICBkZWxldGUgYmxvY2tSZXN1bHQuX29yZGVyXG4gICAgICAgICAgICAgICAgICByZXR1cm4gYmxvY2tSZXN1bHRcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXR1cm4ge31cbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc3VsdFtmaWVsZC5uYW1lXSA9IGJsb2Nrc1tibG9ja0ZpZWxkUGF0aF0ubWFwKChyb3csIGkpID0+IHtcbiAgICAgICAgICAgICAgZGVsZXRlIHJvdy5fb3JkZXJcbiAgICAgICAgICAgICAgaWYgKHJvdy5fdXVpZCkge1xuICAgICAgICAgICAgICAgIHJvdy5pZCA9IHJvdy5fdXVpZFxuICAgICAgICAgICAgICAgIGRlbGV0ZSByb3cuX3V1aWRcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBjb25zdCBibG9jayA9IGZpZWxkLmJsb2Nrcy5maW5kKCh7IHNsdWcgfSkgPT4gc2x1ZyA9PT0gcm93LmJsb2NrVHlwZSlcblxuICAgICAgICAgICAgICBpZiAoYmxvY2spIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJhdmVyc2VGaWVsZHM8VD4oe1xuICAgICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgICAgY29uZmlnLFxuICAgICAgICAgICAgICAgICAgZGF0YVJlZjogcm93LFxuICAgICAgICAgICAgICAgICAgZGVsZXRpb25zLFxuICAgICAgICAgICAgICAgICAgZmllbGRQcmVmaXg6ICcnLFxuICAgICAgICAgICAgICAgICAgZmllbGRzOiBibG9jay5maWVsZHMsXG4gICAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgICAgcGF0aDogYCR7YmxvY2tGaWVsZFBhdGh9LiR7aX1gLFxuICAgICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgICAgIHRhYmxlOiByb3csXG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHJldHVybiB7fVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0XG4gICAgICB9XG5cbiAgICAgIGlmIChmaWVsZC50eXBlID09PSAncmVsYXRpb25zaGlwJyB8fCBmaWVsZC50eXBlID09PSAndXBsb2FkJykge1xuICAgICAgICBjb25zdCByZWxhdGlvblBhdGhNYXRjaCA9IHJlbGF0aW9uc2hpcHNbYCR7c2FuaXRpemVkUGF0aH0ke2ZpZWxkLm5hbWV9YF1cbiAgICAgICAgaWYgKCFyZWxhdGlvblBhdGhNYXRjaCkge1xuICAgICAgICAgIGlmICgnaGFzTWFueScgaW4gZmllbGQgJiYgZmllbGQuaGFzTWFueSkge1xuICAgICAgICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCAmJiBjb25maWcubG9jYWxpemF0aW9uICYmIGNvbmZpZy5sb2NhbGl6YXRpb24ubG9jYWxlcykge1xuICAgICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSB7XG4gICAgICAgICAgICAgICAgW2NvbmZpZy5sb2NhbGl6YXRpb24uZGVmYXVsdExvY2FsZV06IFtdLFxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSBbXVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQpIHtcbiAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSB7fVxuICAgICAgICAgIGNvbnN0IHJlbGF0aW9uc0J5TG9jYWxlOiBSZWNvcmQ8c3RyaW5nLCBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPltdPiA9IHt9XG5cbiAgICAgICAgICByZWxhdGlvblBhdGhNYXRjaC5mb3JFYWNoKChyb3cpID0+IHtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygcm93LmxvY2FsZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgaWYgKCFyZWxhdGlvbnNCeUxvY2FsZVtyb3cubG9jYWxlXSkgcmVsYXRpb25zQnlMb2NhbGVbcm93LmxvY2FsZV0gPSBbXVxuICAgICAgICAgICAgICByZWxhdGlvbnNCeUxvY2FsZVtyb3cubG9jYWxlXS5wdXNoKHJvdylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgT2JqZWN0LmVudHJpZXMocmVsYXRpb25zQnlMb2NhbGUpLmZvckVhY2goKFtsb2NhbGUsIHJlbGF0aW9uc10pID0+IHtcbiAgICAgICAgICAgIHRyYW5zZm9ybVJlbGF0aW9uc2hpcCh7XG4gICAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgICBsb2NhbGUsXG4gICAgICAgICAgICAgIHJlZjogcmVzdWx0LFxuICAgICAgICAgICAgICByZWxhdGlvbnMsXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH0pXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdHJhbnNmb3JtUmVsYXRpb25zaGlwKHtcbiAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgcmVmOiByZXN1bHQsXG4gICAgICAgICAgICByZWxhdGlvbnM6IHJlbGF0aW9uUGF0aE1hdGNoLFxuICAgICAgICAgIH0pXG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0XG4gICAgICB9XG5cbiAgICAgIGlmIChmaWVsZC50eXBlID09PSAnbnVtYmVyJyAmJiBmaWVsZC5oYXNNYW55KSB7XG4gICAgICAgIGNvbnN0IG51bWJlclBhdGhNYXRjaCA9IG51bWJlcnNbYCR7c2FuaXRpemVkUGF0aH0ke2ZpZWxkLm5hbWV9YF1cbiAgICAgICAgaWYgKCFudW1iZXJQYXRoTWF0Y2gpIHJldHVybiByZXN1bHRcblxuICAgICAgICBpZiAoZmllbGQubG9jYWxpemVkKSB7XG4gICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0ge31cbiAgICAgICAgICBjb25zdCBudW1iZXJzQnlMb2NhbGU6IFJlY29yZDxzdHJpbmcsIFJlY29yZDxzdHJpbmcsIHVua25vd24+W10+ID0ge31cblxuICAgICAgICAgIG51bWJlclBhdGhNYXRjaC5mb3JFYWNoKChyb3cpID0+IHtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygcm93LmxvY2FsZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgaWYgKCFudW1iZXJzQnlMb2NhbGVbcm93LmxvY2FsZV0pIG51bWJlcnNCeUxvY2FsZVtyb3cubG9jYWxlXSA9IFtdXG4gICAgICAgICAgICAgIG51bWJlcnNCeUxvY2FsZVtyb3cubG9jYWxlXS5wdXNoKHJvdylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgT2JqZWN0LmVudHJpZXMobnVtYmVyc0J5TG9jYWxlKS5mb3JFYWNoKChbbG9jYWxlLCBudW1iZXJzXSkgPT4ge1xuICAgICAgICAgICAgdHJhbnNmb3JtSGFzTWFueU51bWJlcih7XG4gICAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgICBsb2NhbGUsXG4gICAgICAgICAgICAgIG51bWJlclJvd3M6IG51bWJlcnMsXG4gICAgICAgICAgICAgIHJlZjogcmVzdWx0LFxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9KVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRyYW5zZm9ybUhhc01hbnlOdW1iZXIoe1xuICAgICAgICAgICAgZmllbGQsXG4gICAgICAgICAgICBudW1iZXJSb3dzOiBudW1iZXJQYXRoTWF0Y2gsXG4gICAgICAgICAgICByZWY6IHJlc3VsdCxcbiAgICAgICAgICB9KVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlc3VsdFxuICAgICAgfVxuXG4gICAgICBpZiAoZmllbGQudHlwZSA9PT0gJ3NlbGVjdCcgJiYgZmllbGQuaGFzTWFueSkge1xuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShmaWVsZERhdGEpKSB7XG4gICAgICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCkge1xuICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0gZmllbGREYXRhLnJlZHVjZSgoc2VsZWN0UmVzdWx0LCByb3cpID0+IHtcbiAgICAgICAgICAgICAgaWYgKHR5cGVvZiByb3cubG9jYWxlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGlmICghc2VsZWN0UmVzdWx0W3Jvdy5sb2NhbGVdKSBzZWxlY3RSZXN1bHRbcm93LmxvY2FsZV0gPSBbXVxuICAgICAgICAgICAgIC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YW1lfWBdXG4gICAgICAgIGNvbnN0IGxvY2FsZSA9IHRhYmxlPy5fbG9jYWxlXG5cbiAgICAgICAgc3dpdGNoIChmaWVsZC50eXBlKSB7XG4gICAgICAgICAgY2FzZSAndGFiJzpcbiAgICAgICAgICBjYXNlICdncm91cCc6IHtcbiAgICAgICAgICAgIGNvbnN0IGdyb3VwRmllbGRQcmVmaXggPSBgJHtmaWVsZFByZWZpeCB8fCAnJ30ke2ZpZWxkLm5hbWV9X2BcblxuICAgICAgICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCkge1xuICAgICAgICAgICAgICBpZiAodHlwZW9mIGxvY2FsZSA9PT0gJ3N0cmluZycgJiYgIXJlZltsb2NhbGVdKSB7XG4gICAgICAgICAgICAgICAgcmVmW2xvY2FsZV0gPSB7fVxuICAgICAgICAgICAgICAgIGRlbGV0ZSB0YWJsZS5fbG9jYWxlXG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBPYmplY3QuZW50cmllcyhyZWYpLmZvckVhY2goKFtncm91cExvY2FsZSwgZ3JvdXBMb2NhbGVEYXRhXSkgPT4ge1xuICAgICAgICAgICAgICAgIHJlZltncm91cExvY2FsZV0gPSB0cmF2ZXJzZUZpZWxkczxSZWNvcmQ8c3RyaW5nLCB1bmtub3duPj4oe1xuICAgICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgICAgY29uZmlnLFxuICAgICAgICAgICAgICAgICAgZGF0YVJlZjogZ3JvdXBMb2NhbGVEYXRhIGFzIFJlY29yZDxzdHJpbmcsIHVua25vd24+LFxuICAgICAgICAgICAgICAgICAgZGVsZXRpb25zLFxuICAgICAgICAgICAgICAgICAgZmllbGRQcmVmaXg6IGdyb3VwRmllbGRQcmVmaXgsXG4gICAgICAgICAgICAgICAgICBmaWVsZHM6IGZpZWxkLmZpZWxkcyxcbiAgICAgICAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICAgICAgICBwYXRoOiBgJHtzYW5pdGl6ZWRQYXRofSR7ZmllbGQubmFtZX1gLFxuICAgICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgICAgIHRhYmxlLFxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBjb25zdCBncm91cERhdGEgPSB7fVxuXG4gICAgICAgICAgICAgIHJlZltmaWVsZC5uYW1lXSA9IHRyYXZlcnNlRmllbGRzPFJlY29yZDxzdHJpbmcsIHVua25vd24+Pih7XG4gICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgIGNvbmZpZyxcbiAgICAgICAgICAgICAgICBkYXRhUmVmOiBncm91cERhdGEgYXMgUmVjb3JkPHN0cmluZywgdW5rbm93bj4sXG4gICAgICAgICAgICAgICAgZGVsZXRpb25zLFxuICAgICAgICAgICAgICAgIGZpZWxkUHJlZml4OiBncm91cEZpZWxkUHJlZml4LFxuICAgICAgICAgICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICAgICAgcGF0aDogYCR7c2FuaXRpemVkUGF0aH0ke2ZpZWxkLm5hbWV9YCxcbiAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgIHRhYmxlLFxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBicmVha1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNhc2UgJ251bWJlcic6IHtcbiAgICAgICAgICAgIGxldCB2YWwgPSBmaWVsZERhdGFcbiAgICAgICAgICAgIGlmICh0eXBlb2YgZmllbGREYXRhID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICB2YWwgPSBOdW1iZXIucGFyc2VGbG9hdChmaWVsZERhdGEpXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0eXBlb2YgbG9jYWxlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICByZWZbbG9jYWxlXSA9IHZhbFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0gdmFsXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY2FzZSAnZGF0ZSc6IHtcbiAgICAgICAgICAgIGxldCB2YWwgPSBmaWVsZERhdGFcblxuICAgICAgICAgICAgaWYgKHR5cGVvZiBmaWVsZERhdGEgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIHZhbCA9IG5ldyBEYXRlKGZpZWxkRGF0YSkudG9JU09TdHJpbmcoKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodHlwZW9mIGxvY2FsZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgcmVmW2xvY2FsZV0gPSB2YWxcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJlc3VsdFtmaWVsZC5uYW1lXSA9IHZhbFxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBicmVha1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGRlZmF1bHQ6IHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbG9jYWxlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICByZWZbbG9jYWxlXSA9IGZpZWxkRGF0YVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0gZmllbGREYXRhXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KVxuXG4gICAgICBpZiAoT2JqZWN0LmtleXMobG9jYWxpemVkRmllbGREYXRhKS5sZW5ndGggPiAwKSB7XG4gICAgICAgIHJlc3VsdF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R3lDO1lBQ3ZCO1lBRUEsT0FBT2pEO1FBQ1Q7UUFFQSxPQUFPQTtJQUNULEdBQUdYO0lBRUgsSUFBSXFCLE1BQU1DLE9BQU8sQ0FBQ2YsTUFBTXVELFFBQVEsR0FBRztRQUNqQzdELFVBQVVnQyxJQUFJLENBQUMsSUFBTSxPQUFPMUIsTUFBTXVELFFBQVE7SUFDNUM7SUFFQSxPQUFPckQ7QUFDVCJ9
@@ -1,6 +1,8 @@
1
1
  import type { ArrayField } from 'payload/types';
2
+ import type { PostgresAdapter } from '../../types';
2
3
  import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types';
3
4
  type Args = {
5
+ adapter: PostgresAdapter;
4
6
  arrayTableName: string;
5
7
  baseTableName: string;
6
8
  blocks: {
@@ -17,6 +19,6 @@ type Args = {
17
19
  [tableName: string]: Record<string, unknown>[];
18
20
  };
19
21
  };
20
- export declare const transformArray: ({ arrayTableName, baseTableName, blocks, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects, }: Args) => ArrayRowToInsert[];
22
+ export declare const transformArray: ({ adapter, arrayTableName, baseTableName, blocks, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects, }: Args) => ArrayRowToInsert[];
21
23
  export {};
22
24
  //# sourceMappingURL=array.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src/transform/write/array.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAKvF,KAAK,IAAI,GAAG;IACV,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,CAAA;IACD,IAAI,EAAE,OAAO,CAAA;IACb,KAAK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AAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;KAC/C,CAAA;CACF,CAAA;AAED,eAAO,MAAM,cAAc,2IAaxB,IAAI,uBA0DN,CAAA"}
@@ -10,8 +10,9 @@ Object.defineProperty(exports, "transformArray", {
10
10
  });
11
11
  const _isArrayOfRows = require("../../utilities/isArrayOfRows");
12
12
  const _traverseFields = require("./traverseFields");
13
- const transformArray = ({ arrayTableName, baseTableName, blocks, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects })=>{
13
+ const transformArray = ({ adapter, arrayTableName, baseTableName, blocks, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects })=>{
14
14
  const newRows = [];
15
+ const hasUUID = adapter.tables[arrayTableName]._uuid;
15
16
  if ((0, _isArrayOfRows.isArrayOfRows)(data)) {
16
17
  data.forEach((arrayRow, i)=>{
17
18
  const newRow = {
@@ -21,6 +22,15 @@ const transformArray = ({ arrayTableName, baseTableName, blocks, data, field, lo
21
22
  _order: i + 1
22
23
  }
23
24
  };
25
+ // If we have declared a _uuid field on arrays,
26
+ // that means the ID has to be unique,
27
+ // and our ids within arrays are not unique.
28
+ // So move the ID to a uuid field for storage
29
+ // and allow the database to generate a serial id automatically
30
+ if (hasUUID) {
31
+ newRow.row._uuid = arrayRow.id;
32
+ delete arrayRow.id;
33
+ }
24
34
  if (locale) {
25
35
  newRow.locales[locale] = {
26
36
  _locale: locale
@@ -30,6 +40,7 @@ const transformArray = ({ arrayTableName, baseTableName, blocks, data, field, lo
30
40
  newRow.row._locale = locale;
31
41
  }
32
42
  (0, _traverseFields.traverseFields)({
43
+ adapter,
33
44
  arrays: newRow.arrays,
34
45
  baseTableName,
35
46
  blocks,
@@ -52,4 +63,4 @@ const transformArray = ({ arrayTableName, baseTableName, blocks, data, field, lo
52
63
  return newRows;
53
64
  };
54
65
 
55
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL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yxHQUFHO2dCQUNmWjtZQUNGO1lBRUFDLFFBQVFzQixJQUFJLENBQUNkO1FBQ2Y7SUFDRjtJQUVBLE9BQU9SO0FBQ1QifQ==
@@ -1,6 +1,8 @@
1
1
  import type { BlockField } from 'payload/types';
2
+ import type { PostgresAdapter } from '../../types';
2
3
  import type { BlockRowToInsert, RelationshipToDelete } from './types';
3
4
  type Args = {
5
+ adapter: PostgresAdapter;
4
6
  baseTableName: string;
5
7
  blocks: {
6
8
  [blockType: string]: BlockRowToInsert[];
@@ -16,6 +18,6 @@ type Args = {
16
18
  [tableName: string]: Record<string, unknown>[];
17
19
  };
18
20
  };
19
- export declare const transformBlocks: ({ baseTableName, blocks, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects, }: Args) => void;
21
+ export declare const transformBlocks: ({ adapter, baseTableName, blocks, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects, }: Args) => void;
20
22
  export {};
21
23
  //# sourceMappingURL=blocks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../../src/transform/write/blocks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAIrE,KAAK,IAAI,GAAG;IACV,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,CAAA;IACD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC/B,KAAK,EAAE,UAAU,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACxC,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,OAAO,EAAE;QACP,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;KAC/C,CAAA;CACF,CAAA;AACD,eAAO,MAAM,eAAe,kHAWzB,IAAI,SA0CN,CAAA"}
1
+ {"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../../src/transform/write/blocks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAIrE,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,CAAA;IACD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC/B,KAAK,EAAE,UAAU,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACxC,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,OAAO,EAAE;QACP,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;KAC/C,CAAA;CACF,CAAA;AACD,eAAO,MAAM,eAAe,2HAYzB,IAAI,SAuDN,CAAA"}
@@ -15,7 +15,7 @@ function _interop_require_default(obj) {
15
15
  default: obj
16
16
  };
17
17
  }
18
- const transformBlocks = ({ baseTableName, blocks, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects })=>{
18
+ const transformBlocks = ({ adapter, baseTableName, blocks, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects })=>{
19
19
  data.forEach((blockRow, i)=>{
20
20
  if (typeof blockRow.blockType !== 'string') return;
21
21
  const matchedBlock = field.blocks.find(({ slug })=>slug === blockRow.blockType);
@@ -32,7 +32,18 @@ const transformBlocks = ({ baseTableName, blocks, data, field, locale, numbers,
32
32
  };
33
33
  if (field.localized && locale) newRow.row._locale = locale;
34
34
  const blockTableName = `${baseTableName}_blocks_${blockType}`;
35
+ const hasUUID = adapter.tables[blockTableName]._uuid;
36
+ // If we have declared a _uuid field on arrays,
37
+ // that means the ID has to be unique,
38
+ // and our ids within arrays are not unique.
39
+ // So move the ID to a uuid field for storage
40
+ // and allow the database to generate a serial id automatically
41
+ if (hasUUID) {
42
+ newRow.row._uuid = blockRow.id;
43
+ delete blockRow.id;
44
+ }
35
45
  (0, _traverseFields.traverseFields)({
46
+ adapter,
36
47
  arrays: newRow.arrays,
37
48
  baseTableName,
38
49
  blocks,
@@ -53,4 +64,4 @@ const transformBlocks = ({ baseTableName, blocks, data, field, locale, numbers,
53
64
  });
54
65
  };
55
66
 
56
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90cmFuc2Zvcm0vd3JpdGUvYmxvY2tzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLXBhcmFtLXJlYXNzaWduICovXG5pbXBvcnQgdHlwZSB7IEJsb2NrRmllbGQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgdG9TbmFrZUNhc2UgZnJvbSAndG8tc25ha2UtY2FzZSdcblxuaW1wb3J0IHR5cGUgeyBCbG9ja1Jvd1RvSW5zZXJ0LCBSZWxhdG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O1FBQzdDLCtEQUErRDtRQUMvRCxJQUFJRixTQUFTO1lBQ1hWLE9BQU9HLEdBQUcsQ0FBQ1MsS0FBSyxHQUFHbkIsU0FBU29CLEVBQUU7WUFDOUIsT0FBT3BCLFNBQVNvQixFQUFFO1FBQ3BCO1FBRUFDLElBQUFBLDhCQUFjLEVBQUM7WUFDYmpDO1lBQ0FvQixRQUFRRCxPQUFPQyxNQUFNO1lBQ3JCbkI7WUFDQUM7WUFDQWdDLGNBQWM7WUFDZC9CLE1BQU1TO1lBQ051QixhQUFhO1lBQ2JDLFFBQVFyQixhQUFhcUIsTUFBTTtZQUMzQmYsU0FBU0YsT0FBT0UsT0FBTztZQUN2QmY7WUFDQStCLGlCQUFpQlQ7WUFDakJyQixNQUFNLENBQUMsRUFBRUEsUUFBUSxHQUFHLEVBQUVILE1BQU1xQixJQUFJLENBQUMsQ0FBQyxFQUFFWixFQUFFLENBQUMsQ0FBQztZQUN4Q0w7WUFDQUM7WUFDQWEsS0FBS0gsT0FBT0csR0FBRztZQUNmWjtRQUNGO1FBRUFSLE1BQU0sQ0FBQ1ksVUFBVSxDQUFDd0IsSUFBSSxDQUFDbkI7SUFDekI7QUFDRiJ9
@@ -1,11 +1,13 @@
1
1
  import type { Field } from 'payload/types';
2
+ import type { PostgresAdapter } from '../../types';
2
3
  import type { RowToInsert } from './types';
3
4
  type Args = {
5
+ adapter: PostgresAdapter;
4
6
  data: Record<string, unknown>;
5
7
  fields: Field[];
6
8
  path?: string;
7
9
  tableName: string;
8
10
  };
9
- export declare const transformForWrite: ({ data, fields, path, tableName }: Args) => RowToInsert;
11
+ export declare const transformForWrite: ({ adapter, data, fields, path, tableName, }: Args) => RowToInsert;
10
12
  export {};
11
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transform/write/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAI1C,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,iBAAiB,sCAA4C,IAAI,KAAG,WAkChF,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transform/write/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAI1C,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,iBAAiB,gDAM3B,IAAI,KAAG,WAmCT,CAAA"}
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "transformForWrite", {
9
9
  }
10
10
  });
11
11
  const _traverseFields = require("./traverseFields");
12
- const transformForWrite = ({ data, fields, path = '', tableName })=>{
12
+ const transformForWrite = ({ adapter, data, fields, path = '', tableName })=>{
13
13
  // Split out the incoming data into rows to insert / delete
14
14
  const rowToInsert = {
15
15
  arrays: {},
@@ -24,6 +24,7 @@ const transformForWrite = ({ data, fields, path = '', tableName })=>{
24
24
  // This function is responsible for building up the
25
25
  // above rowToInsert
26
26
  (0, _traverseFields.traverseFields)({
27
+ adapter,
27
28
  arrays: rowToInsert.arrays,
28
29
  baseTableName: tableName,
29
30
  blocks: rowToInsert.blocks,
@@ -43,4 +44,4 @@ const transformForWrite = ({ data, fields, path = '', tableName })=>{
43
44
  return rowToInsert;
44
45
  };
45
46
 
46
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90cmFuc2Zvcm0vd3JpdGUvaW5kZXgudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcGFyYW0tcmVhc3NpZ24gKi9cbmltcG9ydCB0eXBlIHsgRmllbGQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgdHlwZSB7IFJvd1RvSW5zZXJ0IH0gZnJvbSAnLi90eXBlcydcblxuaW1wb3J0IHsgdHJhdmVyc2VGaWVsZHMgfSBmcm9tICcuL3RyYXZlcnNlRmllbGRzJ1xuXG50eXBlIEFyZ3MgPSB7XG4gIGRhdGE6IFJlY29yZDxzdHJpbmcsIHVua25vd24+XG4gIGZpZWxkczogRmllbGRbXVxuICBwYXRoPzogc3RyaW5nXG4gIHRhYmxlTmFtZTogc3RyaW5nXG59XG5cbmV4cG9ydCBjb25zdCB0cmFuc2Zvcm1Gb3JXcml0ZSA9ICh7IGRhdGEsIGZpZWxkcywgcGF0aCA9ICcnLCB0YWJsZU5hbWUgfTogQXJncyk6IFJvd1RvSW5zZXJ0ID0+IHtcbiAgLy8gU3BsaXQgb3V0IHRoZSBpbmNvbWluZyBkYXRhIGludG8gcm93cyB0byBpbnNlcnQgLyBkZWxldGVcbiAgY29uc3Qgcm93VG9JbnNlcnQ6IFJvd1RvSW5zZXJ0ID0ge1xuICAgIGFycmF5czoge30sXG4gICAgYmxvY2tzOiB7fSxcbiAgICBsb2NhbGVzOiB7fSxcbiAgICBudW1iZXJzOiBbXSxcbiAgICByZWxhdGlvbnNoaXBzOiBbXSxcbiAgICByZWxhdGlvbnNoaXBzVG9EZWxldGU6IFtdLFxuICA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maXgiLCJmaWVsZFByZWZpeCIsInBhcmVudFRhYmxlTmFtZSJdLCJtYXBwaW5ncyI6IkFBQUEsb0NBQW9DOzs7OytCQWdCdkJBOzs7ZUFBQUE7OztnQ0FWa0I7QUFVeEIsTUFBTUEsb0JBQW9CLENBQUMsRUFDaENDLE9BQU8sRUFDUEMsSUFBSSxFQUNKQyxNQUFNLEVBQ05DLE9BQU8sRUFBRSxFQUNUQyxTQUFTLEVBQ0o7SUFDTCwyREFBMkQ7SUFDM0QsTUFBTUMsY0FBMkI7UUFDL0JDLFFBQVEsQ0FBQztRQUNUQyxRQUFRLENBQUM7UUFDVEMsU0FBUyxDQUFDO1FBQ1ZDLFNBQVMsRUFBRTtRQUNYQyxlQUFlLEVBQUU7UUFDakJDLHVCQUF1QixFQUFFO1FBQ3pCQyxLQUFLLENBQUM7UUFDTkMsU0FBUyxDQUFDO0lBQ1o7SUFFQSxtREFBbUQ7SUFDbkQsb0JBQW9CO0lBQ3BCQyxJQUFBQSw4QkFBYyxFQUFDO1FBQ2JkO1FBQ0FNLFFBQVFELFlBQVlDLE1BQU07UUFDMUJTLGVBQWVYO1FBQ2ZHLFFBQVFGLFlBQVlFLE1BQU07UUFDMUJTLGNBQWM7UUFDZGY7UUFDQWdCLGFBQWE7UUFDYmY7UUFDQU0sU0FBU0gsWUFBWUcsT0FBTztRQUM1QkMsU0FBU0osWUFBWUksT0FBTztRQUM1QlMsaUJBQWlCZDtRQUNqQkQ7UUFDQU8sZUFBZUwsWUFBWUssYUFBYTtRQUN4Q0MsdUJBQXVCTixZQUFZTSxxQkFBcUI7UUFDeERDLEtBQUtQLFlBQVlPLEdBQUc7UUFDcEJDLFNBQVNSLFlBQVlRLE9BQU87SUFDOUI7SUFFQSxPQUFPUjtBQUNUIn0=
@@ -1,6 +1,8 @@
1
1
  import type { Field } from 'payload/types';
2
+ import type { PostgresAdapter } from '../../types';
2
3
  import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types';
3
4
  type Args = {
5
+ adapter: PostgresAdapter;
4
6
  arrays: {
5
7
  [tableName: string]: ArrayRowToInsert[];
6
8
  };
@@ -41,6 +43,6 @@ type Args = {
41
43
  [tableName: string]: Record<string, unknown>[];
42
44
  };
43
45
  };
44
- export declare const traverseFields: ({ arrays, baseTableName, blocks, columnPrefix, data, existingLocales, fieldPrefix, fields, forcedLocale, locales, numbers, parentTableName, path, relationships, relationshipsToDelete, row, selects, }: Args) => void;
46
+ export declare const traverseFields: ({ adapter, arrays, baseTableName, blocks, columnPrefix, data, existingLocales, fieldPrefix, fields, forcedLocale, locales, numbers, parentTableName, path, relationships, relationshipsToDelete, row, selects, }: Args) => void;
45
47
  export {};
46
48
  //# sourceMappingURL=traverseFields.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../../src/transform/write/traverseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAK1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AASvF,KAAK,IAAI,GAAG;IACV,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,CAAA;IACD;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,CAAA;IACD;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC3C;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO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