@payloadcms/db-postgres 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. package/dist/find/buildFindManyArgs.d.ts.map +1 -1
  2. package/dist/find/buildFindManyArgs.js +12 -1
  3. package/dist/init.d.ts.map +1 -1
  4. package/dist/init.js +7 -1
  5. package/dist/migrate.d.ts.map +1 -1
  6. package/dist/migrate.js +14 -5
  7. package/dist/migrateDown.d.ts.map +1 -1
  8. package/dist/migrateDown.js +13 -10
  9. package/dist/migrateFresh.d.ts.map +1 -1
  10. package/dist/migrateFresh.js +15 -12
  11. package/dist/migrateRefresh.d.ts.map +1 -1
  12. package/dist/migrateRefresh.js +17 -15
  13. package/dist/migrateReset.d.ts.map +1 -1
  14. package/dist/migrateReset.js +11 -9
  15. package/dist/queries/parseParams.d.ts.map +1 -1
  16. package/dist/queries/parseParams.js +29 -5
  17. package/dist/schema/build.d.ts +3 -1
  18. package/dist/schema/build.d.ts.map +1 -1
  19. package/dist/schema/build.js +58 -17
  20. package/dist/schema/getConfigIDType.d.ts +3 -0
  21. package/dist/schema/getConfigIDType.d.ts.map +1 -0
  22. package/dist/schema/getConfigIDType.js +25 -0
  23. package/dist/schema/traverseFields.d.ts +4 -1
  24. package/dist/schema/traverseFields.d.ts.map +1 -1
  25. package/dist/schema/traverseFields.js +48 -8
  26. package/dist/schema/validateExistingBlockIsIdentical.d.ts.map +1 -1
  27. package/dist/schema/validateExistingBlockIsIdentical.js +49 -7
  28. package/dist/transform/read/hasManyText.d.ts +10 -0
  29. package/dist/transform/read/hasManyText.d.ts.map +1 -0
  30. package/dist/transform/read/hasManyText.js +20 -0
  31. package/dist/transform/read/index.d.ts.map +1 -1
  32. package/dist/transform/read/index.js +7 -1
  33. package/dist/transform/read/traverseFields.d.ts +5 -1
  34. package/dist/transform/read/traverseFields.d.ts.map +1 -1
  35. package/dist/transform/read/traverseFields.js +53 -2
  36. package/dist/transform/write/array.d.ts +2 -1
  37. package/dist/transform/write/array.d.ts.map +1 -1
  38. package/dist/transform/write/array.js +3 -2
  39. package/dist/transform/write/blocks.d.ts +2 -1
  40. package/dist/transform/write/blocks.d.ts.map +1 -1
  41. package/dist/transform/write/blocks.js +3 -2
  42. package/dist/transform/write/index.d.ts.map +1 -1
  43. package/dist/transform/write/index.js +3 -1
  44. package/dist/transform/write/texts.d.ts +8 -0
  45. package/dist/transform/write/texts.d.ts.map +1 -0
  46. package/dist/transform/write/texts.js +21 -0
  47. package/dist/transform/write/traverseFields.d.ts +2 -1
  48. package/dist/transform/write/traverseFields.d.ts.map +1 -1
  49. package/dist/transform/write/traverseFields.js +41 -2
  50. package/dist/transform/write/types.d.ts +1 -0
  51. package/dist/transform/write/types.d.ts.map +1 -1
  52. package/dist/upsertRow/index.d.ts.map +1 -1
  53. package/dist/upsertRow/index.js +28 -1
  54. package/package.json +3 -3
@@ -24,9 +24,11 @@ function _interop_require_default(obj) {
24
24
  default: obj
25
25
  };
26
26
  }
27
- const traverseFields = ({ adapter, buildNumbers, buildRelationships, columnPrefix, columns, disableNotNull, disableUnique = false, fieldPrefix, fields, forceLocalized, indexes, localesColumns, localesIndexes, newTableName, parentTableName, relationsToBuild, relationships, rootRelationsToBuild, rootTableIDColType, rootTableName })=>{
27
+ const traverseFields = ({ adapter, buildTexts, buildNumbers, buildRelationships, columnPrefix, columns, disableNotNull, disableUnique = false, fieldPrefix, fields, forceLocalized, indexes, localesColumns, localesIndexes, newTableName, parentTableName, relationsToBuild, relationships, rootRelationsToBuild, rootTableIDColType, rootTableName })=>{
28
28
  let hasLocalizedField = false;
29
29
  let hasLocalizedRelationshipField = false;
30
+ let hasManyTextField = false;
31
+ let hasLocalizedManyTextField = false;
30
32
  let hasManyNumberField = false;
31
33
  let hasLocalizedManyNumberField = false;
32
34
  let parentIDColType = 'integer';
@@ -73,6 +75,24 @@ const traverseFields = ({ adapter, buildNumbers, buildRelationships, columnPrefi
73
75
  }
74
76
  switch(field.type){
75
77
  case 'text':
78
+ {
79
+ if (field.hasMany) {
80
+ if (field.localized) {
81
+ hasLocalizedManyTextField = true;
82
+ }
83
+ if (field.index) {
84
+ hasManyTextField = 'index';
85
+ } else if (!hasManyTextField) {
86
+ hasManyTextField = true;
87
+ }
88
+ if (field.unique) {
89
+ throw new _errors.InvalidConfiguration('Unique is not supported in Postgres for hasMany text fields.');
90
+ }
91
+ } else {
92
+ targetTable[fieldName] = (0, _pgcore.varchar)(columnName);
93
+ }
94
+ break;
95
+ }
76
96
  case 'email':
77
97
  case 'code':
78
98
  case 'textarea':
@@ -200,7 +220,7 @@ const traverseFields = ({ adapter, buildNumbers, buildRelationships, columnPrefi
200
220
  baseColumns._locale = adapter.enums.enum__locales('_locale').notNull();
201
221
  baseExtraConfig._localeIdx = (cols)=>(0, _pgcore.index)('_locale_idx').on(cols._locale);
202
222
  }
203
- const { hasManyNumberField: subHasManyNumberField, relationsToBuild: subRelationsToBuild } = (0, _build.buildTable)({
223
+ const { hasManyTextField: subHasManyTextField, hasManyNumberField: subHasManyNumberField, relationsToBuild: subRelationsToBuild } = (0, _build.buildTable)({
204
224
  adapter,
205
225
  baseColumns,
206
226
  baseExtraConfig,
@@ -213,6 +233,9 @@ const traverseFields = ({ adapter, buildNumbers, buildRelationships, columnPrefi
213
233
  rootTableName,
214
234
  tableName: arrayTableName
215
235
  });
236
+ if (subHasManyTextField) {
237
+ if (!hasManyTextField || subHasManyTextField === 'index') hasManyTextField = subHasManyTextField;
238
+ }
216
239
  if (subHasManyNumberField) {
217
240
  if (!hasManyNumberField || subHasManyNumberField === 'index') hasManyNumberField = subHasManyNumberField;
218
241
  }
@@ -261,7 +284,7 @@ const traverseFields = ({ adapter, buildNumbers, buildRelationships, columnPrefi
261
284
  baseColumns._locale = adapter.enums.enum__locales('_locale').notNull();
262
285
  baseExtraConfig._localeIdx = (cols)=>(0, _pgcore.index)('locale_idx').on(cols._locale);
263
286
  }
264
- const { hasManyNumberField: subHasManyNumberField, relationsToBuild: subRelationsToBuild } = (0, _build.buildTable)({
287
+ const { hasManyTextField: subHasManyTextField, hasManyNumberField: subHasManyNumberField, relationsToBuild: subRelationsToBuild } = (0, _build.buildTable)({
265
288
  adapter,
266
289
  baseColumns,
267
290
  baseExtraConfig,
@@ -274,6 +297,9 @@ const traverseFields = ({ adapter, buildNumbers, buildRelationships, columnPrefi
274
297
  rootTableName,
275
298
  tableName: blockTableName
276
299
  });
300
+ if (subHasManyTextField) {
301
+ if (!hasManyTextField || subHasManyTextField === 'index') hasManyTextField = subHasManyTextField;
302
+ }
277
303
  if (subHasManyNumberField) {
278
304
  if (!hasManyNumberField || subHasManyNumberField === 'index') hasManyNumberField = subHasManyNumberField;
279
305
  }
@@ -313,8 +339,9 @@ const traverseFields = ({ adapter, buildNumbers, buildRelationships, columnPrefi
313
339
  case 'group':
314
340
  {
315
341
  if (!('name' in field)) {
316
- const { hasLocalizedField: groupHasLocalizedField, hasLocalizedManyNumberField: groupHasLocalizedManyNumberField, hasLocalizedRelationshipField: groupHasLocalizedRelationshipField, hasManyNumberField: groupHasManyNumberField } = traverseFields({
342
+ const { hasLocalizedField: groupHasLocalizedField, hasLocalizedManyTextField: groupHasLocalizedManyTextField, hasLocalizedManyNumberField: groupHasLocalizedManyNumberField, hasLocalizedRelationshipField: groupHasLocalizedRelationshipField, hasManyTextField: groupHasManyTextField, hasManyNumberField: groupHasManyNumberField } = traverseFields({
317
343
  adapter,
344
+ buildTexts,
318
345
  buildNumbers,
319
346
  buildRelationships,
320
347
  columnPrefix,
@@ -337,13 +364,16 @@ const traverseFields = ({ adapter, buildNumbers, buildRelationships, columnPrefi
337
364
  });
338
365
  if (groupHasLocalizedField) hasLocalizedField = true;
339
366
  if (groupHasLocalizedRelationshipField) hasLocalizedRelationshipField = true;
367
+ if (groupHasManyTextField) hasManyTextField = true;
368
+ if (groupHasLocalizedManyTextField) hasLocalizedManyTextField = true;
340
369
  if (groupHasManyNumberField) hasManyNumberField = true;
341
370
  if (groupHasLocalizedManyNumberField) hasLocalizedManyNumberField = true;
342
371
  break;
343
372
  }
344
373
  const disableNotNullFromHere = Boolean(field.admin?.condition) || disableNotNull;
345
- const { hasLocalizedField: groupHasLocalizedField, hasLocalizedManyNumberField: groupHasLocalizedManyNumberField, hasLocalizedRelationshipField: groupHasLocalizedRelationshipField, hasManyNumberField: groupHasManyNumberField } = traverseFields({
374
+ const { hasLocalizedField: groupHasLocalizedField, hasLocalizedManyTextField: groupHasLocalizedManyTextField, hasLocalizedManyNumberField: groupHasLocalizedManyNumberField, hasLocalizedRelationshipField: groupHasLocalizedRelationshipField, hasManyTextField: groupHasManyTextField, hasManyNumberField: groupHasManyNumberField } = traverseFields({
346
375
  adapter,
376
+ buildTexts,
347
377
  buildNumbers,
348
378
  buildRelationships,
349
379
  columnPrefix: `${columnName}_`,
@@ -366,6 +396,8 @@ const traverseFields = ({ adapter, buildNumbers, buildRelationships, columnPrefi
366
396
  });
367
397
  if (groupHasLocalizedField) hasLocalizedField = true;
368
398
  if (groupHasLocalizedRelationshipField) hasLocalizedRelationshipField = true;
399
+ if (groupHasManyTextField) hasManyTextField = true;
400
+ if (groupHasLocalizedManyTextField) hasLocalizedManyTextField = true;
369
401
  if (groupHasManyNumberField) hasManyNumberField = true;
370
402
  if (groupHasLocalizedManyNumberField) hasLocalizedManyNumberField = true;
371
403
  break;
@@ -373,8 +405,9 @@ const traverseFields = ({ adapter, buildNumbers, buildRelationships, columnPrefi
373
405
  case 'tabs':
374
406
  {
375
407
  const disableNotNullFromHere = Boolean(field.admin?.condition) || disableNotNull;
376
- const { hasLocalizedField: tabHasLocalizedField, hasLocalizedManyNumberField: tabHasLocalizedManyNumberField, hasLocalizedRelationshipField: tabHasLocalizedRelationshipField, hasManyNumberField: tabHasManyNumberField } = traverseFields({
408
+ const { hasLocalizedField: tabHasLocalizedField, hasLocalizedManyTextField: tabHasLocalizedManyTextField, hasLocalizedManyNumberField: tabHasLocalizedManyNumberField, hasLocalizedRelationshipField: tabHasLocalizedRelationshipField, hasManyTextField: tabHasManyTextField, hasManyNumberField: tabHasManyNumberField } = traverseFields({
377
409
  adapter,
410
+ buildTexts,
378
411
  buildNumbers,
379
412
  buildRelationships,
380
413
  columnPrefix,
@@ -400,6 +433,8 @@ const traverseFields = ({ adapter, buildNumbers, buildRelationships, columnPrefi
400
433
  });
401
434
  if (tabHasLocalizedField) hasLocalizedField = true;
402
435
  if (tabHasLocalizedRelationshipField) hasLocalizedRelationshipField = true;
436
+ if (tabHasManyTextField) hasManyTextField = true;
437
+ if (tabHasLocalizedManyTextField) hasLocalizedManyTextField = true;
403
438
  if (tabHasManyNumberField) hasManyNumberField = true;
404
439
  if (tabHasLocalizedManyNumberField) hasLocalizedManyNumberField = true;
405
440
  break;
@@ -408,8 +443,9 @@ const traverseFields = ({ adapter, buildNumbers, buildRelationships, columnPrefi
408
443
  case 'collapsible':
409
444
  {
410
445
  const disableNotNullFromHere = Boolean(field.admin?.condition) || disableNotNull;
411
- const { hasLocalizedField: rowHasLocalizedField, hasLocalizedManyNumberField: rowHasLocalizedManyNumberField, hasLocalizedRelationshipField: rowHasLocalizedRelationshipField, hasManyNumberField: rowHasManyNumberField } = traverseFields({
446
+ const { hasLocalizedField: rowHasLocalizedField, hasLocalizedManyTextField: rowHasLocalizedManyTextField, hasLocalizedManyNumberField: rowHasLocalizedManyNumberField, hasLocalizedRelationshipField: rowHasLocalizedRelationshipField, hasManyTextField: rowHasManyTextField, hasManyNumberField: rowHasManyNumberField } = traverseFields({
412
447
  adapter,
448
+ buildTexts,
413
449
  buildNumbers,
414
450
  buildRelationships,
415
451
  columnPrefix,
@@ -432,6 +468,8 @@ const traverseFields = ({ adapter, buildNumbers, buildRelationships, columnPrefi
432
468
  });
433
469
  if (rowHasLocalizedField) hasLocalizedField = true;
434
470
  if (rowHasLocalizedRelationshipField) hasLocalizedRelationshipField = true;
471
+ if (rowHasManyTextField) hasManyTextField = true;
472
+ if (rowHasLocalizedManyTextField) hasLocalizedManyTextField = true;
435
473
  if (rowHasManyNumberField) hasManyNumberField = true;
436
474
  if (rowHasLocalizedManyNumberField) hasLocalizedManyNumberField = true;
437
475
  break;
@@ -457,10 +495,12 @@ const traverseFields = ({ adapter, buildNumbers, buildRelationships, columnPrefi
457
495
  });
458
496
  return {
459
497
  hasLocalizedField,
498
+ hasLocalizedManyTextField,
460
499
  hasLocalizedManyNumberField,
461
500
  hasLocalizedRelationshipField,
501
+ hasManyTextField,
462
502
  hasManyNumberField
463
503
  };
464
504
  };
465
505
 
466
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zY2hlbWEvdHJhdmVyc2VGaWVsZHMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcGFyYW0tcmVhc3NpZ24gKi9cbmltcG9ydCB0eXBlIHsgUmVsYXRpb24gfSBmcm9tICdkcml6emxlLW9ybSdcbmltcG9ydCB0eXBlIHsgSW5kZXhCdWlsZGVyLCBQZ0NvbHVtbkJ1aWxkZXIsIFVuaXF1ZUNvbnN0cmFpbnRCdWlsZGVyIH0gZnJvbSAnZHJpenpsZS1vcm0vcGctY29yZSdcbmltcG9ydCB0eXBlIHsgRmllbGQsIFRhYkFzRmllbGQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyByZWxhdGlvbnMgfSBmcm9tICdkcml6emxlLW9ybSdcbmltcG9ydCB7XG4gIFBnTnVtZXJpY0J1aWxkZXIsXG4gIFBnVmFyY2hhckJ1aWxkZXIsXG4gIGJvb2xlYW4sXG4gIGluZGV4LFxuICBpbnRlZ2VyLFxuICBqc29uYixcbiAgbnVtZXJpYyxcbiAgcGdFbnVtLFxuICB0ZXh0LFxuICB0aW1lc3RhbXAsXG4gIHZhcmNoYXIsXG59IGZyb20gJ2RyaXp6bGUtb3JtL3BnLWNvcmUnXG5pbXBvcnQgeyBJbnZhbGlkQ29uZmlndXJhdGlvbiB9IGZyb20gJ3BheWxvYWQvZXJyb3JzJ1xu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9XG5cbiAgICAgICAgICBpZiAoZmllbGQuaW5kZXgpIHtcbiAgICAgICAgICAgIGhhc01hbnlOdW1iZXJGaWVsZCA9ICdpbmRleCdcbiAgICAgICAgICB9IGVsc2UgaWYgKCFoYXNNYW55TnVtYmVyRmllbGQpIHtcbiAgICAgICAgICAgIGhhc01hbnlOdW1iZXJGaWVsZCA9IHRydWVcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZmllbGQudW5pcXVlKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZENvbmZpZ3VyYXRpb24oXG4gICAgICAgICAgICAgICdVbmlxdWUgaXMgbm90IHN1cHBvcnRlZCBpbiBQb3N0Z3JlcyBmb3IgaGFzTWFueSBudW1iZXIgZmllbGRzLicsXG4gICAgICAgICAgICApXG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRhcmdldFRhYmxlW2ZpZWxkTmFtZV0gPSBudW1lcmljKGNvbHVtbk5hbWUpXG4gICAgICAgIH1cbiAgICAgICAgYnJlYWtcbiAgICAgIH1cblxuICAgICAgY2FzZSAncmljaFRleHQnOlxuICAgICAgY2FzZSAnanNvbic6IHtcbiAgICAgICAgdGFyZ2V0VGFibGVbZmllbGROYW1lXSA9IGpzb25iKGNvbHVtbk5hbWUpXG4gICAgICAgIGJyZWFrXG4gICAgICB9XG5cbiAgICAgIGNhc2UgJ2RhdGUnOiB7XG4gICAgICAgIHRhcmdldFRhYmxlW2ZpZWxkTmFtZV0gPSB0aW1lc3RhbXAoY29sdW1uTmFtZSwge1xuICAgICAgICAgIG1vZGU6ICdzdHJpbmcnLFxuICAgICAgICAgIHByZWNpc2lvbjogMyxcbiAgICAgICAgICB3aXRoVGltZXpvbmU6IHRydWUsXG4gICAgICAgIH0pXG4gICAgICAgIGJyZWFrXG4gICAgICB9XG5cbiAgICAgIGNhc2UgJ3BvaW50Jzoge1xuICAgICAgICBicmVha1xuICAgICAgfVxuXG4gICAgICBjYXNlICdyYWRpbyc6XG4gICAgICBjYXNlICdzZWxlY3QnOiB7XG4gICAgICAgIGNvbnN0IGVudW1OYW1lID0gYGVudW1fJHtuZXdUYWJsZU5hbWV9XyR7dG9TbmFrZUNhc2UoZmllbGQubmFtZSl9YFxuXG4gICAgICAgIGFkYXB0ZXIuZW51bXNbZW51bU5hbWVdID0gcGdFbnVtKFxuICAgICAgICAgIGVudW1OYW1lLFxuICAgICAgICAgIGZpZWxkLm9wdGlvbnMubWFwKChvcHRpb24pID0+IHtcbiAgICAgICAgICAgIGlmIChvcHRpb25Jc09iamVjdChvcHRpb24pKSB7XG4gICAgICAgICAgICAgIHJldHVybiBvcHRpb24udmFsdWVcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIG9wdGlvblxuICAgICAgICAgIH0pIGFzIFtzdHJpbmcsIC4uLnN0cmluZ1tdXSxcbiAgICAgICAgKVxuXG4gICAgICAgIGlmIChmaWVsZC50eXBlID09PSAnc2VsZWN0JyAmJiBmaWVsZC5oYXNNYW55KSB7XG4gICAgICAgICAgY29uc3Qgc2VsZWN0VGFibGVOYW1lID0gYCR7bmV3VGFibGVOYW1lfV8ke3RvU25ha2VDYXNlKGZpZWxkLm5hbWUpfWBcbiAgICAgICAgICBjb25zdCBiYXNlQ29sdW1uczogUmVjb3JkPHN0cmluZywgUGdDb2x1bW5CdWlsZGVyPiA9IHtcbiAgICAgICAgICAgIG9yZGVyOiBpbnRlZ2VyKCdvcmRlcicpLm5vdE51bGwoKSxcbiAgICAgICAgICAgIHBhcmVudDogcGFyZW50SURDb2x1bW5NYXBbcGFyZW50SURDb2xUeXBlXSgncGFyZW50X2lkJylcbiAgICAgICAgICAgICAgLnJlZmVyZW5jZXMoKCkgPT4gYWRhcHRlci50YWJsZXNbcGFyZW50VGFibGVOYW1lXS5pZCwgeyBvbkRlbGV0ZTogJ2Nhc2NhZGUnIH0pXG4gICAgICAgICAgICAgIC5ub3ROdWxsKCksXG4gICAgICAgICAgICB2YWx1ZTogYWRhcHRlci5lbnVtc1tlbnVtTmFtZV0oJ3ZhbHVlJyksXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY29uc3QgYmFzZUV4dHJhQ29uZmlnOiBSZWNvcmQ8XG4gICAgICAgICAgICBzdHJpbmcsXG4gICAgICAgICAgICAoY29sczogR2VuZXJpY0NvbHVtbnMpID0+IEluZGV4QnVpbGRlciB8IFVuaXF1ZUNvbnN0cmFpbnRCdWlsZGVyXG4gICAgICAgICAgPiA9IHtcbiAgICAgICAgICAgIG9yZGVySWR4OiAoY29scykgPT4gaW5kZXgoJ29yZGVyX2lkeCcpLm9uKGNvbHMub3JkZXIpLFxuICAgICAgICAgICAgcGFyZW50SWR4OiAoY29scykgPT4gaW5kZXgoJ3BhcmVudF9pZHgnKS5vbihjb2xzLnBhcmVudCksXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCkge1xuICAgICAgICAgICAgYmFzZUNvbHVtbnMubG9jYWxlID0gYWRhcHRlci5lbnVtcy5lbnVtX19sb2NhbGVzKCdsb2NhbGUnKS5ub3ROdWxsKClcbiAgICAgICAgICAgIGJhc2VFeHRyYUNvbmZpZy5sb2NhbGVJZHggPSAoY29scykgPT4gaW5kZXgoJ2xvY2FsZV9pZHgnKS5vbihjb2xzLmxvY2FsZSlcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZmllbGQuaW5kZXgpIHtcbiAgICAgICAgICAgIGJhc2VFeHRyYUNvbmZpZy52YWx1ZSA9IChjb2xzKSA9PiBpbmRleCgndmFsdWVfaWR4Jykub24oY29scy52YWx1ZSlcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBidWlsZFRhYmxlKHtcbiAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICBiYXNlQ29sdW1ucyxcbiAgICAgICAgICAgIGJhc2VFeHRyYUNvbmZpZyxcbiAgICAgICAgICAgIGRpc2FibGVOb3ROdWxsLFxuIC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5VGFibGVOYW1lLFxuICAgICAgICAgIH0pXG5cbiAgICAgICAgaWYgKHN1Ykhhc01hbnlOdW1iZXJGaWVsZCkge1xuICAgICAgICAgIGlmICghaGFzTWFueU51bWJlckZpZWxkIHx8IHN1Ykhhc01hbnlOdW1iZXJGaWVsZCA9PT0gJ2luZGV4JylcbiAgICAgICAgICAgIGhhc01hbnlOdW1iZXJGaWVsZCA9IHN1Ykhhc01hbnlOdW1iZXJGaWVsZFxuICAgICAgICB9XG5cbiAgICAgICAgcmVsYXRpb25zVG9CdWlsZC5zZXQoZmllbGROYW1lLCBhcnJheVRhYmxlTmFtZSlcblxuICAgICAgICBjb25zdCBhcnJheVRhYmxlUmVsYXRpb25zID0gcmVsYXRpb25zKGFkYXB0ZXIudGFibGVzW2FycmF5VGFibGVOYW1lXSwgKHsgbWFueSwgb25lIH0pID0+IHtcbiAgICAgICAgICBjb25zdCByZXN1bHQ6IFJlY29yZDxzdHJpbmcsIFJlbGF0aW9uPHN0cmluZz4+ID0ge1xuICAgICAgICAgICAgX3BhcmVudElEOiBvbmUoYWRhcHRlci50YWJsZXNbcGFyZW50VGFibGVOYW1lXSwge1xuICAgICAgICAgICAgICBmaWVsZHM6IFthZGFwdGVyLnRhYmxlc1thcnJheVRhYmxlTmFtZV0uX3BhcmVudElEXSxcbiAgICAgICAgICAgICAgcmVmZXJlbmNlczogW2FkYXB0ZXIudGFibGVzW3BhcmVudFRhYmxlTmFtZV0uaWRdLFxuICAgICAgICAgICAgfSksXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKGhhc0xvY2FsZXNUYWJsZShmaWVsZC5maWVsZHMpKSB7XG4gICAgICAgICAgICByZXN1bHQuX2xvY2FsZXMgPSBtYW55KGFkYXB0ZXIudGFibGVzW2Ake2FycmF5VGFibGVOYW1lfV9sb2NhbGVzYF0pXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgc3ViUmVsYXRpb25zVG9CdWlsZC5mb3JFYWNoKCh2YWwsIGtleSkg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AgICAgICAgICAgIF9wYXRoOiB0ZXh0KCdfcGF0aCcpLm5vdE51bGwoKSxcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29uc3QgYmFzZUV4dHJhQ29uZmlnOiBSZWNvcmQ8XG4gICAgICAgICAgICAgIHN0cmluZyxcbiAgICAgICAgICAgICAgKGNvbHM6IEdlbmVyaWNDb2x1bW5zKSA9PiBJbmRleEJ1aWxkZXIgfCBVbmlxdWVDb25zdHJhaW50QnVpbGRlclxuICAgICAgICAgICAgPiA9IHtcbiAgICAgICAgICAgICAgX29yZGVySWR4OiAoY29scykgPT4gaW5kZXgoJ29yZGVyX2lkeCcpLm9uKGNvbHMuX29yZGVyKSxcbiAgICAgICAgICAgICAgX3BhcmVudElESWR4OiAoY29scykgPT4gaW5kZXgoJ3BhcmVudF9pZF9pZHgnKS5vbihjb2xzLl9wYXJlbnRJRCksXG4gICAgICAgICAgICAgIF9wYXRoSWR4OiAoY29scykgPT4gaW5kZXgoJ3BhdGhfaWR4Jykub24oY29scy5fcGF0aCksXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQgJiYgYWRhcHRlci5wYXlsb2FkLmNvbmZpZy5sb2NhbGl6YXRpb24pIHtcbiAgICAgICAgICAgICAgYmFzZUNvbHVtbnMuX2xvY2FsZSA9IGFkYXB0ZXIuZW51bXMuZW51bV9fbG9jYWxlcygnX2xvY2FsZScpLm5vdE51bGwoKVxuICAgICAgICAgICAgICBiYXNlRXh0cmFDb25maWcuX2xvY2FsZUlkeCA9IChjb2xzKSA9PiBpbmRleCgnbG9jYWxlX2lkeCcpLm9uKGNvbHMuX2xvY2FsZSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29uc3Qge1xuICAgICAgICAgICAgICBoYXNNYW55TnVtYmVyRmllbGQ6IHN1Ykhhc01hbnlOdW1iZXJGaWVsZCxcbiAgICAgICAgICAgICAgcmVsYXRpb25zVG9CdWlsZDogc3ViUmVsYXRpb25zVG9CdWlsZCxcbiAgICAgICAgICAgIH0gPSBidWlsZFRhYmxlKHtcbiAgICAgICAgICAgICAgYWRhcHRlcixcbiAgICAgICAgICAgICAgYmFzZUNvbHVtbnMsXG4gICAgICAgICAgICAgIGJhc2VFeHRyYUNvbmZpZyxcbiAgICAgICAgICAgICAgZGlzYWJsZU5vdE51bGw6IGRpc2FibGVOb3ROdWxsRnJvbUhlcmUsXG4gICAgICAgICAgICAgIGRpc2FibGVVbmlxdWUsXG4gICAgICAgICAgICAgIGZpZWxkczogZGlzYWJsZVVuaXF1ZSA/IGlkVG9VVUlEKGJsb2NrLmZpZWxkcykgOiBibG9jay5maWVsZHMsXG4gICAgICAgICAgICAgIHJvb3RSZWxhdGlvbnNUb0J1aWxkLFxuICAgICAgICAgICAgICByb290UmVsYXRpb25zaGlwczogcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgcm9vdFRhYmxlSURDb2xUeXBlLFxuICAgICAgICAgICAgICByb290VGFibGVOYW1lLFxuICAgICAgICAgICAgICB0YWJsZU5hbWU6IGJsb2NrVGFibGVOYW1lLFxuICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgaWYgKHN1Ykhhc01hbnlOdW1iZXJGaWVsZCkge1xuICAgICAgICAgICAgICBpZiAoIWhhc01hbnlOdW1iZXJGaWVsZCB8fCBzdWJIYXNNYW55TnVtYmVyRmllbGQgPT09ICdpbmRleCcpXG4gICAgICAgICAgICAgICAgaGFzTWFueU51bWJlckZpZWxkID0gc3ViSGFzTWFueU51bWJlckZpZWxkXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGNvbnN0IGJsb2NrVGFibGVSZWxhdGlvbnMgPSByZWxhdGlvbnMoXG4gICAgICAgICAgICAgIGFkYXB0ZXIudGFibGVzW2Jsb2NrVGFibGVOYW1lXSxcbiAgICAgICAgICAgICAgKHsgbWFueSwgb25lIH0pID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCByZXN1bHQ6IFJlY29yZDxzdHJpbmcsIFJlbGF0aW9uPHN0cmluZz4+ID0ge1xuICAgICAgICAgICAgICAgICAgX3BhcmVudElEOiBvbmUoYWRhcHRlci50YWJsZXNbcm9vdFRhYmxlTmFtZV0sIHtcbiAgICAgICAgICAgICAgICAgICAgZmllbGRzOiBbYWRhcHRlci50YWJsZXNbYmxvY2tUYWJsZU5hbWVdLl9wYXJlbnRJRF0sXG4gICAgICAgICAgICAgICAgICAgIHJlZmVyZW5jZXM6IFthZGFwdGVyLnRhYmxlc1tyb290VGFibGVOYW1lXS5pZF0sXG4gICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoaGFzTG9jYWxlc1RhYmxlKGJsb2NrLmZpZWxkcykpIHtcbiAgICAgICAgICAgICAgICAgIHJlc3VsdC5fbG9jYWxlcyA9IG1hbnkoYWRhcHRlci50YWJsZXNbYCR7YmxvY2tUYWJsZU5hbWV9X2xvY2FsZXNgXSlcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBzdWJSZWxhdGlvbnNUb0J1aWxkLmZvckVhY2goKHZhbCwga2V5KSA9PiB7XG4gICAgICAgICAgICAgICAgICByZXN1bHRba2V5XSA9IG1hbnkoYWRhcHRlci50YWJsZXNbdmFsXSlcbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgKVxuXG4gICAgICAgICAgICBhZGFwdGVyLnJlbGF0aW9uc1tgcmVsYXRpb25zXyR7YmxvY2tUYWJsZU5hbWV9YF0gPSBibG9ja1RhYmxlUmVsYXRpb25zXG4gICAgICAgICAgfSBlbHNlIGlmIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB7XG4gICAgICAgICAgICB2YWxpZGF0ZUV4aXN0aW5nQmxvY2tJc0lkZW50aW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WJlckZpZWxkOiB0YWJIYXNNYW55TnVtYmVyRmllbGQsXG4gICAgICAgIH0gPSB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgICAgYWRhcHRlcixcbiAgICAgICAgICBidWlsZE51bWJlcnMsXG4gICAgICAgICAgYnVpbGRSZWxhdGlvbnNoaXBzLFxuICAgICAgICAgIGNvbHVtblByZWZpeCxcbiAgICAgICAgICBjb2x1bW5zLFxuICAgICAgICAgIGRpc2FibGVOb3ROdWxsOiBkaXNhYmxlTm90TnVsbEZyb21IZXJlLFxuICAgICAgICAgIGRpc2FibGVVbmlxdWUsXG4gICAgICAgICAgZmllbGRQcmVmaXgsXG4gICAgICAgICAgZmllbGRzOiBmaWVsZC50YWJzLm1hcCgodGFiKSA9PiAoeyAuLi50YWIsIHR5cGU6ICd0YWInIH0pKSxcbiAgICAgICAgICBmb3JjZUxvY2FsaXplZCxcbiAgICAgICAgICBpbmRleGVzLFxuICAgICAgICAgIGxvY2FsZXNDb2x1bW5zLFxuICAgICAgICAgIGxvY2FsZXNJbmRleGVzLFxuICAgICAgICAgIG5ld1RhYmxlTmFtZSxcbiAgICAgICAgICBwYXJlbnRUYWJsZU5hbWUsXG4gICAgICAgICAgcmVsYXRpb25zVG9CdWlsZCxcbiAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgIHJvb3RSZWxhdGlvbnNUb0J1aWxkLFxuICAgICAgICAgIHJvb3RUYWJsZUlEQ29sVHlwZSxcbiAgICAgICAgICByb290VGFibGVOYW1lLFxuICAgICAgICB9KVxuXG4gICAgICAgIGlmICh0YWJIYXNMb2NhbGl6ZWRGaWVsZCkgaGFzTG9jYWxpemVkRmllbGQgPSB0cnVlXG4gICAgICAgIGlmICh0YWJIYXNMb2NhbGl6ZWRSZWxhdGlvbnNoaXBGaWVsZCkgaGFzTG9jYWxpemVkUmVsYXRpb25zaGlwRmllbGQgPSB0cnVlXG4gICAgICAgIGlmICh0YWJIYXNNYW55TnVtYmVyRmllbG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ZWxkUHJlZml4IHx8ICcnfSR7ZmllbGQubmFtZX1gXG4gICAgICAgICAgaWYgKCFhZGFwdGVyLmZpZWxkQ29uc3RyYWludHM/Lltyb290VGFibGVOYW1lXSkge1xuICAgICAgICAgICAgYWRhcHRlci5maWVsZENvbnN0cmFpbnRzW3Jvb3RUYWJsZU5hbWVdID0ge31cbiAgICAgICAgICB9XG4gICAgICAgICAgYWRhcHRlci5maWVsZENvbnN0cmFpbnRzW3Jvb3RUYWJsZU5hbWVdW2Ake2NvbHVtbk5hbWV9X2lkeGBdID0gY29uc3RyYWludFZhbHVlXG4gICAgICAgIH1cbiAgICAgICAgdGFyZ2V0SW5kZXhlc1tgJHtmaWVsZC5uYW1lfUlkeGBdID0gY3JlYXRlSW5kZXgoe1xuICAgICAgICAgIG5hbWU6IGZpZWxkTmFtZSxcbiAgICAgICAgICBjb2x1bW5OYW1lLFxuICAgICAgICAgIHVuaXF1ZSxcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9XG5cbiAgICBzd2l0Y2ggKGZpZWxkLnR5cGUpIHtcbiAgICAgIGNhc2UgJ3RleHQnOiB7XG4gICAgICAgIGlmIChmaWVsZC5oYXNNYW55KSB7XG4gICAgICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCkge1xuICAgICAgICAgICAgaGFzTG9jYWxpemVkTWFueVRleHRGaWVsZCA9IHRydWVcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZmllbGQuaW5kZXgpIHtcbiAgICAgICAgICAgIGhhc01hbnlUZXh0RmllbGQgPSAnaW5kZXgnXG4gICAgICAgICAgfSBlbHNlIGlmICghaGFzTWFueVRleHRGaWVsZCkge1xuICAgICAgICAgICAgaGFzTWFueVRleHRGaWVsZCA9IHRydWVcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZmllbGQudW5pcXVlKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZENvbmZpZ3VyYXRpb24oXG4gICAgICAgICAgICAgICdVbmlxdWUgaXMgbm90IHN1cHBvcnRlZCBpbiBQb3N0Z3JlcyBmb3IgaGFzTWFueSB0ZXh0IGZpZWxkcy4nLFxuICAgICAgICAgICAgKVxuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0YXJnZXRUYWJsZVtmaWVsZE5hbWVdID0gdmFyY2hhcihjb2x1bW5OYW1lKVxuICAgICAgICB9XG4gICAgICAgIGJyZWFrXG4gICAgICB9XG4gICAgICBjYXNlICdlbWFpbCc6XG4gICAgICBjYXNlICdjb2RlJzpcbiAgICAgIGNhc2UgJ3RleHRhcmVhJzoge1xuICAgICAgICB0YXJnZXRUYWJsZVtmaWVsZE5hbWVdID0gdmFyY2hhcihjb2x1bW5OYW1lKVxuICAgICAgICBicmVha1xuICAgICAgfVxuXG4gICAgICBjYXNlICdudW1iZXInOiB7XG4gICAgICAgIGlmIChmaWVsZC5oYXNNYW55KSB7XG4gICAgICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCkge1xuICAgICAgICAgICAgaGFzTG9jYWxpemVkTWFueU51bWJlckZpZWxkID0gdHJ1ZVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChmaWVsZC5pbmRleCkge1xuICAgICAgICAgICAgaGFzTWFueU51bWJlckZpZWxkID0gJ2luZGV4J1xuICAgICAgICAgIH0gZWxzZSBpZiAoIWhhc01hbnlOdW1iZXJGaWVsZCkge1xuICAgICAgICAgICAgaGFzTWFueU51bWJlckZpZWxkID0gdHJ1ZVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChmaWVsZC51bmlxdWUpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkQ29uZmlndXJhdGlvbihcbiAgICAgICAgICAgICAgJ1VuaXF1ZSBpcyBub3Qgc3VwcG9ydGVkIGluIFBvc3RncmVzIGZvciBoYXNNYW55IG51bWJlciBmaWVsZHMuJyxcbiAgICAgICAgICAgIClcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGFyZ2V0VGFibGVbZmllbGROYW1lXSA9IG51bWVyaWMoY29sdW1uTmFtZSlcbiAgICAgICAgfVxuICAgICAgICBicmVha1xuICAgICAgfVxuXG4gICAgICBjYXNlICdyaWNoVGV4dCc6XG4gICAgICBjYXNlICdqc29uJzoge1xuICAgICAgICB0YXJnZXRUYWJsZVtmaWVsZE5hbWVdID0ganNvbmIoY29sdW1uTmFtZSlcbiAgICAgICAgYnJlYWtcbiAgICAgIH1cblxuICAgICAgY2FzZSAnZGF0ZSc6IHtcbiAgICAgICAgdGFyZ2V0VGFibGVbZmllbGROYW1lXSA9IHRpbWVzdGFtcChjb2x1bW5OYW1lLCB7XG4gICAgICAgICAgbW9kZTogJ3N0cmluZycsXG4gICAgICAgICAgcHJlY2lzaW9uOiAzLFxuICAgICAgICAgIHdpdGhUaW1lem9uZTogdHJ1ZSxcbiAgICAgICAgfSlcbiAgICAgICAgYnJlYWtcbiAgICAgIH1cblxuICAgICAgY2FzZSAncG9pbnQnOiB7XG4gICAgICAgIGJyZWFrXG4gICAgICB9XG5cbiAgICAgIGNhc2UgJ3JhZGlvJzpcbiAgICAgIGNhc2UgJ3NlbGVjdCc6IHtcbiAgICAgICAgY29uc3QgZW51bU5hbWUgPSBgZW51bV8ke25ld1RhYmxlTmFtZX1fJHt0b1NuYWtlQ2FzZShmaWVsZC5uYW1lKX1gXG5cbiAgICAgICAgYWRhcHRlci5lbnVtc1tlbnVtTmFtZV0gPSBwZ0VudW0oXG4gICAgICAgICAgZW51bU5hbWUsXG4gICAgICAgICAgZmllbGQub3B0aW9ucy5tYXAoKG9wdGlvbikgPT4ge1xuICAgICAgICAgICAgaWYgKG9wdGlvbklzT2JqZWN0KG9wdGlvbikpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIG9wdGlvbi52YWx1ZVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gb3B0aW9uXG4gICAgICAgICAgfSkg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KSxcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZmllbGQubG9jYWxpemVkKSB7XG4gICAgICAgICAgICBiYXNlQ29sdW1ucy5sb2NhbGUgPSBhZGFwdGVyLmVudW1zLmVudW1fX2xvY2FsZXMoJ2xvY2FsZScpLm5vdE51bGwoKVxuICAgICAgICAgICAgYmFzZUV4dHJhQ29uZmlnLmxvY2FsZUlkeCA9IChjb2xzKSA9PiBpbmRleCgnbG9jYWxlX2lkeCcpLm9uKGNvbHMubG9jYWxlKVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChmaWVsZC5pbmRleCkge1xuICAgICAgICAgICAgYmFzZUV4dHJhQ29uZmlnLnZhbHVlID0gKGNvbHMpID0+IGluZGV4KCd2YWx1ZV9pZHgnKS5vbihjb2xzLnZhbHVlKVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGJ1aWxkVGFibGUoe1xuICAgICAgICAgICAgYWRhcHRlcixcbiAgICAgICAgICAgIGJhc2VDb2x1bW5zLFxuICAgICAgICAgICAgYmFzZUV4dHJhQ29uZmlnLFxuICAgICAgICAgICAgZGlzYWJsZU5vdE51bGwsXG4gICAgICAgICAgICBkaXNhYmxlVW5pcXVlLFxuICAgICAgICAgICAgZmllbGRzOiBbXSxcbiAgICAgICAgICAgIHRhYmxlTmFtZTogc2VsZWN0VGFibGVOYW1lLFxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICByZWxhdGlvbnNUb0J1aWxkLnNldChmaWVsZE5hbWUsIHNlbGVjdFRhYmxlTmFtZSlcblxuICAgICAgICAgIGNvbnN0IHNlbGVjdFRhYmxlUmVsYXRpb25zID0gcmVsYXRpb25zKGFkYXB0ZXIudGFibGVzW3NlbGVjdFRhYmxlTmFtZV0sICh7IG9uZSB9KSA9PiB7XG4gICAgICAgICAgICBjb25zdCByZXN1bHQ6IFJlY29yZDxzdHJpbmcsIFJlbGF0aW9uPHN0cmluZz4+ID0ge1xuICAgICAgICAgICAgICBwYXJlbnQ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cmRlcjogaW50ZWdlcignX29yZGVyJykubm90TnVsbCgpLFxuICAgICAgICAgIF9wYXJlbnRJRDogcGFyZW50SURDb2x1bW5NYXBbcGFyZW50SURDb2xUeXBlXSgnX3BhcmVudF9pZCcpXG4gICAgICAgICAgICAucmVmZXJlbmNlcygoKSA9PiBhZGFwdGVyLnRhYmxlc1twYXJlbnRUYWJsZU5hbWVdLmlkLCB7IG9uRGVsZXRlOiAnY2FzY2FkZScgfSlcbiAgICAgICAgICAgIC5ub3ROdWxsKCksXG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBiYXNlRXh0cmFDb25maWc6IFJlY29yZDxcbiAgICAgICAgICBzdHJpbmcsXG4gICAgICAgICAgKGNvbHM6IEdlbmVyaWNDb2x1bW5zKSA9PiBJbmRleEJ1aWxkZXIgfCBVbmlxdWVDb25zdHJhaW50QnVpbGRlclxuICAgICAgICA+ID0ge1xuICAgICAgICAgIF9vcmRlcklkeDogKGNvbHMpID0+IGluZGV4KCdfb3JkZXJfaWR4Jykub24oY29scy5fb3JkZXIpLFxuICAgICAgICAgIF9wYXJlbnRJRElkeDogKGNvbHMpID0+IGluZGV4KCdfcGFyZW50X2lkX2lkeCcpLm9uKGNvbHMuX3BhcmVudElEKSxcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQgJiYgYWRhcHRlci5wYXlsb2FkLmNvbmZpZy5sb2NhbGl6YXRpb24pIHtcbiAgICAgICAgICBiYXNlQ29sdW1ucy5fbG9jYWxlID0gYWRhcHRlci5lbnVtcy5lbnVtX19sb2NhbGVzKCdfbG9jYWxlJykubm90TnVsbCgpXG4gICAgICAgICAgYmFzZUV4dHJhQ29uZmlnLl9sb2NhbGVJZHggPSAoY29scykgPT4gaW5kZXgoJ19sb2NhbGVfaWR4Jykub24oY29scy5fbG9jYWxlKVxuICAgICAgICB9XG5cbiAgICAgICAgY29uc3Qge1xuICAgICAgICAgIGhhc01hbnlUZXh0RmllbGQ6IHN1Ykhhc01hbnlUZXh0RmllbGQsXG4gICAgICAgICAgaGFzTWFueU51bWJlckZpZWxkOiBzdWJIYXNNYW55TnVtYmVyRmllbGQsXG4gICAgICAgICAgcmVsYXRpb25zVG9CdWlsZDogc3ViUmVsYXRpb25zVG9CdWlsZCxcbiAgICAgICAgfSA9IGJ1aWxkVGFibGUoe1xuICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgYmFzZUNvbHVtbnMsXG4gICAgICAgICAgYmFzZUV4dHJhQ29uZmlnLFxuICAgICAgICAgIGRpc2FibGVOb3ROdWxsOiBkaXNhYmxlTm90TnVsbEZyb21IZXJlLFxuICAgICAgICAgIGRpc2FibGVVbmlxdWUsXG4gICAgICAgICAgZmllbGRzOiBkaXNhYmxlVW5pcXVlID8gaWRUb1VVSUQoZmllbGQuZmllbGRzKSA6IGZpZWxkLmZpZWxkcyxcbiAgICAgICAgICByb290UmVsYXRpb25zVG9CdWlsZCxcbiAgICAgICAgICByb290UmVsYXRpb25zaGlwczogcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICByb290VGFibGVJRENvbFR5cGUsXG4gICAgICAgICAgcm9vdFRhYmxlTmFtZSxcbiAgICAgICAgICB0YWJsZU5hbWU6IGFycmF5VGFibGVOYW1lLFxuICAgICAgICB9KVxuXG4gICAgICAgIGlmIChzdWJIYXNNYW55VGV4dEZpZWxkKSB7XG4gICAgICAgICAgaWYgKCFoYXNNYW55VGV4dEZpZWxkIHx8IHN1Ykhhc01hbnlUZXh0RmllbGQgPT09ICdpbmRleCcpXG4gICAgICAgICAgICBoYXNNYW55VGV4dEZpZWxkID0gc3ViSGFzTWFueVRleHRGaWVsZFxuICAgICAgICB9XG4gICAgICAgIGlmIChzdWJIYXNNYW55TnVtYmVyRmllbGQpIHtcbiAgICAgICAgICBpZiAoIWhhc01hbnlOdW1iZXJGaWVsZCB8fCBzdWJIYXNNYW55TnVtYmVyRmllbGQgPT09ICdpbmRleCcpXG4gICAgICAgICAgICBoYXNN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ICAgICAgICAgIChjb2xzOiBHZW5lcmljQ29sdW1ucykgPT4gSW5kZXhCdWlsZGVyIHwgVW5pcXVlQ29uc3RyYWludEJ1aWxkZXJcbiAgICAgICAgICAgID4gPSB7XG4gICAgICAgICAgICAgIF9vcmRlcklkeDogKGNvbHMpID0+IGluZGV4KCdvcmRlcl9pZHgnKS5vbihjb2xzLl9vcmRlciksXG4gICAgICAgICAgICAgIF9wYXJlbnRJRElkeDogKGNvbHMpID0+IGluZGV4KCdwYXJlbnRfaWRfaWR4Jykub24oY29scy5fcGFyZW50SUQpLFxuICAgICAgICAgICAgICBfcGF0aElkeDogKGNvbHMpID0+IGluZGV4KCdwYXRoX2lkeCcpLm9uKGNvbHMuX3BhdGgpLFxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoZmllbGQubG9jYWxpemVkICYmIGFkYXB0ZXIucGF5bG9hZC5jb25maWcubG9jYWxpemF0aW9uKSB7XG4gICAgICAgICAgICAgIGJhc2VDb2x1bW5zLl9sb2NhbGUgPSBhZGFwdGVyLmVudW1zLmVudW1fX2xvY2FsZXMoJ19sb2NhbGUnKS5ub3ROdWxsKClcbiAgICAgICAgICAgICAgYmFzZUV4dHJhQ29uZmlnLl9sb2NhbGVJZHggPSAoY29scykgPT4gaW5kZXgoJ2xvY2FsZV9pZHgnKS5vbihjb2xzLl9sb2NhbGUpXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGNvbnN0IHtcbiAgICAgICAgICAgICAgaGFzTWFueVRleHRGaWVsZDogc3ViSGFzTWFueVRleHRGaWVsZCxcbiAgICAgICAgICAgICAgaGFzTWFueU51bWJlckZpZWxkOiBzdWJIYXNNYW55TnVtYmVyRmllbGQsXG4gICAgICAgICAgICAgIHJlbGF0aW9uc1RvQnVpbGQ6IHN1YlJlbGF0aW9uc1RvQnVpbGQsXG4gICAgICAgICAgICB9ID0gYnVpbGRUYWJsZSh7XG4gICAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICAgIGJhc2VDb2x1bW5zLFxuICAgICAgICAgICAgICBiYXNlRXh0cmFDb25maWcsXG4gICAgICAgICAgICAgIGRpc2FibGVOb3ROdWxsOiBkaXNhYmxlTm90TnVsbEZyb21IZXJlLFxuICAgICAgICAgICAgICBkaXNhYmxlVW5pcXVlLFxuICAgICAgICAgICAgICBmaWVsZHM6IGRpc2FibGVVbmlxdWUgPyBpZFRvVVVJRChibG9jay5maWVsZHMpIDogYmxvY2suZmllbGRzLFxuICAgICAgICAgICAgICByb290UmVsYXRpb25zVG9CdWlsZCxcbiAgICAgICAgICAgICAgcm9vdFJlbGF0aW9uc2hpcHM6IHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgICAgIHJvb3RUYWJsZUlEQ29sVHlwZSxcbiAgICAgICAgICAgICAgcm9vdFRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgdGFibGVOYW1lOiBibG9ja1RhYmxlTmFtZSxcbiAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgIGlmIChzdWJIYXNNYW55VGV4dEZpZWxkKSB7XG4gICAgICAgICAgICAgIGlmICghaGFzTWFueVRleHRGaWVsZCB8fCBzdWJIYXNNYW55VGV4dEZpZWxkID09PSAnaW5kZXgnKVxuICAgICAgICAgICAgICAgIGhhc01hbnlUZXh0RmllbGQgPSBzdWJIYXNNYW55VGV4dEZpZWxkXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChzdWJIYXNNYW55TnVtYmVyRmllbGQpIHtcbiAgICAgICAgICAgICAgaWYgKCFoYXNNYW55TnVtYmVyRmllbGQgfHwgc3ViSGFzTWFueU51bWJlckZpZWxkID09PSAnaW5kZXgnKVxuICAgICAgICAgICAgICAgIGhhc01hbnlOdW1iZXJGaWVsZCA9IHN1Ykhhc01hbnlOdW1iZXJGaWVsZFxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb25zdCBibG9ja1RhYmxlUmVsYXRpb25zID0gcmVsYXRpb25zKFxuICAgICAgICAgICAgICBhZGFwdGVyLnRhYmxlc1tibG9ja1RhYmxlTmFtZV0sXG4gICAgICAgICAgICAgICh7IG1hbnksIG9uZSB9KSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgcmVzdWx0OiBSZWNvcmQ8c3RyaW5nLCBSZWxhdGlvbjxzdHJpbmc+PiA9IHtcbiAgICAgICAgICAgICAgICAgIF9wYXJlbnRJRDogb25lKGFkYXB0ZXIudGFibGVzW3Jvb3RUYWJsZU5hbWVdLCB7XG4gICAgICAgICAgICAgICAgICAgIGZpZWxkczogW2FkYXB0ZXIudGFibGVzW2Jsb2NrVGFibGVOYW1lXS5fcGFyZW50SURdLFxuICAgICAgICAgICAgICAgICAgICByZWZlcmVuY2VzOiBbYWRhcHRlci50YWJsZXNbcm9vdFRhYmxlTmFtZV0uaWRdLFxuICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGhhc0xvY2FsZXNUYWJsZShibG9jay5maWVsZHMpKSB7XG4gICAgICAgICAgICAgICAgICByZXN1bHQuX2xvY2FsZXMgPSBtYW55KGFkYXB0ZXIudGFibGVzW2Ake2Jsb2NrVGFibGVOYW1lfV9sb2NhbGVzYF0pXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgc3ViUmVsYXRpb25zVG9CdWlsZC5mb3JFYWNoKCh2YWwsIGtleSkgPT4ge1xuICAgICAgICAgICAgICAgICAgcmVzdWx0W2tleV0gPSBtYW55KGFkYXB0ZXIudGFibGVzW3ZhbF0pXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIClcblxuICAgICAgICAgICAgYWRhcHRlci5yZWxhdGlvbnNbYHJlbGF0aW9uc18ke2Jsb2NrVGFibGVOYW1lfWBdID0gYmxvY2tUYWJsZVJlbGF0aW9uc1xuICAgICAgICAgIH0gZWxzZSBpZiAocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykge1xuICAgICAgICAgICAgdmFsaWRhdGVFeGlzdGluZ0Jsb2NrSXNJZGVudGljYWwoe1xuICAgICAgICAgICAgICBibG9jayxcbiAgICAgICAgICAgICAgbG9jYWxpemVkOiBmaWVsZC5sb2NhbGl6ZWQsXG4gICAgICAgICAgICAgIHJvb3RUYWJsZU5hbWUsXG4gICAgICAgICAgICAgIHRhYmxlOiBhZGFwdGVyLnRhYmxlc1tibG9ja1RhYmxlTmFtZV0sXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHJvb3RSZWxhdGlvbnNUb0J1aWxkLnNldChgX2Jsb2Nrc18ke2Jsb2NrLnNsdWd9YCwgYmxvY2tUYWJsZU5hbWUpXG4gICAgICAgIH0pXG5cbiAgICAgICAgYnJlYWtcbiAgICAgIH1cblxuICAgICAgY2FzZSAndGFiJzpcbiAgICAgIGNhc2UgJ2dyb3VwJzoge1xuICAgICAgICBpZiAoISgnbmFtZScgaW4gZmllbGQpKSB7XG4gICAgICAgICAgY29uc3Qge1xuICAgICAgICAgICAgaGFzTG9jYWxpemVkRmllbGQ6IGdyb3VwSGFzTG9jYWxpemVkRmllbGQsXG4gICAgICAgICAgICBoYXNMb2NhbGl6ZWRNYW55VGV4dEZpZWxkOiBncm91cEhhc0xvY2FsaXplZE1hbnlUZXh0RmllbGQsXG4gICAgICAgICAgICBoYXNMb2NhbGl6ZWRNYW55TnVtYmVyRmllbGQ6IGdyb3VwSGFzTG9jYWxpemVkTWFueU51bWJlckZpZWxkLFxuICAgICAgICAgICAgaGFzTG9jYWxpemVkUmVsYXRpb25zaGlwRmllbGQ6IGdyb3VwSGFzTG9jYWxpemVkUmVsYXRpb25zaGlwRmllbGQsXG4gICAgICAgICAgICBoYXNNYW55VGV4dEZpZWxkOiBncm91cEhhc01hbnlUZXh0RmllbGQsXG4gICAgICAgICAgICBoYXNNYW55TnVtYmVyRmllbGQ6IGdyb3VwSGFzTWFueU51bWJlckZpZWxkLFxuICAgICAgICAgIH0gPSB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgICAgICBhZGFwdGVyLFxuICAgICAgICAgICAgYnVpbGRUZXh0cyxcbiAgICAgICAgICAgIGJ1aWxkTnVtYmVycyxcbiAgICAgICAgICAgIGJ1aWxkUmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgIGNvbHVtblByZWZpeCxcbiAgICAgICAgICAgIGNvbHVtbnMsXG4gICAgICAgICAgICBkaXNhYmxlTm90TnVsbCxcbiAgICAgICAgICAgIGRpc2FibGVVbmlxdWUsXG4gICAgICAgICAgICBmaWVsZFByZWZpeCxcbiAgICAgICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICAgICAgZm9yY2VMb2NhbGl6ZWQsXG4gICAgICAgICAgICBpbmRleGVzLFxuICAgICAgICAgICAgbG9jYWxlc0NvbHVtbnMsXG4gICAgICAgICAgICBsb2NhbGVzSW5kZXhlcyxcbiAgICAgICAgICAgIG5ld1RhYmxlTmFtZSxcbiAgICAgICAgICAgIHBhcmVudFRhYmxlTmFtZSxcbiAgICAgICAgICAgIHJlbGF0aW9uc1RvQnVpbGQsXG4gICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgcm9vdFJlbGF0aW9uc1RvQnVpbGQsXG4gICAgICAgICAgICByb290VGFibGVJRENvbFR5cGUsXG4gICAgICAgICAgICByb290VGFibGVOYW1lLFxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBpZiAoZ3JvdXBIYXNMb2NhbGl6ZWRGaWVsZCkgaGFzTG9jYWxpemVkRmllbGQgPSB0cnVlXG4gICAgICAgICAgaWYgKGdyb3VwSGFzTG9jYWxpemVkUmVsYXRpb25zaGlwRmllbGQpIGhhc0xvY2FsaXplZFJlbGF0aW9uc2hpcEZpZWxkID0gdHJ1ZVxuICAgICAgICAgIGlmIChncm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gICAgICAgYWRhcHRlcixcbiAgICAgICAgICBidWlsZFRleHRzLFxuICAgICAgICAgIGJ1aWxkTnVtYmVycyxcbiAgICAgICAgICBidWlsZFJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgY29sdW1uUHJlZml4OiBgJHtjb2x1bW5OYW1lfV9gLFxuICAgICAgICAgIGNvbHVtbnMsXG4gICAgICAgICAgZGlzYWJsZU5vdE51bGw6IGRpc2FibGVOb3ROdWxsRnJvbUhlcmUsXG4gICAgICAgICAgZGlzYWJsZVVuaXF1ZSxcbiAgICAgICAgICBmaWVsZFByZWZpeDogYCR7ZmllbGROYW1lfS5gLFxuICAgICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICAgIGZvcmNlTG9jYWxpemVkOiBmaWVsZC5sb2NhbGl6ZWQsXG4gICAgICAgICAgaW5kZXhlcyxcbiAgICAgICAgICBsb2NhbGVzQ29sdW1ucyxcbiAgICAgICAgICBsb2NhbGVzSW5kZXhlcyxcbiAgICAgICAgICBuZXdUYWJsZU5hbWU6IGAke3BhcmVudFRhYmxlTmFtZX1fJHtjb2x1bW5OYW1lfWAsXG4gICAgICAgICAgcGFyZW50VGFibGVOYW1lLFxuICAgICAgICAgIHJlbGF0aW9uc1RvQnVpbGQsXG4gICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICByb290UmVsYXRpb25zVG9CdWlsZCxcbiAgICAgICAgICByb290VGFibGVJRENvbFR5cGUsXG4gICAgICAgICAgcm9vdFRhYmxlTmFtZSxcbiAgICAgICAgfSlcblxuICAgICAgICBpZiAoZ3JvdXBIYXNMb2NhbGl6ZWRGaWVsZCkgaGFzTG9jYWxpemVkRmllbGQgPSB0cnVlXG4gICAgICAgIGlmIChncm91cEhhc0xvY2FsaXplZFJlbGF0aW9uc2hpcEZpZWxkKSBoYXNMb2NhbGl6ZWRSZWxhdGlvbnNoaXBGaWVsZCA9IHRydWVcbiAgICAgICAgaWYgKGdyb3VwSGFzTWF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ICAgICAgICAgIGJ1aWxkVGV4dHMsXG4gICAgICAgICAgYnVpbGROdW1iZXJzLFxuICAgICAgICAgIGJ1aWxkUmVsYXRpb25zaGlwcyxcbiAgICAgICAgICBjb2x1bW5QcmVmaXgsXG4gICAgICAgICAgY29sdW1ucyxcbiAgICAgICAgICBkaXNhYmxlTm90TnVsbDogZGlzYWJsZU5vdE51bGxGcm9tSGVyZSxcbiAgICAgICAgICBkaXNhYmxlVW5pcXVlLFxuICAgICAgICAgIGZpZWxkUHJlZml4LFxuICAgICAgICAgIGZpZWxkczogZmllbGQudGFicy5tYXAoKHRhYikgPT4gKHsgLi4udGFiLCB0eXBlOiAndGFiJyB9KSksXG4gICAgICAgICAgZm9yY2VMb2NhbGl6ZWQsXG4gICAgICAgICAgaW5kZXhlcyxcbiAgICAgICAgICBsb2NhbGVzQ29sdW1ucyxcbiAgICAgICAgICBsb2NhbGVzSW5kZXhlcyxcbiAgICAgICAgICBuZXdUYWJsZU5hbWUsXG4gICAgICAgICAgcGFyZW50VGFibGVOYW1lLFxuICAgICAgICAgIHJlbGF0aW9uc1RvQnVpbGQsXG4gICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICByb290UmVsYXRpb25zVG9CdWlsZCxcbiAgICAgICAgICByb290VGFibGVJRENvbFR5cGUsXG4gICAgICAgICAgcm9vdFRhYmxlTmFtZSxcbiAgICAgICAgfSlcblxuICAgICAgICBpZiAodGFiSGFzTG9jYWxpemVkRmllbGQpIGhhc0xvY2FsaXplZEZpZWxkID0gdHJ1ZVxuICAgICAgICBpZiAodGFiSGFzTG9jYWxpemVkUmVsYXRpb25zaGlwRmllbGQpIGhhc0xvY2FsaXplZFJlbGF0aW9uc2hpcEZpZWxkID0gdHJ1ZVxuICAgICAgICBpZiAodGFiSGFzTWFueVRleHRGaWVsZCkgaGFzTWFueVRleHRGaWVsZCA9IHRydWVcbiAgICAgICAgaWYgKHRhYkhhc0xvY2FsaXplZE1hbnlUZXh0RmllbGQpIG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xkUmVsYXRpb25zaGlwcyxcbiAgICAgICAgICBjb2x1bW5QcmVmaXgsXG4gICAgICAgICAgY29sdW1ucyxcbiAgICAgICAgICBkaXNhYmxlTm90TnVsbDogZGlzYWJsZU5vdE51bGxGcm9tSGVyZSxcbiAgICAgICAgICBkaXNhYmxlVW5pcXVlLFxuICAgICAgICAgIGZpZWxkUHJlZml4LFxuICAgICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICAgIGZvcmNlTG9jYWxpemVkLFxuICAgICAgICAgIGluZGV4ZXMsXG4gICAgICAgICAgbG9jYWxlc0NvbHVtbnMsXG4gICAgICAgICAgbG9jYWxlc0luZGV4ZXMsXG4gICAgICAgICAgbmV3VGFibGVOYW1lOiBwYXJlbnRUYWJsZU5hbWUsXG4gICAgICAgICAgcGFyZW50VGFibGVOYW1lLFxuICAgICAgICAgIHJlbGF0aW9uc1RvQnVpbGQsXG4gICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICByb290UmVsYXRpb25zVG9CdWlsZCxcbiAgICAgICAgICByb290VGFibGVJRENvbFR5cGUsXG4gICAgICAgICAgcm9vdFRhYmxlTmFtZSxcbiAgICAgICAgfSlcblxuICAgICAgICBpZiAocm93SGFzTG9jYWxpemVkRmllbGQpIGhhc0xvY2FsaXplZEZpZWxkID0gdHJ1ZVxuICAgICAgICBpZiAocm93SGFzTG9jYWxpemVkUmVsYXRpb25zaGlwRmllbGQpIGhhc0xvY2FsaXplZFJlbGF0aW9uc2hpcEZpZWxkID0gdHJ1ZVxuICAgICAgICBpZiAocm93SGFzTWFueVRleHRGaWVsZCkgaGFzTWFueVRleHRGaWVsZCA9IHRydWVcbiAgICAgICAgaWYgKHJvd0hhc0xvY2FsaXplZE1hbnlUZXh0RmllbGQpIGhhc0xvY2FsaXplZE1hbnlUZXh0RmllbGQgPSB0cnVlXG4gICAgICAgIGlmIChyb3dIYXNNYW55TnVtYmVyRmllbGQpIGhhc01hbnlOdW1iZXJGaWVsZCA9IHRydWVcbiAgICAgICAgaWYgKHJvd0hhc0xvY2FsaXplZE1hbnlOdW1iZXJGaWVsZCkgaGFzTG9jYWxpemVkTWFueU51bWJlckZpZWxkID0gdHJ1ZVxuICAgICAgICBicmVha1xuICAgICAgfVxuXG4gICAgICBjYXNlICdyZWxhdGlvbnNoaXAnOlxuICAgICAgY2FzZSAndXBsb2FkJzpcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoZmllbGQucmVsYXRpb25UbykpIHtcbiAgICAgICAgICBmaWVsZC5yZWxhdGlvblRvLmZvckVhY2goKHJlbGF0aW9uKSA9PiByZWxhdGlvbnNoaXBzLmFkZChyZWxhdGlvbikpXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgcmVsYXRpb25zaGlwcy5hZGQoZmllbGQucmVsYXRpb25UbylcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQgJiYgYWRhcHRlci5wYXlsb2FkLmNvbmZpZy5sb2NhbGl6YXRpb24pIHtcbiAgICAgICAgICBoYXNMb2NhbGl6ZWRSZWxhdGlvbnNoaXBGaWVsZCA9IHRydWVcbiAgICAgICAgfVxuICAgICAgICBicmVha1xuXG4gICAgICBkZWZhdWx0OlxuICAgICAgICBicmVha1xuICAgIH1cblxuICAgIGNvbnN0IGNvbmRpdGlvbiA9IGZpZWxkLmFkbWluICYmIGZpZWxkLmFkbWluLmNvbmRpdGlvblxuXG4gICAgaWYgKFxuICAgICAgIWRpc2FibGVOb3ROdWxsICYmXG4gICAgICB0YXJnZXRUYWJsZVtmaWVsZE5hbWVdICYmXG4gICAgICAncmVxdWlyZWQnIGluIGZpZWxkICYmXG4gICAgICBmaWVsZC5yZXF1aXJlZCAmJlxuICAgICAgIWNvbmRpdGlvblxuICAgICkge1xuICAgICAgdGFyZ2V0VGFibGVbZmllbGROYW1lXS5ub3ROdWxsKClcbiAgICB9XG4gIH0pXG5cbiAgcmV0dXJuIHtcbiAgICBoY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ot":"","sources":["../../src/schema/validateExistingBlockIsIdentical.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAK1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,KAAK,IAAI,GAAG;IACV,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,YAAY,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,gCAAgC,gDAK1C,IAAI,KAAG,IAoBT,CAAA"}
1
+ {"version":3,"file":"validateExistingBlockIsIdentical.d.ts","sourceRoot":"","sources":["../../src/schema/validateExistingBlockIsIdentical.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAS,MAAM,eAAe,CAAA;AAKjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,KAAK,IAAI,GAAG;IACV,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,YAAY,CAAA;CACpB,CAAA;AAsCD,eAAO,MAAM,gCAAgC,gDAK1C,IAAI,KAAG,IA0BT,CAAA"}
@@ -9,11 +9,52 @@ Object.defineProperty(exports, "validateExistingBlockIsIdentical", {
9
9
  }
10
10
  });
11
11
  const _errors = require("payload/errors");
12
- const _utilities = require("payload/utilities");
12
+ const _types = require("payload/types");
13
+ const getFlattenedFieldNames = (fields, prefix = '')=>{
14
+ return fields.reduce((fieldsToUse, field)=>{
15
+ let fieldPrefix = prefix;
16
+ if (field.type === 'blocks') {
17
+ return fieldsToUse;
18
+ }
19
+ if ((0, _types.fieldHasSubFields)(field)) {
20
+ fieldPrefix = 'name' in field ? `${prefix}${field.name}.` : prefix;
21
+ return [
22
+ ...fieldsToUse,
23
+ ...getFlattenedFieldNames(field.fields, fieldPrefix)
24
+ ];
25
+ }
26
+ if (field.type === 'tabs') {
27
+ return [
28
+ ...fieldsToUse,
29
+ ...field.tabs.reduce((tabFields, tab)=>{
30
+ fieldPrefix = 'name' in tab ? `${prefix}.${tab.name}` : prefix;
31
+ return [
32
+ ...tabFields,
33
+ ...(0, _types.tabHasName)(tab) ? [
34
+ {
35
+ ...tab,
36
+ type: 'tab'
37
+ }
38
+ ] : getFlattenedFieldNames(tab.fields, fieldPrefix)
39
+ ];
40
+ }, [])
41
+ ];
42
+ }
43
+ if ((0, _types.fieldAffectsData)(field)) {
44
+ return [
45
+ ...fieldsToUse,
46
+ `${fieldPrefix?.replace('.', '_') || ''}${field.name}`
47
+ ];
48
+ }
49
+ return fieldsToUse;
50
+ }, []);
51
+ };
13
52
  const validateExistingBlockIsIdentical = ({ block, localized, rootTableName, table })=>{
14
53
  if (table) {
15
- const fieldNames = (0, _utilities.flattenTopLevelFields)(block.fields).flatMap((field)=>field.name);
16
- Object.keys(table).forEach((fieldName)=>{
54
+ const fieldNames = getFlattenedFieldNames(block.fields);
55
+ const missingField = // ensure every field from the config is in the matching table
56
+ fieldNames.find((name)=>Object.keys(table).indexOf(name) === -1) || // ensure every table column is matched for every field from the config
57
+ Object.keys(table).find((fieldName)=>{
17
58
  if (![
18
59
  '_locale',
19
60
  '_order',
@@ -21,15 +62,16 @@ const validateExistingBlockIsIdentical = ({ block, localized, rootTableName, tab
21
62
  '_path',
22
63
  '_uuid'
23
64
  ].includes(fieldName)) {
24
- if (fieldNames.indexOf(fieldName) === -1) {
25
- throw new _errors.InvalidConfiguration(`The table ${rootTableName} has multiple blocks with slug ${block.slug}, but the schemas do not match. One block includes the field ${fieldName}, while the other block does not.`);
26
- }
65
+ return fieldNames.indexOf(fieldName) === -1;
27
66
  }
28
67
  });
68
+ if (missingField) {
69
+ throw new _errors.InvalidConfiguration(`The table ${rootTableName} has multiple blocks with slug ${block.slug}, but the schemas do not match. One block includes the field ${missingField}, while the other block does not.`);
70
+ }
29
71
  if (Boolean(localized) !== Boolean(table._locale)) {
30
72
  throw new _errors.InvalidConfiguration(`The table ${rootTableName} has multiple blocks with slug ${block.slug}, but the schemas do not match. One is localized, but another is not. Block schemas of the same name must match exactly.`);
31
73
  }
32
74
  }
33
75
  };
34
76
 
35
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zY2hlbWEvdmFsaWRhdGVFeGlzdGluZ0Jsb2NrSXNJZGVudGljYWwudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBCbG9jayB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB7IEludmFsaWRDb25maWd1cmF0aW9uIH0gZnJvbSAncGF5bG9hZC9lcnJvcnMnXG5pbXBvcnQgeyBmbGF0dGVuVG9wTGV2ZWxGaWVsZHMgfSBmcm9tICdwYXlsb2FkL3V0aWxpdGllcydcblxuaW1wb3J0IHR5cGUgeyBHZW5lcmljVGFibGUgfSBmcm9tICcuLi90eXBlcydcblxudHlwZSBBcmdzID0ge1xuICBibG9jazogQmxvY2tcbiAgbG9jYWxpemVkOiBib29sZWFuXG4gIHJvb3RUYWJsZU5hbWU6IHN0cmluZ1xuICB0YWJsZTogR2VuZXJpY1RhYmxlXG59XG5cbmV4cG9ydCBjb25zdCB2YWxpZGF0ZUV4aXN0aW5nQmxvY2tJc0lkZW50aWNhbCA9ICh7XG4gIGJsb2NrLFxuICBsb2NhbGl6ZWQsXG4gIHJvb3RUYWJsZU5hbWUsXG4gIHRhYmxlLFxufTogQXJncyk6IHZvaWQgPT4ge1xuICBpZiAodGFibGUpIHtcbiAgICBjb25zdCBmaWVsZE5hbWVzID0gZmxhdHRlblRvcExldmVsRmllbGRzKGJsb2NrLmZpZWxkcykuZmxhdE1hcCgoZmllbGQpID0+IGZpZWxkLm5hbWUpXG5cbiAgICBPYmplY3Qua2V5cyh0YWJsZSkuZm9yRWFjaCgoZmllbGROYW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ElBQUksQ0FBQyx3SEFBd0gsQ0FBQztRQUVwTTtJQUNGO0FBQ0YifQ==
@@ -0,0 +1,10 @@
1
+ import type { TextField } from 'payload/types';
2
+ type Args = {
3
+ field: TextField;
4
+ locale?: string;
5
+ textRows: Record<string, unknown>[];
6
+ ref: Record<string, unknown>;
7
+ };
8
+ export declare const transformHasManyText: ({ field, locale, textRows, ref }: Args) => void;
9
+ export {};
10
+ //# sourceMappingURL=hasManyText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasManyText.d.ts","sourceRoot":"","sources":["../../../src/transform/read/hasManyText.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,KAAK,IAAI,GAAG;IACV,KAAK,EAAE,SAAS,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACnC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,oBAAoB,qCAAsC,IAAI,SAQ1E,CAAA"}
@@ -0,0 +1,20 @@
1
+ /* eslint-disable no-param-reassign */ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "transformHasManyText", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return transformHasManyText;
9
+ }
10
+ });
11
+ const transformHasManyText = ({ field, locale, textRows, ref })=>{
12
+ const result = textRows.map(({ text })=>text);
13
+ if (locale) {
14
+ ref[field.name][locale] = result;
15
+ } else {
16
+ ref[field.name] = result;
17
+ }
18
+ };
19
+
20
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90cmFuc2Zvcm0vcmVhZC9oYXNNYW55VGV4dC50cyJdLCJzb3VyY2VzQ29udGVudCI6Wy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DQUFDLENBQUNOLE9BQU8sR0FBR0c7SUFDNUIsT0FBTztRQUNMRCxHQUFHLENBQUNILE1BQU1PLElBQUksQ0FBQyxHQUFHSDtJQUNwQjtBQUNGIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transform/read/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAMtD,KAAK,aAAa,GAAG;IACnB,MAAM,EAAE,eAAe,CAAA;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IAC/B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAID,eAAO,MAAM,SAAS,mDAAoD,aAAa,MAmCtF,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transform/read/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAMtD,KAAK,aAAa,GAAG;IACnB,MAAM,EAAE,eAAe,CAAA;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IAC/B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAID,eAAO,MAAM,SAAS,mDAAoD,aAAa,MA0CtF,CAAA"}
@@ -13,11 +13,16 @@ const _createRelationshipMap = require("../../utilities/createRelationshipMap");
13
13
  const _traverseFields = require("./traverseFields");
14
14
  const transform = ({ config, data, fields })=>{
15
15
  let relationships = {};
16
+ let texts = {};
16
17
  let numbers = {};
17
18
  if ('_rels' in data) {
18
19
  relationships = (0, _createRelationshipMap.createPathMap)(data._rels);
19
20
  delete data._rels;
20
21
  }
22
+ if ('_texts' in data) {
23
+ texts = (0, _createRelationshipMap.createPathMap)(data._texts);
24
+ delete data._texts;
25
+ }
21
26
  if ('_numbers' in data) {
22
27
  numbers = (0, _createRelationshipMap.createPathMap)(data._numbers);
23
28
  delete data._numbers;
@@ -33,6 +38,7 @@ const transform = ({ config, data, fields })=>{
33
38
  deletions,
34
39
  fieldPrefix: '',
35
40
  fields,
41
+ texts,
36
42
  numbers,
37
43
  path: '',
38
44
  relationships,
@@ -42,4 +48,4 @@ const transform = ({ config, data, fields })=>{
42
48
  return result;
43
49
  };
44
50
 
45
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90cmFuc2Zvcm0vcmVhZC9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBuby1wYXJhbS1yZWFzc2lnbiAqL1xuaW1wb3J0IHR5cGUgeyBTYW5pdGl6ZWRDb25maWcgfSBmcm9tICdwYXlsb2FkL2NvbmZpZydcbmltcG9ydCB0eXBlIHsgRmllbGQsIFR5cGVXaXRoSUQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBjcmVhdGVCbG9ja3NNYXAgfSBmcm9tICcuLi8uLi91dGlsaXRpZXMvY3JlYXRlQmxvY2tzTWFwJ1xuaW1wb3J0IHsgY3JlYXRlUGF0aE1hcCB9IGZyb20gJy4uLy4uL3V0aWxpdGllcy9jcmVhdGVSZWxhdGlvbnNoaXBNYXAnXG5pbXBvcnQgeyB0cmF2ZXJzZUZpZWxkcyB9IGZyb20gJy4vdHJhdmVyc2VGaWVsZHMnXG5cbnR5cGUgVHJhbnNmb3JtQXJ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FFQyxJQUFJLEVBQUVDLE1BQU0sRUFBaUI7SUFDckYsSUFBSUMsZ0JBQTJELENBQUM7SUFDaEUsSUFBSUMsUUFBbUQsQ0FBQztJQUN4RCxJQUFJQyxVQUFxRCxDQUFDO0lBRTFELElBQUksV0FBV0osTUFBTTtRQUNuQkUsZ0JBQWdCRyxJQUFBQSxvQ0FBYSxFQUFDTCxLQUFLTSxLQUFLO1FBQ3hDLE9BQU9OLEtBQUtNLEtBQUs7SUFDbkI7SUFFQSxJQUFJLFlBQVlOLE1BQU07UUFDcEJHLFFBQVFFLElBQUFBLG9DQUFhLEVBQUNMLEtBQUtPLE1BQU07UUFDakMsT0FBT1AsS0FBS08sTUFBTTtJQUNwQjtJQUVBLElBQUksY0FBY1AsTUFBTTtRQUN0QkksVUFBVUMsSUFBQUEsb0NBQWEsRUFBQ0wsS0FBS1EsUUFBUTtRQUNyQyxPQUFPUixLQUFLUSxRQUFRO0lBQ3RCO0lBRUEsTUFBTUMsU0FBU0MsSUFBQUEsZ0NBQWUsRUFBQ1Y7SUFDL0IsTUFBTVcsWUFBWSxFQUFFO0lBRXBCLE1BQU1DLFNBQVNDLElBQUFBLDhCQUFjLEVBQUk7UUFDL0JKO1FBQ0FWO1FBQ0FlLFNBQVM7WUFDUEMsSUFBSWYsS0FBS2UsRUFBRTtRQUNiO1FBQ0FKO1FBQ0FLLGFBQWE7UUFDYmY7UUFDQUU7UUFDQUM7UUFDQWEsTUFBTTtRQUNOZjtRQUNBZ0IsT0FBT2xCO0lBQ1Q7SUFFQVcsVUFBVVEsT0FBTyxDQUFDLENBQUNDLFdBQWFBO0lBRWhDLE9BQU9SO0FBQ1QifQ==
@@ -26,6 +26,10 @@ type TraverseFieldsArgs = {
26
26
  * An array of Payload fields to traverse
27
27
  */
28
28
  fields: (Field | TabAsField)[];
29
+ /**
30
+ * All hasMany text fields, as returned by Drizzle, keyed on an object by field path
31
+ */
32
+ texts: Record<string, Record<string, unknown>[]>;
29
33
  /**
30
34
  * All hasMany number fields, as returned by Drizzle, keyed on an object by field path
31
35
  */
@@ -43,6 +47,6 @@ type TraverseFieldsArgs = {
43
47
  */
44
48
  table: Record<string, unknown>;
45
49
  };
46
- export declare const traverseFields: <T extends Record<string, unknown>>({ blocks, config, dataRef, deletions, fieldPrefix, fields, numbers, path, relationships, table, }: TraverseFieldsArgs) => T;
50
+ export declare const traverseFields: <T extends Record<string, unknown>>({ blocks, config, dataRef, deletions, fieldPrefix, fields, texts, numbers, path, relationships, table, }: TraverseFieldsArgs) => T;
47
51
  export {};
48
52
  //# sourceMappingURL=traverseFields.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../../src/transform/read/traverseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAItD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAKhE,KAAK,kBAAkB,GAAG;IACxB;;OAEG;IACH,MAAM,EAAE,SAAS,CAAA;IACjB;;OAEG;IACH,MAAM,EAAE,eAAe,CAAA;IACvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC;;OAEG;IACH,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,CAAA;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,MAAM,EAAE,CAAC,KAAK,GAAG,UAAU,CAAC,EAAE,CAAA;IAC9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IAClD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAA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