@payloadcms/db-postgres 0.8.7 → 0.8.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. package/dist/connect.d.ts.map +1 -1
  2. package/dist/connect.js +5 -52
  3. package/dist/count.d.ts.map +1 -1
  4. package/dist/count.js +3 -3
  5. package/dist/createMigration.d.ts.map +1 -1
  6. package/dist/createMigration.js +10 -4
  7. package/dist/find/findMany.d.ts.map +1 -1
  8. package/dist/find/findMany.js +3 -3
  9. package/dist/init.js +3 -2
  10. package/dist/migrate.js +3 -3
  11. package/dist/migrateDown.js +2 -2
  12. package/dist/migrateRefresh.js +2 -2
  13. package/dist/migrateReset.js +3 -3
  14. package/dist/migrateStatus.js +2 -2
  15. package/dist/queries/parseParams.d.ts.map +1 -1
  16. package/dist/queries/parseParams.js +3 -1
  17. package/dist/queries/sanitizeQueryValue.d.ts +2 -1
  18. package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
  19. package/dist/queries/sanitizeQueryValue.js +11 -2
  20. package/dist/schema/build.d.ts +10 -2
  21. package/dist/schema/build.d.ts.map +1 -1
  22. package/dist/schema/build.js +23 -6
  23. package/dist/schema/traverseFields.d.ts +6 -1
  24. package/dist/schema/traverseFields.d.ts.map +1 -1
  25. package/dist/schema/traverseFields.js +46 -17
  26. package/dist/transform/read/hasManyNumber.d.ts +2 -1
  27. package/dist/transform/read/hasManyNumber.d.ts.map +1 -1
  28. package/dist/transform/read/hasManyNumber.js +14 -4
  29. package/dist/transform/read/hasManyText.d.ts +2 -1
  30. package/dist/transform/read/hasManyText.d.ts.map +1 -1
  31. package/dist/transform/read/hasManyText.js +14 -4
  32. package/dist/transform/read/relationship.d.ts +2 -1
  33. package/dist/transform/read/relationship.d.ts.map +1 -1
  34. package/dist/transform/read/relationship.js +16 -7
  35. package/dist/transform/read/traverseFields.d.ts +5 -1
  36. package/dist/transform/read/traverseFields.d.ts.map +1 -1
  37. package/dist/transform/read/traverseFields.js +118 -85
  38. package/dist/transform/write/array.d.ts +6 -1
  39. package/dist/transform/write/array.d.ts.map +1 -1
  40. package/dist/transform/write/array.js +7 -3
  41. package/dist/transform/write/blocks.d.ts +6 -1
  42. package/dist/transform/write/blocks.d.ts.map +1 -1
  43. package/dist/transform/write/blocks.js +5 -3
  44. package/dist/transform/write/traverseFields.d.ts +6 -1
  45. package/dist/transform/write/traverseFields.d.ts.map +1 -1
  46. package/dist/transform/write/traverseFields.js +40 -15
  47. package/dist/types.d.ts +9 -5
  48. package/dist/types.d.ts.map +1 -1
  49. package/dist/utilities/migrationTableExists.d.ts +2 -2
  50. package/dist/utilities/migrationTableExists.d.ts.map +1 -1
  51. package/dist/utilities/migrationTableExists.js +10 -6
  52. package/dist/utilities/pushDevSchema.d.ts +9 -0
  53. package/dist/utilities/pushDevSchema.d.ts.map +1 -0
  54. package/dist/utilities/pushDevSchema.js +59 -0
  55. package/dist/utilities/requireDrizzleKit.d.ts +14 -0
  56. package/dist/utilities/requireDrizzleKit.d.ts.map +1 -0
  57. package/dist/utilities/requireDrizzleKit.js +13 -0
  58. package/package.json +5 -5
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "transformArray", {
10
10
  });
11
11
  const _isArrayOfRows = require("../../utilities/isArrayOfRows");
12
12
  const _traverseFields = require("./traverseFields");
13
- const transformArray = ({ adapter, arrayTableName, baseTableName, blocks, blocksToDelete, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects, texts })=>{
13
+ const transformArray = ({ adapter, arrayTableName, baseTableName, blocks, blocksToDelete, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects, texts, withinArrayOrBlockLocale })=>{
14
14
  const newRows = [];
15
15
  const hasUUID = adapter.tables[arrayTableName]._uuid;
16
16
  if ((0, _isArrayOfRows.isArrayOfRows)(data)) {
@@ -39,6 +39,9 @@ const transformArray = ({ adapter, arrayTableName, baseTableName, blocks, blocks
39
39
  if (field.localized) {
40
40
  newRow.row._locale = locale;
41
41
  }
42
+ if (withinArrayOrBlockLocale) {
43
+ newRow.row._locale = withinArrayOrBlockLocale;
44
+ }
42
45
  (0, _traverseFields.traverseFields)({
43
46
  adapter,
44
47
  arrays: newRow.arrays,
@@ -57,7 +60,8 @@ const transformArray = ({ adapter, arrayTableName, baseTableName, blocks, blocks
57
60
  relationshipsToDelete,
58
61
  row: newRow.row,
59
62
  selects,
60
- texts
63
+ texts,
64
+ withinArrayOrBlockLocale
61
65
  });
62
66
  newRows.push(newRow);
63
67
  });
@@ -65,4 +69,4 @@ const transformArray = ({ adapter, arrayTableName, baseTableName, blocks, blocks
65
69
  return newRows;
66
70
  };
67
71
 
68
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90cmFuc2Zvcm0vd3JpdGUvYXJyYXkudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcGFyYW0tcmVhc3NpZ24gKi9cbmltcG9ydCB0eXBlIHsgQXJyYXlGaWVsZCB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi4vLi4vdHlwZXMnXG5pbXBvcnQgdHlwZSB7IEFycmF5Um93VG9JbnNlcnQsIEJsb2NrUm93VG9JbnNlcnQsIFJlbGF0aW9uc2hpcFRvRGVsZXRlIH0gZnJvbSAnLi90eXBlcydcblxuaW1wb3J0IHsgaXNBcnJheU9mUm93cyB9IGZyb20gJy4uLy4uL3V0aWxpdGllcy9pc0FycmF5T2ZSb3dzJ1xuaW1wb3J0IHsgdHJhdmVyc2VGaWVsZHMgfSBmcm9tICcuL3RyYXZlcnNlRmllbGRzJ1xuXG50eXBlIEFyZ3MgPSB7XG4gIGFkYXB0ZXI6IFBvc3RncmVzQWRhcHRlclxuICBhcnJheVRhYmxlTmFtZTogc3RyaW5nXG4gIGJhc2VUYWJsZU5hbWU6IHN0cmluZ1xuICBibG9ja3M6IHtcbiAgICBbYmxvY2tUeXBl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jtnQkFDWDtZQUNGO1lBRUEsSUFBSUQsTUFBTXdCLFNBQVMsRUFBRTtnQkFDbkJQLE9BQU9HLEdBQUcsQ0FBQ0csT0FBTyxHQUFHdEI7WUFDdkI7WUFFQSxJQUFJTywwQkFBMEI7Z0JBQzVCUyxPQUFPRyxHQUFHLENBQUNHLE9BQU8sR0FBR2Y7WUFDdkI7WUFFQWlCLElBQUFBLDhCQUFjLEVBQUM7Z0JBQ2IvQjtnQkFDQXdCLFFBQVFELE9BQU9DLE1BQU07Z0JBQ3JCdEI7Z0JBQ0FDO2dCQUNBQztnQkFDQTRCLGNBQWM7Z0JBQ2QzQixNQUFNZ0I7Z0JBQ05ZLGFBQWE7Z0JBQ2JDLFFBQVE1QixNQUFNNEIsTUFBTTtnQkFDcEJULFNBQVNGLE9BQU9FLE9BQU87Z0JBQ3ZCakI7Z0JBQ0EyQixpQkFBaUJsQztnQkFDakJRLE1BQU0sQ0FBQyxFQUFFQSxRQUFRLEdBQUcsRUFBRUgsTUFBTThCLElBQUksQ0FBQyxDQUFDLEVBQUVkLEVBQUUsQ0FBQyxDQUFDO2dCQUN4Q1o7Z0JBQ0FDO2dCQUNBZSxLQUFLSCxPQUFPRyxHQUFHO2dCQUNmZDtnQkFDQUM7Z0JBQ0FDO1lBQ0Y7WUFFQUMsUUFBUXNCLElBQUksQ0FBQ2Q7UUFDZjtJQUNGO0lBRUEsT0FBT1I7QUFDVCJ9
@@ -19,7 +19,12 @@ type Args = {
19
19
  [tableName: string]: Record<string, unknown>[];
20
20
  };
21
21
  texts: Record<string, unknown>[];
22
+ /**
23
+ * Set to a locale code if this set of fields is traversed within a
24
+ * localized array or block field
25
+ */
26
+ withinArrayOrBlockLocale?: string;
22
27
  };
23
- export declare const transformBlocks: ({ adapter, baseTableName, blocks, blocksToDelete, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects, texts, }: Args) => void;
28
+ export declare const transformBlocks: ({ adapter, baseTableName, blocks, blocksToDelete, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects, texts, withinArrayOrBlockLocale, }: Args) => void;
24
29
  export {};
25
30
  //# 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,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,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,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;IACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACjC,CAAA;AACD,eAAO,MAAM,eAAe,kJAczB,IAAI,SAyDN,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,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,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;IACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAChC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;CAClC,CAAA;AACD,eAAO,MAAM,eAAe,4KAezB,IAAI,SA2DN,CAAA"}
@@ -15,7 +15,7 @@ function _interop_require_default(obj) {
15
15
  default: obj
16
16
  };
17
17
  }
18
- const transformBlocks = ({ adapter, baseTableName, blocks, blocksToDelete, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects, texts })=>{
18
+ const transformBlocks = ({ adapter, baseTableName, blocks, blocksToDelete, data, field, locale, numbers, path, relationships, relationshipsToDelete, selects, texts, withinArrayOrBlockLocale })=>{
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);
@@ -31,6 +31,7 @@ const transformBlocks = ({ adapter, baseTableName, blocks, blocksToDelete, data,
31
31
  }
32
32
  };
33
33
  if (field.localized && locale) newRow.row._locale = locale;
34
+ if (withinArrayOrBlockLocale) newRow.row._locale = withinArrayOrBlockLocale;
34
35
  const blockTableName = adapter.tableNameMap.get(`${baseTableName}_blocks_${blockType}`);
35
36
  const hasUUID = adapter.tables[blockTableName]._uuid;
36
37
  // If we have declared a _uuid field on arrays,
@@ -60,10 +61,11 @@ const transformBlocks = ({ adapter, baseTableName, blocks, blocksToDelete, data,
60
61
  relationshipsToDelete,
61
62
  row: newRow.row,
62
63
  selects,
63
- texts
64
+ texts,
65
+ withinArrayOrBlockLocale
64
66
  });
65
67
  blocks[blockType].push(newRow);
66
68
  });
67
69
  };
68
70
 
69
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90cmFuc2Zvcm0vd3JpdGUvYmxvY2tzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLXBhcmFtLXJlYXNzaWduICovXG5pbXBvcnQgdHlwZSB7IEJsb2NrRmllbGQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgdG9TbmFrZUNhc2UgZnJvbSAndG8tc25ha2UtY2FzZSdcblxuaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuLi8uLi90eXBlcydcbmltcG9ydCB0eXBlIHsgQmxvY2tSb3dUb0luc2VydCwgUmVsYXRpb25zaGlwVG9EZWxldGUgfSBmcm9tICcuL3R5cGVzJ1xuXG5pbXBvcn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, unknown>[];
45
45
  };
46
46
  texts: Record<string, unknown>[];
47
+ /**
48
+ * Set to a locale code if this set of fields is traversed within a
49
+ * localized array or block field
50
+ */
51
+ withinArrayOrBlockLocale?: string;
47
52
  };
48
- export declare const traverseFields: ({ adapter, arrays, baseTableName, blocks, blocksToDelete, columnPrefix, data, existingLocales, fieldPrefix, fields, forcedLocale, locales, numbers, parentTableName, path, relationships, relationshipsToDelete, row, selects, texts, }: Args) => void;
53
+ export declare const traverseFields: ({ adapter, arrays, baseTableName, blocks, blocksToDelete, columnPrefix, data, existingLocales, fieldPrefix, fields, forcedLocale, locales, numbers, parentTableName, path, relationships, relationshipsToDelete, row, selects, texts, withinArrayOrBlockLocale, }: Args) => void;
49
54
  export {};
50
55
  //# 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,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAUvF,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,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,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,eAAe,CAAC,EAAE,MAAM,C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  };
24
24
  }
25
- const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete, columnPrefix, data, existingLocales, fieldPrefix, fields, forcedLocale, locales, numbers, parentTableName, path, relationships, relationshipsToDelete, row, selects, texts })=>{
25
+ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete, columnPrefix, data, existingLocales, fieldPrefix, fields, forcedLocale, locales, numbers, parentTableName, path, relationships, relationshipsToDelete, row, selects, texts, withinArrayOrBlockLocale })=>{
26
26
  fields.forEach((field)=>{
27
27
  let columnName = '';
28
28
  let fieldName = '';
@@ -53,7 +53,8 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
53
53
  relationships,
54
54
  relationshipsToDelete,
55
55
  selects,
56
- texts
56
+ texts,
57
+ withinArrayOrBlockLocale: localeKey
57
58
  });
58
59
  arrays[arrayTableName] = arrays[arrayTableName].concat(newRows);
59
60
  }
@@ -73,7 +74,8 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
73
74
  relationships,
74
75
  relationshipsToDelete,
75
76
  selects,
76
- texts
77
+ texts,
78
+ withinArrayOrBlockLocale
77
79
  });
78
80
  arrays[arrayTableName] = arrays[arrayTableName].concat(newRows);
79
81
  }
@@ -100,7 +102,8 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
100
102
  relationships,
101
103
  relationshipsToDelete,
102
104
  selects,
103
- texts
105
+ texts,
106
+ withinArrayOrBlockLocale: localeKey
104
107
  });
105
108
  }
106
109
  });
@@ -118,7 +121,8 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
118
121
  relationships,
119
122
  relationshipsToDelete,
120
123
  selects,
121
- texts
124
+ texts,
125
+ withinArrayOrBlockLocale
122
126
  });
123
127
  }
124
128
  return;
@@ -127,6 +131,8 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
127
131
  if (typeof data[field.name] === 'object' && data[field.name] !== null) {
128
132
  if (field.localized) {
129
133
  Object.entries(data[field.name]).forEach(([localeKey, localeData])=>{
134
+ // preserve array ID if there is
135
+ localeData._uuid = data.id || data._uuid;
130
136
  traverseFields({
131
137
  adapter,
132
138
  arrays,
@@ -147,10 +153,14 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
147
153
  relationshipsToDelete,
148
154
  row,
149
155
  selects,
150
- texts
156
+ texts,
157
+ withinArrayOrBlockLocale: localeKey
151
158
  });
152
159
  });
153
160
  } else {
161
+ // preserve array ID if there is
162
+ const groupData = data[field.name];
163
+ groupData._uuid = data.id || data._uuid;
154
164
  traverseFields({
155
165
  adapter,
156
166
  arrays,
@@ -158,7 +168,7 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
158
168
  blocks,
159
169
  blocksToDelete,
160
170
  columnPrefix: `${columnName}_`,
161
- data: data[field.name],
171
+ data: groupData,
162
172
  existingLocales,
163
173
  fieldPrefix: `${fieldName}_`,
164
174
  fields: field.fields,
@@ -170,7 +180,8 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
170
180
  relationshipsToDelete,
171
181
  row,
172
182
  selects,
173
- texts
183
+ texts,
184
+ withinArrayOrBlockLocale
174
185
  });
175
186
  }
176
187
  }
@@ -182,6 +193,8 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
182
193
  if (typeof data[tab.name] === 'object' && data[tab.name] !== null) {
183
194
  if (tab.localized) {
184
195
  Object.entries(data[tab.name]).forEach(([localeKey, localeData])=>{
196
+ // preserve array ID if there is
197
+ localeData._uuid = data.id || data._uuid;
185
198
  traverseFields({
186
199
  adapter,
187
200
  arrays,
@@ -202,10 +215,14 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
202
215
  relationshipsToDelete,
203
216
  row,
204
217
  selects,
205
- texts
218
+ texts,
219
+ withinArrayOrBlockLocale: localeKey
206
220
  });
207
221
  });
208
222
  } else {
223
+ const tabData = data[tab.name];
224
+ // preserve array ID if there is
225
+ tabData._uuid = data.id || data._uuid;
209
226
  traverseFields({
210
227
  adapter,
211
228
  arrays,
@@ -213,7 +230,7 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
213
230
  blocks,
214
231
  blocksToDelete,
215
232
  columnPrefix: `${columnPrefix || ''}${(0, _tosnakecase.default)(tab.name)}_`,
216
- data: data[tab.name],
233
+ data: tabData,
217
234
  existingLocales,
218
235
  fieldPrefix: `${fieldPrefix || ''}${tab.name}_`,
219
236
  fields: tab.fields,
@@ -225,7 +242,8 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
225
242
  relationshipsToDelete,
226
243
  row,
227
244
  selects,
228
- texts
245
+ texts,
246
+ withinArrayOrBlockLocale
229
247
  });
230
248
  }
231
249
  }
@@ -249,7 +267,8 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
249
267
  relationshipsToDelete,
250
268
  row,
251
269
  selects,
252
- texts
270
+ texts,
271
+ withinArrayOrBlockLocale
253
272
  });
254
273
  }
255
274
  });
@@ -266,6 +285,7 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
266
285
  existingLocales,
267
286
  fieldPrefix,
268
287
  fields: field.fields,
288
+ forcedLocale,
269
289
  locales,
270
290
  numbers,
271
291
  parentTableName,
@@ -274,7 +294,8 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
274
294
  relationshipsToDelete,
275
295
  row,
276
296
  selects,
277
- texts
297
+ texts,
298
+ withinArrayOrBlockLocale
278
299
  });
279
300
  }
280
301
  if (field.type === 'relationship' || field.type === 'upload') {
@@ -309,6 +330,7 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
309
330
  }
310
331
  (0, _relationships.transformRelationship)({
311
332
  baseRow: {
333
+ locale: withinArrayOrBlockLocale,
312
334
  path: relationshipPath
313
335
  },
314
336
  data: fieldData,
@@ -338,6 +360,7 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
338
360
  } else if (Array.isArray(fieldData)) {
339
361
  (0, _texts.transformTexts)({
340
362
  baseRow: {
363
+ locale: withinArrayOrBlockLocale,
341
364
  path: textPath
342
365
  },
343
366
  data: fieldData,
@@ -366,6 +389,7 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
366
389
  } else if (Array.isArray(fieldData)) {
367
390
  (0, _numbers.transformNumbers)({
368
391
  baseRow: {
392
+ locale: withinArrayOrBlockLocale,
369
393
  path: numberPath
370
394
  },
371
395
  data: fieldData,
@@ -393,7 +417,8 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
393
417
  } else if (Array.isArray(data[field.name])) {
394
418
  const newRows = (0, _selects.transformSelects)({
395
419
  id: data._uuid || data.id,
396
- data: data[field.name]
420
+ data: data[field.name],
421
+ locale: withinArrayOrBlockLocale
397
422
  });
398
423
  selects[selectTableName] = selects[selectTableName].concat(newRows);
399
424
  }
@@ -440,4 +465,4 @@ const traverseFields = ({ adapter, arrays, baseTableName, blocks, blocksToDelete
440
465
  });
441
466
  };
442
467
 
443
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90cmFuc2Zvcm0vd3JpdGUvdHJhdmVyc2VGaWVsZHMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcGFyYW0tcmVhc3NpZ24gKi9cbmltcG9ydCB0eXBlIHsgRmllbGQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBmaWVsZEFmZmVjdHNEYXRhIH0gZnJvbSAncGF5bG9hZC90eXBlcydcbmltcG9ydCB0b1NuYWtlQ2FzZSBmcm9tICd0by1zbmFrZS1jYXNlJ1xuXG5pbXBvcnQgdHlwZSB7IFBvc3RncmVzQWRhcHRlciB9IGZyb20gJy4uLy4uL3R5cGVzJ1xua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9mIGRhdGFbZmllbGQubmFtZV0gPT09ICdvYmplY3QnICYmIGRhdGFbZmllbGQubmFtZV0gIT09IG51bGwpIHtcbiAgICAgICAgICBPYmplY3QuZW50cmllcyhkYXRhW2ZpZWxkLm5hbWVdKS5mb3JFYWNoKChbbG9jYWxlS2V5LCBsb2NhbGVEYXRhXSkgPT4ge1xuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkobG9jYWxlRGF0YSkpIHtcbiAgICAgICAgICAgICAgY29uc3QgbmV3Um93cyA9IHRyYW5zZm9ybUFycmF5KHtcbiAgICAgICAgICAgICAgICBhZGFwdGVyLFxuICAgICAgICAgICAgICAgIGFycmF5VGFibGVOYW1lLFxuICAgICAgICAgICAgICAgIGJhc2VUYWJsZU5hbWUsXG4gICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgIGJsb2Nrc1RvRGVsZXRlLFxuICAgICAgICAgICAgICAgIGRhdGE6IGxvY2FsZURhdGEsXG4gICAgICAgICAgICAgICAgZmllbGQsXG4gICAgICAgICAgICAgICAgbG9jYWxlOiBsb2NhbGVLZXksXG4gICAgICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgICAgICBwYXRoLFxuICAgICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwc1RvRGVsZXRlLFxuICAgICAgICAgICAgICAgIHNlbGVjdHMsXG4gICAgICAgICAgICAgICAgdGV4dHMsXG4gICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgYXJyYXlzW2FycmF5VGFibGVOYW1lXSA9IGFycmF5c1thcnJheVRhYmxlTmFtZV0uY29uY2F0KG5ld1Jvd3MpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgY29uc3QgbmV3Um93cyA9IHRyYW5zZm9ybUFycmF5KHtcbiAgICAgICAgICBhZGFwdG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gYWRhcHRlcixcbiAgICAgICAgICAgICAgICBiYXNlVGFibGVOYW1lLFxuICAgICAgICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICAgICAgICBibG9ja3NUb0RlbGV0ZSxcbiAgICAgICAgICAgICAgICBkYXRhOiBsb2NhbGVEYXRhLFxuICAgICAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgICAgIGxvY2FsZTogbG9jYWxlS2V5LFxuICAgICAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICAgICAgcGF0aCxcbiAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHNUb0RlbGV0ZSxcbiAgICAgICAgICAgICAgICBzZWxlY3RzLFxuICAgICAgICAgICAgICAgIHRleHRzLFxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSBpZiAoaXNBcnJheU9mUm93cyhmaWVsZERhdGEpKSB7XG4gICAgICAgIHRyYW5zZm9ybUJsb2Nrcyh7XG4gICAgICAgICAgYWRhcHRlcixcbiAgICAgICAgICBiYXNlVGFibGVOYW1lLFxuICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICBibG9ja3NUb0RlbGV0ZSxcbiAgICAgICAgICBkYXRhOiBmaWVsZERhdGEsXG4gICAgICAgICAgZmllbGQsXG4gICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICBwYXRoLFxuICAgICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgcmVsYXRpb25zaGlwc1RvRGVsZXRlLFxuICAgICAgICAgIHNlbGVjdHMsXG4gICAgICAgICAgdGV4dHMsXG4gICAgICAgIH0pXG4gICAgICB9XG5cbiAgICAgIHJldHVyblxuICAgIH1cblxuICAgIGlmIChmaWVsZC50eXBlID09PSAnZ3JvdXAnKSB7XG4gICAgICBpZiAodHlwZW9mIGRhdGFbZmllbGQubmFtZV0gPT09ICdvYmplY3QnICYmIGRhdGFbZmllbGQubmFtZV0gIT09IG51bGwpIHtcbiAgICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCkge1xuICAgICAgICAgIE9iamVjdC5lbnRyaWVzKGRhdGFbZmllbGQubmFtZV0pLmZvckVhY2goKFtsb2NhbGVLZXksIGxvY2FsZURhdGFdKSA9PiB7XG4gICAgICAgICAgICB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICAgIGFycmF5cyxcbiAgICAgICAgICAgICAgYmFzZVRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICBibG9ja3NUb0RlbGV0ZSxcbiAgICAgICAgICAgICAgY29sdW1uUHJlZml4OiBgJHtjb2x1bW5OYW1lfV9gLFxuICAgICAgICAgICAgICBkYXRhOiBsb2NhbGVEYXRhIGFzIFJlY29yZDxzdHJpbmcsIHVua25vd24+LFxuICAgICAgICAgICAgICBleGlzdGluZ0xvY2FsZXMsXG4gICAgICAgICAgICAgIGZpZWxkUHJlZml4OiBgJHtmaWVsZE5hbWV9X2AsXG4gICAgICAgICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICAgICAgICBmb3JjZWRMb2NhbGU6IGxvY2FsZUtleSxcbiAgICAgICAgICAgICAgbG9jYWxlcyxcbiAgICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgICAgcGFyZW50VGFibGVOYW1lLFxuICAgICAgICAgICAgICBwYXRoOiBgJHtwYXRoIHx8ICcnfSR7ZmllbGQubmFtZX0uYCxcbiAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgcmVsYXRpb25zaGlwc1RvRGVsZXRlLFxuICAgICAgICAgICAgICByb3csXG4gICAgICAgICAgICAgIHNlbGVjdHMsXG4gICAgICAgICAgICAgIHRleHRzLFxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9KVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICBhcnJheXMsXG4gICAgICAgICAgICBiYXNlVGFibGVOYW1lLFxuICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgYmxvY2tzVG9EZWxldGUsXG4gICAgICAgICAgICBjb2x1bW5QcmVmaXg6IGAke2NvbHVtbk5hbWV9X2AsXG4gICAgICAgICAgICBkYXRhOiBkYXRhW2ZpZWxkLm5hbWVdIGFzIFJlY29yZDxzdHJpbmcsIHVua25vd24+LFxuICAgICAgICAgICAgZXhpc3RpbmdMb2NhbGVzLFxuICAgICAgICAgICAgZmllbGRQcmVmaXg6IGAke2ZpZWxkTmFtZX1fYCxcbiAgICAgICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICAgICAgbG9jYWxlcyxcbiAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICBwYXJlbnRUYWJsZU5hbWUsXG4gICAgICAgICAgICBwYXRoOiBgJHtwYXRoIHx8ICcnfSR7ZmllbGQubmFtZX0uYCxcbiAgICAgICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgICByZWxhdGlvbnNoaXBzVG9EZWxldGUsXG4gICAgICAgICAgICByb3csXG4gICAgICAgICAgICBzZWxlY3RzLFxuICAgICAgICAgICAgdGV4dHMsXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICByZXR1cm5cbiAgICB9XG5cbiAgICBpZiAoZmllbGQudHlwZSA9PT0gJ3RhYnMnKSB7XG4gICAgICBmaWVsZC50YWJzLmZvckVhY2goKHRhYikgPT4ge1xuICAgICAgICBpZiAoJ25hbWUnIGluIHRhYikge1xuICAgICAgICAgIGlmICh0eXBlb2YgZGF0YVt0YWIubmFtZV0gPT09ICdvYmplY3QnICYmIGRhdGFbdGFiLm5hbWVdICE9PSBudWxsKSB7XG4gICAgICAgICAgICBpZiAodGFiLmxvY2FsaXplZCkge1xuICAgICAgICAgICAgICBPYmplY3QuZW50cmllcyhkYXRhW3RhYi5uYW1lXSkuZm9yRWFjaCgoW2xvY2FsZUtleSwgbG9jYWxlRGF0YV0pID0+IHtcbiAgICAgICAgICAgICAgICB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgICAgICAgICAgICBhZGFwdGVyLFxuICAgICAgICAgICAgICAgICAgYXJyYXlzLFxuICAgICAgICAgICAgICAgICAgYmFzZVRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICAgICAgICAgIGJsb2Nrc1RvRGVsZXRlLFxuICAgICAgICAgICAgICAgICAgY29sdW1uUHJlZml4OiBgJHtjb2x1bW5QcmVmaXggfHwgJyd9JHt0b1NuYWtlQ2FzZSh0YWIubmFtZSl9X2AsXG4gICAgICAgICAgICAgICAgICBkYXRhOiBsb2NhbGVEYXRhIGFzIFJlY29yZDxzdHJpbmcsIHVua25vd24+LFxuICAgICAgICAgICAgICAgICAgZXhpc3RpbmdMb2NhbGVzLFxuICAgICAgICAgICAgICAgICAgZmllbGRQcmVmaXg6IGAke2ZpZWxkUHJlZml4IHx8ICcnfSR7dGFiLm5hbWV9X2AsXG4gICAgICAgICAgICAgICAgICBmaWVsZHM6IHRhYi5maWVsZHMsXG4gICAgICAgICAgICAgICAgICBmb3JjZWRMb2NhbGU6IGxvY2FsZUtleSxcbiAgICAgICAgICAgICAgICAgIGxvY2FsZXMsXG4gICAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgICAgcGFyZW50VGFibGVOYW1lLFxuICAgICAgICAgICAgICAgICAgcGF0aDogYCR7cGF0aCB8fCAnJ30ke3RhYi5uYW1lfS5gLFxuICAgICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHNUb0RlbGV0ZSxcbiAgICAgICAgICAgICAgICAgIHJvdyxcbiAgICAgICAgICAgICAgICAgIHNlbGVjdHMsXG4gICAgICAgICAgICAgICAgICB0ZXh0cyxcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdHJhdmVyc2VGaWVsZHMoe1xuICAgICAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICAgICAgYXJyYXlzLFxuICAgICAgICAgICAgICAgIGJhc2VUYWJsZU5hbWUsXG4gICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgIGJsb2Nrc1RvRGVsZXRlLFxuICAgICAgICAgICAgICAgIGNvbHVtblByZWZpeDogYCR7Y29sdW1uUHJlZml4IHx8ICcnfSR7dG9TbmFrZUNhc2UodGFiLm5hbWUpfV9gLFxuICAgICAgICAgICAgICAgIGRhdGE6IGRhdGFbdGFiLm5hbWVdIGFzIFJlY29yZDxzdHJpbmcsIHVua25vd24+LFxuICAgICAgICAgICAgICAgIGV4aXN0aW5nTG9jYWxlcyxcbiAgICAgICAgICAgICAgICBmaWVsZFByZWZpeDogYCR7ZmllbGRQcmVmaXggfHwgJyd9JHt0YWIubmFtZX1fYCxcbiAgICAgICAgICAgICAgICBmaWVsZHM6IHRhYi5maWVsZHMsXG4gICAgICAgICAgICAgICAgbG9jYWxlcyxcbiAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgIHBhcmVudFRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgICBwYXRoOiBgJHtwYXRoIHx8ICcnfSR7dGFiLm5hbWV9LmAsXG4gICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzVG9EZWxldGUsXG4gICAgICAgICAgICAgICAgcm93LFxuICAgICAgICAgICAgICAgIHNlbGVjdHMsXG4gICAgICAgICAgICAgICAgdGV4dHMsXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICBhcnJheXMsXG4gICAgICAgICAgICBiYXNlVGFibGVOYW1lLFxuICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgYmxvY2tzVG9EZWxldGUsXG4gICAgICAgICAgICBjb2x1bW5QcmVmaXgsXG4gICAgICAgICAgICBkYXRhLFxuICAgICAgICAgICAgZXhpc3RpbmdMb2NhbGVzLFxuICAgICAgICAgICAgZmllbGRQcmVmaXgsXG4gICAgICAgICAgICBmaWVsZHM6IHRhYi5maWVsZHMsXG4gICAgICAgICAgICBsb2NhbGVzLFxuICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgIHBhcmVudFRhYmxlTmFtZSxcbiAgICAgICAgICAgIHBhdGgsXG4gICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgcmVsYXRpb25zaGlwc1RvRGVsZXRlLFxuICAgICAgICAgICAgcm93LFxuICAgICAgICAgICAgc2VsZWN0cyxcbiAgICAgICAgICAgIHRleHRzLFxuICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgfVxuXG4gICAgaWYgKGZpZWxkLnR5cGUgPT09ICdyb3cnIHx8IGZpZWxkLnR5cGUgPT09ICdjb2xsYXBzaWJsZScpIHtcbiAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgYWRhcHRlcixcbiAgICAgICAgYXJyYXlzLFxuICAgICAgICBiYXNlVGFibGVOYW1lLFxuICAgICAgICBibG9ja3MsXG4gICAgICAgIGJsb2Nrc1RvRGVsZXRlLFxuICAgICAgICBjb2x1bW5QcmVmaXgsXG4gICAgICAgIGRhdGEsXG4gICAgICAgIGV4aXN0aW5nTG9jYWxlcyxcbiAgICAgICAgZmllbGRQcmVmaXgsXG4gICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICBsb2NhbGVzLFxuICAgICAgICBudW1iZXJzLFxuICAgICAgICBwYXJlbnRUYWJsZU5hbWUsXG4gICAgICAgIHBhdGgsXG4gICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgIHJlbGF0aW9uc2hpcHNUb0RlbGV0ZSxcbiAgICAgICAgcm93LFxuICAgICAgICBzZWxlY3RzLFxuICAgICAgICB0ZXh0cyxcbiAgICAgIH0pXG4gICAgfVxuXG4gICAgaWYgKGZpZWxkLnR5cGUgPT09ICdyZWxhdGlvbnNoaXAnIHx8IGZpZWxkLnR5cGUgPT09ICd1cGxvYWQnKSB7XG4gICAgICBjb25zdCByZWxhdGlvbnNoaXBQYXRoID0gYCR7cGF0aCB8fCAnJ30ke2ZpZWxkLm5hbWV9YFxuXG4gICAgICBpZiAoZmllbGQubG9jYWxpemVkKSB7XG4gICAgICAgIGlmICh0eXBlb2YgZmllbGREYXRhID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgIE9iamVjdC5lbnRyaWVzKGZpZWxkRGF0YSkuZm9yRWFjaCgoW2xvY2FsZUtleSwgbG9jYWxlRGF0YV0pID0+IHtcbiAgICAgICAgICAgIGlmIChsb2NhbGVEYXRhID09PSBudWxsKSB7XG4gICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHNUb0RlbGV0ZS5wdXNoKHtcbiAgICAgICAgICAgICAgICBsb2NhbGU6IGxvY2FsZUtleSxcbiAgICAgICAgICAgICAgICBwYXRoOiByZWxhdGlvbnNoaXBQYXRoLFxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICByZXR1cm5cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdHJhbnNmb3JtUmVsYXRpb25zaGlwKHtcbiAgICAgICAgICAgICAgYmFzZVJvdzoge1xuICAgICAgICAgICAgICAgIGxvY2FsZTogbG9jYWxlS2V5LFxuICAgICAgICAgICAgICAgIHBhdGg6IHJlbGF0aW9uc2hpcFBhdGgsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGRhdGE6IGxvY2FsZURhdGEsXG4gICAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoZmllbGREYXRhID09PSBudWxsIHx8IChBcnJheS5pc0FycmF5KGZpZWxkRGF0YSkgJiYgZmllbGREYXRhLmxlbmd0aCA9PT0gMCkpIHtcbiAgICAgICAgICByZWxhdGlvbnNoaXBzVG9EZWxldGUucHVzaCh7IHBhdGg6IHJlbGF0aW9uc2hpcFBhdGggfSlcbiAgICAgICAgICByZXR1cm5cbiAgICAgICAgfVxuXG4gICAgICAgIHRyYW5zZm9ybVJlbGF0aW9uc2hpcCh7XG4gICAgICAgICAgYmFzZVJvdzoge1xuICAgICAgICAgICAgcGF0aDogcmVsYXRpb25zaGlwUGF0aCxcbiAgICAgICAgICB9LFxuICAgICAgICAgIGRhdGE6IGZpZWxkRGF0YSxcbiAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICB9KVxuICAgICAgfVxuXG4gICAgICByZXR1cm5cbiAgICB9XG5cbiAgICBpZiAoZmllbGQudHlwZSA9PT0gJ3RleHQnICYmIGZpZWxkLmhhc01hbnkpIHtcbiAgICAgIGNvbnN0IHRleHRQYXRoID0gYCR7cGF0aCB8fCAnJ30ke2ZpZWxkLm5hbWV9YFxuXG4gICAgICBpZiAoZmllbGQubG9jYWxpemVkKSB7XG4gICAgICAgIGlmICh0eXBlb2YgZmllbGREYXRhID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgIE9iamVjdC5lbnRyaWVzKGZpZWxkRGF0YSkuZm9yRWFjaCgoW2xvY2FsZUtleSwgbG9jYWxlRGF0YV0pID0+IHtcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGxvY2FsZURhdGEpKSB7XG4gICAgICAgICAgICAgIHRyYW5zZm9ybVRleHRzKHtcbiAgICAgICAgICAgICAgICBiYXNlUm93OiB7XG4gICAgICAgICAgICAgICAgICBsb2NhbGU6IGxvY2FsZUtleSxcbiAgICAgICAgICAgICAgICAgIHBhdGg6IHRleHRQYXRoLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgZGF0YTogbG9jYWxlRGF0YSxcbiAgICAgICAgICAgICAgICB0ZXh0cyxcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoZmllbGREYXRhKSkge1xuICAgICAgICB0cmFuc2Zvcm1UZXh0cyh7XG4gICAgICAgICAgYmFzZVJvdzoge1xuICAgICAgICAgICAgcGF0aDogdGV4dFBhdGgsXG4gICAgICAgICAgfSxcbiAgICAgICAgICBkYXRhOiBmaWVsZERhdGEsXG4gICAgICAgICAgdGV4dHMsXG4gICAgICAgIH0pXG4gICAgICB9XG5cbiAgICAgIHJldHVyblxuICAgIH1cblxuICAgIGlmIChmaWVsZC50eXBlID09PSAnbnVtYmVyJyAmJiBmaWVsZC5oYXNNYW55KSB7XG4gICAgICBjb25zdCBudW1iZXJQYXRoID0gYCR7cGF0aCB8fCAnJ30ke2ZpZWxkLm5hbWV9YFxuXG4gICAgICBpZiAoZmllbGQubG9jYWxpemVkKSB7XG4gICAgICAgIGlmICh0eXBlb2YgZmllbGREYXRhID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgIE9iamVjdC5lbnRyaWVzKGZpZWxkRGF0YSkuZm9yRWFjaCgoW2xvY2FsZUtleSwgbG9jYWxlRGF0YV0pID0+IHtcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGxvY2FsZURhdGEpKSB7XG4gICAgICAgICAgICAgIHRyYW5zZm9ybU51bWJlcnMoe1xuICAgICAgICAgICAgICAgIGJhc2VSb3c6IHtcbiAgICAgICAgICAgICAgICAgIGxvY2FsZTogbG9jYWxlS2V5LFxuICAgICAgICAgICAgICAgICAgcGF0aDogbnVtYmVyUGF0aCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGRhdGE6IGxvY2FsZURhdGEsXG4gICAgICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoZmllbGREYXRhKSkge1xuICAgICAgICB0cmFuc2Zvcm1OdW1iZXJzKHtcbiAgICAgICAgICBiYXNlUm93OiB7XG4gICAgICAgICAgICBwYXRoOiBudW1iZXJQYXRoLFxuICAgICAgICAgIH0sXG4gICAgICAgICAgZGF0YTogZmllbGREYXRhLFxuICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgIH0pXG4gICAgICB9XG5cbiAgICAgIHJldHVyblxuICAgIH1cblxuICAgIGlmIChmaWVsZC50eXBlID09PSAnc2VsZWN0JyAmJiBmaWVsZC5oYXNNYW55KSB7XG4gICAgICBjb25zdCBzZWxlY3RUYWJsZU5hbWUgPSBhZGFwdGVyLnRhYmxlTmFtZU1hcC5nZXQoYCR7cGFyZW50VGFibGVOYW1lfV8ke2NvbHVtbk5hbWV9YClcbiAgICAgIGlmICghc2VsZWN0c1tzZWxlY3RUYWJsZU5hbWVdKSBzZWxlY3RzW3NlbGVjdFRhYmxlTmFtZV0gPSBbXVxuXG4gICAgICBpZiAoZmllbGQubG9jYWxpemVkKSB7XG4gICAgICAgIGlmICh0eXBlb2YgZGF0YVtmaWVsZC5uYW1lXSA9PT0gJ29iamVjdCcgJiYgZGF0YVtmaWVsZC5uYW1lXSAhPT0gbnVsbCkge1xuICAgICAgICAgIE9i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Ftsb2NhbGVLZXksIGxvY2FsZURhdGFdKSA9PiB7XG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShsb2NhbGVEYXRhKSkge1xuICAgICAgICAgICAgICBjb25zdCBuZXdSb3dzID0gdHJhbnNmb3JtQXJyYXkoe1xuICAgICAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICAgICAgYXJyYXlUYWJsZU5hbWUsXG4gICAgICAgICAgICAgICAgYmFzZVRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgICBibG9ja3MsXG4gICAgICAgICAgICAgICAgYmxvY2tzVG9EZWxldGUsXG4gICAgICAgICAgICAgICAgZGF0YTogbG9jYWxlRGF0YSxcbiAgICAgICAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICAgICAgICBsb2NhbGU6IGxvY2FsZUtleSxcbiAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgIHBhdGgsXG4gICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzVG9EZWxldGUsXG4gICAgICAgICAgICAgICAgc2VsZWN0cyxcbiAgICAgICAgICAgICAgICB0ZXh0cyxcbiAgICAgICAgICAgICAgICB3aXRoaW5BcnJheU9yQmxvY2tMb2NhbGU6IGxvY2FsZUtleSxcbiAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICBhcnJheXNbYXJyYXlUYWJsZU5hbWVdID0gYXJyYXlzW2FycmF5VGFibGVOYW1lXS5jb25jYXQobmV3Um93cylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBjb25zdCBuZXdSb3dzID0gdHJhbnNmb3JtQXJyYXkoe1xuICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgYXJyYXlUYWJsZU5hbWUsXG4gICAgICAgICAgYmFzZVRhYmxlTmFtZSxcbiAgICAgICAgICBibG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ibGVOYW1lLFxuICAgICAgICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICAgICAgICBibG9ja3NUb0RlbGV0ZSxcbiAgICAgICAgICAgICAgICBkYXRhOiBsb2NhbGVEYXRhLFxuICAgICAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgICAgIGxvY2FsZTogbG9jYWxlS2V5LFxuICAgICAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICAgICAgcGF0aCxcbiAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHNUb0RlbGV0ZSxcbiAgICAgICAgICAgICAgICBzZWxlY3RzLFxuICAgICAgICAgICAgICAgIHRleHRzLFxuICAgICAgICAgICAgICAgIHdpdGhpbkFycmF5T3JCbG9ja0xvY2FsZTogbG9jYWxlS2V5LFxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSBpZiAoaXNBcnJheU9mUm93cyhmaWVsZERhdGEpKSB7XG4gICAgICAgIHRyYW5zZm9ybUJsb2Nrcyh7XG4gICAgICAgICAgYWRhcHRlcixcbiAgICAgICAgICBiYXNlVGFibGVOYW1lLFxuICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICBibG9ja3NUb0RlbGV0ZSxcbiAgICAgICAgICBkYXRhOiBmaWVsZERhdGEsXG4gICAgICAgICAgZmllbGQsXG4gICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICBwYXRoLFxuICAgICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgcmVsYXRpb25zaGlwc1RvRGVsZXRlLFxuICAgICAgICAgIHNlbGVjdHMsXG4gICAgICAgICAgdGV4dHMsXG4gICAgICAgICAgd2l0aGluQXJyYXlPckJsb2NrTG9jYWxlLFxuICAgICAgICB9KVxuICAgICAgfVxuXG4gICAgICByZXR1cm5cbiAgICB9XG5cbiAgICBpZiAoZmllbGQudHlwZSA9PT0gJ2dyb3VwJykge1xuICAgICAgaWYgKHR5cGVvZiBkYXRhW2ZpZWxkLm5hbWVdID09PSAnb2JqZWN0JyAmJiBkYXRhW2ZpZWxkLm5hbWVdICE9PSBudWxsKSB7XG4gICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQpIHtcbiAgICAgICAgICBPYmplY3QuZW50cmllcyhkYXRhW2ZpZWxkLm5hbWVdKS5mb3JFYWNoKChbbG9jYWxlS2V5LCBsb2NhbGVEYXRhXSkgPT4ge1xuICAgICAgICAgICAgLy8gcHJlc2VydmUgYXJyYXkgSUQgaWYgdGhlcmUgaXNcbiAgICAgICAgICAgIGxvY2FsZURhdGEuX3V1aWQgPSBkYXRhLmlkIHx8IGRhdGEuX3V1aWRcblxuICAgICAgICAgICAgdHJhdmVyc2VGaWVsZHMoe1xuICAgICAgICAgICAgICBhZGFwdGVyLFxuICAgICAgICAgICAgICBhcnJheXMsXG4gICAgICAgICAgICAgIGJhc2VUYWJsZU5hbWUsXG4gICAgICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICAgICAgYmxvY2tzVG9EZWxldGUsXG4gICAgICAgICAgICAgIGNvbHVtblByZWZpeDogYCR7Y29sdW1uTmFtZX1fYCxcbiAgICAgICAgICAgICAgZGF0YTogbG9jYWxlRGF0YSBhcyBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPixcbiAgICAgICAgICAgICAgZXhpc3RpbmdMb2NhbGVzLFxuICAgICAgICAgICAgICBmaWVsZFByZWZpeDogYCR7ZmllbGROYW1lfV9gLFxuICAgICAgICAgICAgICBmaWVsZHM6IGZpZWxkLmZpZWxkcyxcbiAgICAgICAgICAgICAgZm9yY2VkTG9jYWxlOiBsb2NhbGVLZXksXG4gICAgICAgICAgICAgIGxvY2FsZXMsXG4gICAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICAgIHBhcmVudFRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgcGF0aDogYCR7cGF0aCB8fCAnJ30ke2ZpZWxkLm5hbWV9LmAsXG4gICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHNUb0RlbGV0ZSxcbiAgICAgICAgICAgICAgcm93LFxuICAgICAgICAgICAgICBzZWxlY3RzLFxuICAgICAgICAgICAgICB0ZXh0cyxcbiAgICAgICAgICAgICAgd2l0aGluQXJyYXlPckJsb2NrTG9jYWxlOiBsb2NhbGVLZXksXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH0pXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgLy8gcHJlc2VydmUgYXJyYXkgSUQgaWYgdGhlcmUgaXNcbiAgICAgICAgICBjb25zdCBncm91cERhdGEgPSBkYXRhW2ZpZWxkLm5hbWVdIGFzIFJlY29yZDxzdHJpbmcsIHVua25vd24+XG4gICAgICAgICAgZ3JvdXBEYXRhLl91dWlkID0gZGF0YS5pZCB8fCBkYXRhLl91dWlkXG5cbiAgICAgICAgICB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgICAgICBhZGFwdGVyLFxuICAgICAgICAgICAgYXJyYXlzLFxuICAgICAgICAgICAgYmFzZVRhYmxlTmFtZSxcbiAgICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICAgIGJsb2Nrc1RvRGVsZXRlLFxuICAgICAgICAgICAgY29sdW1uUHJlZml4OiBgJHtjb2x1bW5OYW1lfV9gLFxuICAgICAgICAgICAgZGF0YTogZ3JvdXBEYXRhLFxuICAgICAgICAgICAgZXhpc3RpbmdMb2NhbGVzLFxuICAgICAgICAgICAgZmllbGRQcmVmaXg6IGAke2ZpZWxkTmFtZX1fYCxcbiAgICAgICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICAgICAgbG9jYWxlcyxcbiAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICBwYXJlbnRUYWJsZU5hbWUsXG4gICAgICAgICAgICBwYXRoOiBgJHtwYXRoIHx8ICcnfSR7ZmllbGQubmFtZX0uYCxcbiAgICAgICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgICByZWxhdGlvbnNoaXBzVG9EZWxldGUsXG4gICAgICAgICAgICByb3csXG4gICAgICAgICAgICBzZWxlY3RzLFxuICAgICAgICAgICAgdGV4dHMsXG4gICAgICAgICAgICB3aXRoaW5BcnJheU9yQmxvY2tMb2NhbGUsXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICByZXR1cm5cbiAgICB9XG5cbiAgICBpZiAoZmllbGQudHlwZSA9PT0gJ3RhYnMnKSB7XG4gICAgICBmaWVsZC50YWJzLmZvckVhY2goKHRhYikgPT4ge1xuICAgICAgICBpZiAoJ25hbWUnIGluIHRhYikge1xuICAgICAgICAgIGlmICh0eXBlb2YgZGF0YVt0YWIubmFtZV0gPT09ICdvYmplY3QnICYmIGRhdGFbdGFiLm5hbWVdICE9PSBudWxsKSB7XG4gICAgICAgICAgICBpZiAodGFiLmxvY2FsaXplZCkge1xuICAgICAgICAgICAgICBPYmplY3QuZW50cmllcyhkYXRhW3RhYi5uYW1lXSkuZm9yRWFjaCgoW2xvY2FsZUtleSwgbG9jYWxlRGF0YV0pID0+IHtcbiAgICAgICAgICAgICAgICAvLyBwcmVzZXJ2ZSBhcnJheSBJRCBpZiB0aGVyZSBpc1xuICAgICAgICAgICAgICAgIGxvY2FsZURhdGEuX3V1aWQgPSBkYXRhLmlkIHx8IGRhdGEuX3V1aWRcblxuICAgICAgICAgICAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICAgICAgICBhcnJheXMsXG4gICAgICAgICAgICAgICAgICBiYXNlVGFibGVOYW1lLFxuICAgICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgICAgYmxvY2tzVG9EZWxldGUsXG4gICAgICAgICAgICAgICAgICBjb2x1bW5QcmVmaXg6IGAke2NvbHVtblByZWZpeCB8fCAnJ30ke3RvU25ha2VDYXNlKHRhYi5uYW1lKX1fYCxcbiAgICAgICAgICAgICAgICAgIGRhdGE6IGxvY2FsZURhdGEgYXMgUmVjb3JkPHN0cmluZywgdW5rbm93bj4sXG4gICAgICAgICAgICAgICAgICBleGlzdGluZ0xvY2FsZXMsXG4gICAgICAgICAgICAgICAgICBmaWVsZFByZWZpeDogYCR7ZmllbGRQcmVmaXggfHwgJyd9JHt0YWIubmFtZX1fYCxcbiAgICAgICAgICAgICAgICAgIGZpZWxkczogdGFiLmZpZWxkcyxcbiAgICAgICAgICAgICAgICAgIGZvcmNlZExvY2FsZTogbG9jYWxlS2V5LFxuICAgICAgICAgICAgICAgICAgbG9jYWxlcyxcbiAgICAgICAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICAgICAgICBwYXJlbnRUYWJsZU5hbWUsXG4gICAgICAgICAgICAgICAgICBwYXRoOiBgJHtwYXRoIHx8ICcnfSR7dGFiLm5hbWV9LmAsXG4gICAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwc1RvRGVsZXRlLFxuICAgICAgICAgICAgICAgICAgcm93LFxuICAgICAgICAgICAgICAgICAgc2VsZWN0cyxcbiAgICAgICAgICAgICAgICAgIHRleHRzLFxuICAgICAgICAgICAgICAgICAgd2l0aGluQXJyYXlPckJsb2NrTG9jYWxlOiBsb2NhbGVLZXksXG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGNvbnN0IHRhYkRhdGEgPSBkYXRhW3RhYi5uYW1lXSBhcyBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPlxuICAgICAgICAgICAgICAvLyBwcmVzZXJ2ZSBhcnJheSBJRCBpZiB0aGVyZSBpc1xuICAgICAgICAgICAgICB0YWJEYXRhLl91dWlkID0gZGF0YS5pZCB8fCBkYXRhLl91dWlkXG5cbiAgICAgICAgICAgICAgdHJhdmVyc2VGaWVsZHMoe1xuICAgICAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICAgICAgYXJyYXlzLFxuICAgICAgICAgICAgICAgIGJhc2VUYWJsZU5hbWUsXG4gICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgIGJsb2Nrc1RvRGVsZXRlLFxuICAgICAgICAgICAgICAgIGNvbHVtblByZWZpeDogYCR7Y29sdW1uUHJlZml4IHx8ICcnfSR7dG9TbmFrZUNhc2UodGFiLm5hbWUpfV9gLFxuICAgICAgICAgICAgICAgIGRhdGE6IHRhYkRhdGEsXG4gICAgICAgICAgICAgICAgZXhpc3RpbmdMb2NhbGVzLFxuICAgICAgICAgICAgICAgIGZpZWxkUHJlZml4OiBgJHtmaWVsZFByZWZpeCB8fCAnJ30ke3RhYi5uYW1lfV9gLFxuICAgICAgICAgICAgICAgIGZpZWxkczogdGFiLmZpZWxkcyxcbiAgICAgICAgICAgICAgICBsb2NhbGVzLFxuICAgICAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICAgICAgcGFyZW50VGFibGVOYW1lLFxuICAgICAgICAgICAgICAgIHBhdGg6IGAke3BhdGggfHwgJyd9JHt0YWIubmFtZX0uYCxcbiAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHNUb0RlbGV0ZSxcbiAgICAgICAgICAgICAgICByb3csXG4gICAgICAgICAgICAgICAgc2VsZWN0cyxcbiAgICAgICAgICAgICAgICB0ZXh0cyxcbiAgICAgICAgICAgICAgICB3aXRoaW5BcnJheU9yQmxvY2tMb2NhbGUsXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICBhcnJheXMsXG4gICAgICAgICAgICBiYXNlVGFibGVOYW1lLFxuICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgYmxvY2tzVG9EZWxldGUsXG4gICAgICAgICAgICBjb2x1bW5QcmVmaXgsXG4gICAgICAgICAgICBkYXRhLFxuICAgICAgICAgICAgZXhpc3RpbmdMb2NhbGVzLFxuICAgICAgICAgICAgZmllbGRQcmVmaXgsXG4gICAgICAgICAgICBmaWVsZHM6IHRhYi5maWVsZHMsXG4gICAgICAgICAgICBsb2NhbGVzLFxuICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgIHBhcmVudFRhYmxlTmFtZSxcbiAgICAgICAgICAgIHBhdGgsXG4gICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgcmVsYXRpb25zaGlwc1RvRGVsZXRlLFxuICAgICAgICAgICAgcm93LFxuICAgICAgICAgICAgc2VsZWN0cyxcbiAgICAgICAgICAgIHRleHRzLFxuICAgICAgICAgICAgd2l0aGluQXJyYXlPckJsb2NrTG9jYWxlLFxuICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgfVxuXG4gICAgaWYgKGZpZWxkLnR5cGUgPT09ICdyb3cnIHx8IGZpZWxkLnR5cGUgPT09ICdjb2xsYXBzaWJsZScpIHtcbiAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgYWRhcHRlcixcbiAgICAgICAgYXJyYXlzLFxuICAgICAgICBiYXNlVGFibGVOYW1lLFxuICAgICAgICBibG9ja3MsXG4gICAgICAgIGJsb2Nrc1RvRGVsZXRlLFxuICAgICAgICBjb2x1bW5QcmVmaXgsXG4gICAgICAgIGRhdGEsXG4gICAgICAgIGV4aXN0aW5nTG9jYWxlcyxcbiAgICAgICAgZmllbGRQcmVmaXgsXG4gICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICBmb3JjZWRMb2NhbGUsXG4gICAgICAgIGxvY2FsZXMsXG4gICAgICAgIG51bWJlcnMsXG4gICAgICAgIHBhcmVudFRhYmxlTmFtZSxcbiAgICAgICAgcGF0aCxcbiAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgcmVsYXRpb25zaGlwc1RvRGVsZXRlLFxuICAgICAgICByb3csXG4gICAgICAgIHNlbGVjdHMsXG4gICAgICAgIHRleHRzLFxuICAgICAgICB3aXRoaW5BcnJheU9yQmxvY2tMb2NhbGUsXG4gICAgICB9KVxuICAgIH1cblxuICAgIGlmIChmaWVsZC50eXBlID09PSAncmVsYXRpb25zaGlwJyB8fCBmaWVsZC50eXBlID09PSAndXBsb2FkJykge1xuICAgICAgY29uc3QgcmVsYXRpb25zaGlwUGF0aCA9IGAke3BhdGggfHwgJyd9JHtmaWVsZC5uYW1lfWBcblxuICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCkge1xuICAgICAgICBpZiAodHlwZW9mIGZpZWxkRGF0YSA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICBPYmplY3QuZW50cmllcyhmaWVsZERhdGEpLmZvckVhY2goKFtsb2NhbGVLZXksIGxvY2FsZURhdGFdKSA9PiB7XG4gICAgICAgICAgICBpZiAobG9jYWxlRGF0YSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzVG9EZWxldGUucHVzaCh7XG4gICAgICAgICAgICAgICAgbG9jYWxlOiBsb2NhbGVLZXksXG4gICAgICAgICAgICAgICAgcGF0aDogcmVsYXRpb25zaGlwUGF0aCxcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgcmV0dXJuXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRyYW5zZm9ybVJlbGF0aW9uc2hpcCh7XG4gICAgICAgICAgICAgIGJhc2VSb3c6IHtcbiAgICAgICAgICAgICAgICBsb2NhbGU6IGxvY2FsZUtleSxcbiAgICAgICAgICAgICAgICBwYXRoOiByZWxhdGlvbnNoaXBQYXRoLFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBkYXRhOiBsb2NhbGVEYXRhLFxuICAgICAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKGZpZWxkRGF0YSA9PT0gbnVsbCB8fCAoQXJyYXkuaXNBcnJheShmaWVsZERhdGEpICYmIGZpZWxkRGF0YS5sZW5ndGggPT09IDApKSB7XG4gICAgICAgICAgcmVsYXRpb25zaGlwc1RvRGVsZXRlLnB1c2goeyBwYXRoOiByZWxhdGlvbnNoaXBQYXRoIH0pXG4gICAgICAgICAgcmV0dXJuXG4gICAgICAgIH1cblxuICAgICAgICB0cmFuc2Zvcm1SZWxhdGlvbnNoaXAoe1xuICAgICAgICAgIGJhc2VSb3c6IHtcbiAgICAgICAgICAgIGxvY2FsZTogd2l0aGluQXJyYXlPckJsb2NrTG9jYWxlLFxuICAgICAgICAgICAgcGF0aDogcmVsYXRpb25zaGlwUGF0aCxcbiAgICAgICAgICB9LFxuICAgICAgICAgIGRhdGE6IGZpZWxkRGF0YSxcbiAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICB9KVxuICAgICAgfVxuXG4gICAgICByZXR1cm5cbiAgICB9XG5cbiAgICBpZiAoZmllbGQudHlwZSA9PT0gJ3RleHQnICYmIGZpZWxkLmhhc01hbnkpIHtcbiAgICAgIGNvbnN0IHRleHRQYXRoID0gYCR7cGF0aCB8fCAnJ30ke2ZpZWxkLm5hbWV9YFxuXG4gICAgICBpZiAoZmllbGQubG9jYWxpemVkKSB7XG4gICAgICAgIGlmICh0eXBlb2YgZmllbGREYXRhID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgIE9iamVjdC5lbnRyaWVzKGZpZWxkRGF0YSkuZm9yRWFjaCgoW2xvY2FsZUtleSwgbG9jYWxlRGF0YV0pID0+IHtcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGxvY2FsZURhdGEpKSB7XG4gICAgICAgICAgICAgIHRyYW5zZm9ybVRleHRzKHtcbiAgICAgICAgICAgICAgICBiYXNlUm93OiB7XG4gICAgICAgICAgICAgICAgICBsb2NhbGU6IGxvY2FsZUtleSxcbiAgICAgICAgICAgICAgICAgIHBhdGg6IHRleHRQYXRoLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgZGF0YTogbG9jYWxlRGF0YSxcbiAgICAgICAgICAgICAgICB0ZXh0cyxcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoZmllbGREYXRhKSkge1xuICAgICAgICB0cmFuc2Zvcm1UZXh0cyh7XG4gICAgICAgICAgYmFzZVJvdzoge1xuICAgICAgICAgICAgbG9jYWxlOiB3aXRoaW5BcnJheU9yQmxvY2tMb2NhbGUsXG4gICAgICAgICAgICBwYXRoOiB0ZXh0UGF0aCxcbiAgICAgICAgICB9LFxuICAgICAgICAgIGRhdGE6IGZpZWxkRGF0YSxcbiAgICAgICAgICB0ZXh0cyxcbiAgICAgICAgfSlcbiAgICAgIH1cblxuICAgICAgcmV0dXJuXG4gICAgfVxuXG4gICAgaWYgKGZpZWxkLnR5cGUgPT09ICdudW1iZXInICYmIGZpZWxkLmhhc01hbnkpIHtcbiAgICAgIGNvbnN0IG51bWJlclBhdGggPSBgJHtwYXRoIHx8ICcnfSR7ZmllbGQubmFtZX1gXG5cbiAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBmaWVsZERhdGEgPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgT2JqZWN0LmVudHJpZXMoZmllbGREYXRhKS5mb3JFYWNoKChbbG9jYWxlS2V5LCBsb2NhbGVEYXRhXSkgPT4ge1xuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkobG9jYWxlRGF0YSkpIHtcbiAgICAgICAgICAgICAgdHJhbnNmb3JtTnVtYmVycyh7XG4gICAgICAgICAgICAgICAgYmFzZVJvdzoge1xuICAgICAgICAgICAgICAgICAgbG9jYWxlOiBsb2NhbGVLZXksXG4gICAgICAgICAgICAgICAgICBwYXRoOiBudW1iZXJQYXRoLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgZGF0YTogbG9jYWxlRGF0YSxcbiAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSBpZiAoQXJyYXkuaXNBcnJheShmaWVsZERhdGEpKSB7XG4gICAgICAgIHRyYW5zZm9ybU51bWJlcnMoe1xuICAgICAgICAgIGJhc2VSb3c6IHtcbiAgICAgICAgICAgIGxvY2FsZTogd2l0aGluQXJyYXlPckJsb2NrTG9jYWxlLFxuICAgICAgICAgICAgcGF0aDogbnVtYmVyUGF0aCxcbiAgICAgICAgICB9LFxuICAgICAgICAgIGRhdGE6IGZpZWxkRGF0YSxcbiAgICAgICAgICBudW1iZXJzLFxuICAgICAgICB9KVxuICAgICAgfVxuXG4gICAgICByZXR1cm5cbiAgICB9XG5cbiAgICBpZiAoZmllbGQudHlwZSA9PT0gJ3NlbGVjdCcgJiYgZmllbGQuaGFzTWFueSkge1xuICAgICAgY29uc3Qgc2VsZWN0VGFibGVOYW1lID0gYWRhcHRlci50YWJsZU5hbWVNYXAuZ2V0KGAke3BhcmVudFRhYmxlTmFtZX1fJHtjb2x1bW5OYW1lfWApXG4gICAgICBpZiAoIXNlbGVjdHNbc2VsZWN0VGFibGVOYW1lXSkgc2VsZWN0c1tzZW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SxLQUFLLFVBQVVQLE1BQU1NLElBQUksS0FBSyxhQUFhO3dCQUN2RHlDLGlCQUFpQixJQUFJQyxPQUFPQyxXQUFXO29CQUN6QztvQkFFQSxJQUFJbkMsV0FBVzt3QkFDYitCLEdBQUcsQ0FBQy9CLFVBQVUsQ0FBQ1osVUFBVSxHQUFHNkM7b0JBQzlCLE9BQU87d0JBQ0xGLEdBQUcsQ0FBQzNDLFVBQVUsR0FBRzZDO29CQUNuQjtnQkFDRjtZQUNGO1FBQ0Y7SUFDRjtBQUNGIn0=
package/dist/types.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { ColumnBaseConfig, ColumnDataType, DrizzleConfig, ExtractTablesWithRelations, Relation, Relations } from 'drizzle-orm';
2
2
  import type { NodePgDatabase, NodePgQueryResultHKT } from 'drizzle-orm/node-postgres';
3
3
  import type { PgColumn, PgEnum, PgSchema, PgTableWithColumns, PgTransaction } from 'drizzle-orm/pg-core';
4
+ import type { pgEnum } from 'drizzle-orm/pg-core';
4
5
  import type { PgTableFn } from 'drizzle-orm/pg-core/table';
5
6
  import type { Payload } from 'payload';
6
7
  import type { BaseDatabaseAdapter } from 'payload/database';
@@ -31,6 +32,10 @@ export type GenericTable = PgTableWithColumns<{
31
32
  export type GenericEnum = PgEnum<[string, ...string[]]>;
32
33
  export type GenericRelation = Relations<string, Record<string, Relation<string>>>;
33
34
  export type DrizzleTransaction = PgTransaction<NodePgQueryResultHKT, Record<string, unknown>, ExtractTablesWithRelations<Record<string, unknown>>>;
35
+ type Schema = {
36
+ enum: typeof pgEnum;
37
+ table: PgTableFn;
38
+ } | PgSchema;
34
39
  export type PostgresAdapter = BaseDatabaseAdapter & {
35
40
  drizzle: DrizzleDB;
36
41
  enums: Record<string, GenericEnum>;
@@ -42,15 +47,13 @@ export type PostgresAdapter = BaseDatabaseAdapter & {
42
47
  idType: Args['idType'];
43
48
  localesSuffix?: string;
44
49
  logger: DrizzleConfig['logger'];
45
- pgSchema?: {
46
- table: PgTableFn;
47
- } | PgSchema;
50
+ pgSchema?: Schema;
48
51
  pool: Pool;
49
52
  poolOptions: Args['pool'];
50
53
  push: boolean;
51
54
  relations: Record<string, GenericRelation>;
52
55
  relationshipsSuffix?: string;
53
- schema: Record<string, GenericEnum | GenericRelation | GenericTable>;
56
+ schema: Record<string, unknown>;
54
57
  schemaName?: Args['schemaName'];
55
58
  sessions: {
56
59
  [id: string]: {
@@ -85,7 +88,7 @@ declare module 'payload' {
85
88
  push: boolean;
86
89
  relations: Record<string, GenericRelation>;
87
90
  relationshipsSuffix?: string;
88
- schema: Record<string, GenericEnum | GenericRelation | GenericTable>;
91
+ schema: Record<string, unknown>;
89
92
  sessions: {
90
93
  [id: string]: {
91
94
  db: DrizzleTransaction;
@@ -97,4 +100,5 @@ declare module 'payload' {
97
100
  versionsSuffix?: string;
98
101
  }
99
102
  }
103
+ export {};
100
104
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,0BAA0B,EAC1B,QAAQ,EACR,SAAS,EACV,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrF,OAAO,KAAK,EACV,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,aAAa,EACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,IAAI,CAA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AC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;CAC9B,CAAA;AACD,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;CAC9B,CAAA;AAED,OAAO,QAAQ,SAAS,CAAC;IACvB,UAAiB,eACf,SAAQ,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAC,EACzC,mBAAmB;QACrB,OAAO,EAAE,SAAS,CAAA;QAClB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;QAClC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;QACxD,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,IAAI,EAAE,IAAI,CAAA;QACV,IAAI,EAAE,OAAO,CAAA;QACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;QAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAA;QAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAC/B,QAAQ,EAAE;YACR,CAAC,EAAE,EAAE,MAAM,GAAG;gBACZ,EAAE,EAAE,kBAAkB,CAAA;gBACtB,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;gBAC3B,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;aAC7B,CAAA;SACF,CAAA;QACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;QACpC,cAAc,CAAC,EAAE,MAAM,CAAA;KACxB;CACF"}
@@ -1,3 +1,3 @@
1
- import type { DrizzleDB } from '../types';
2
- export declare const migrationTableExists: (db: DrizzleDB) => Promise<boolean>;
1
+ import type { PostgresAdapter } from '../types.js';
2
+ export declare const migrationTableExists: (adapter: PostgresAdapter) => Promise<boolean>;
3
3
  //# sourceMappingURL=migrationTableExists.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migrationTableExists.d.ts","sourceRoot":"","sources":["../../src/utilities/migrationTableExists.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,eAAO,MAAM,oBAAoB,qBAA0B,QAAQ,OAAO,CAMzE,CAAA"}
1
+ {"version":3,"file":"migrationTableExists.d.ts","sourceRoot":"","sources":["../../src/utilities/migrationTableExists.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,oBAAoB,YAAmB,eAAe,KAAG,QAAQ,OAAO,CAapF,CAAA"}