@webiny/migrations 6.0.0-beta.0 → 6.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (529) hide show
  1. package/LICENSE +2 -7
  2. package/README.md +11 -1
  3. package/ddb-es.d.ts +1 -19
  4. package/ddb-es.js +5 -66
  5. package/ddb-es.js.map +1 -1
  6. package/ddb.d.ts +1 -19
  7. package/ddb.js +5 -50
  8. package/ddb.js.map +1 -1
  9. package/package.json +20 -32
  10. package/utils/createEntity.d.ts +3 -89
  11. package/utils/createEntity.js +3 -37
  12. package/utils/createEntity.js.map +1 -1
  13. package/utils/createTenantEntity.d.ts +2 -48
  14. package/utils/createTenantEntity.js +3 -10
  15. package/utils/createTenantEntity.js.map +1 -1
  16. package/utils/dynamoDb.d.ts +2 -1
  17. package/utils/dynamoDb.js +2 -60
  18. package/utils/dynamoDb.js.map +1 -1
  19. package/utils/elasticsearch/disableEsIndexing.d.ts +2 -2
  20. package/utils/elasticsearch/disableEsIndexing.js +3 -11
  21. package/utils/elasticsearch/disableEsIndexing.js.map +1 -1
  22. package/utils/elasticsearch/esCreateIndex.d.ts +1 -2
  23. package/utils/elasticsearch/esCreateIndex.js +8 -24
  24. package/utils/elasticsearch/esCreateIndex.js.map +1 -1
  25. package/utils/elasticsearch/esFindOne.d.ts +2 -2
  26. package/utils/elasticsearch/esFindOne.js +1 -8
  27. package/utils/elasticsearch/esFindOne.js.map +1 -1
  28. package/utils/elasticsearch/esGetIndexExist.d.ts +1 -2
  29. package/utils/elasticsearch/esGetIndexExist.js +4 -13
  30. package/utils/elasticsearch/esGetIndexExist.js.map +1 -1
  31. package/utils/elasticsearch/esGetIndexName.d.ts +0 -1
  32. package/utils/elasticsearch/esGetIndexName.js +8 -23
  33. package/utils/elasticsearch/esGetIndexName.js.map +1 -1
  34. package/utils/elasticsearch/esGetIndexSettings.d.ts +1 -1
  35. package/utils/elasticsearch/esGetIndexSettings.js +5 -13
  36. package/utils/elasticsearch/esGetIndexSettings.js.map +1 -1
  37. package/utils/elasticsearch/esListIndexes.d.ts +1 -1
  38. package/utils/elasticsearch/esListIndexes.js +1 -8
  39. package/utils/elasticsearch/esListIndexes.js.map +1 -1
  40. package/utils/elasticsearch/esPutIndexSettings.d.ts +1 -1
  41. package/utils/elasticsearch/esPutIndexSettings.js +3 -11
  42. package/utils/elasticsearch/esPutIndexSettings.js.map +1 -1
  43. package/utils/elasticsearch/esQueryAll.d.ts +2 -2
  44. package/utils/elasticsearch/esQueryAll.js +3 -10
  45. package/utils/elasticsearch/esQueryAll.js.map +1 -1
  46. package/utils/elasticsearch/esQueryAllWithCallback.d.ts +2 -2
  47. package/utils/elasticsearch/esQueryAllWithCallback.js +3 -10
  48. package/utils/elasticsearch/esQueryAllWithCallback.js.map +1 -1
  49. package/utils/elasticsearch/fetchOriginalEsSettings.d.ts +2 -3
  50. package/utils/elasticsearch/fetchOriginalEsSettings.js +4 -12
  51. package/utils/elasticsearch/fetchOriginalEsSettings.js.map +1 -1
  52. package/utils/elasticsearch/index.d.ts +12 -12
  53. package/utils/elasticsearch/index.js +12 -137
  54. package/utils/elasticsearch/index.js.map +1 -1
  55. package/utils/elasticsearch/plugins/base.js +3 -9
  56. package/utils/elasticsearch/plugins/base.js.map +1 -1
  57. package/utils/elasticsearch/plugins/index.d.ts +1 -1
  58. package/utils/elasticsearch/plugins/index.js +3 -11
  59. package/utils/elasticsearch/plugins/index.js.map +1 -1
  60. package/utils/elasticsearch/restoreOriginalEsSettings.d.ts +3 -4
  61. package/utils/elasticsearch/restoreOriginalEsSettings.js +13 -12
  62. package/utils/elasticsearch/restoreOriginalEsSettings.js.map +1 -1
  63. package/utils/getCompressedData.js +12 -0
  64. package/utils/getCompressedData.js.map +1 -0
  65. package/utils/index.d.ts +5 -6
  66. package/utils/index.js +5 -71
  67. package/utils/index.js.map +1 -1
  68. package/migrations/5.35.0/001/FileSettingsMigration.d.ts +0 -12
  69. package/migrations/5.35.0/001/FileSettingsMigration.js +0 -93
  70. package/migrations/5.35.0/001/FileSettingsMigration.js.map +0 -1
  71. package/migrations/5.35.0/001/ddb/FileDataMigration.d.ts +0 -14
  72. package/migrations/5.35.0/001/ddb/FileDataMigration.js +0 -156
  73. package/migrations/5.35.0/001/ddb/FileDataMigration.js.map +0 -1
  74. package/migrations/5.35.0/001/ddb/index.d.ts +0 -10
  75. package/migrations/5.35.0/001/ddb/index.js +0 -50
  76. package/migrations/5.35.0/001/ddb/index.js.map +0 -1
  77. package/migrations/5.35.0/001/ddb-es/FileDataMigration.d.ts +0 -17
  78. package/migrations/5.35.0/001/ddb-es/FileDataMigration.js +0 -172
  79. package/migrations/5.35.0/001/ddb-es/FileDataMigration.js.map +0 -1
  80. package/migrations/5.35.0/001/ddb-es/index.d.ts +0 -12
  81. package/migrations/5.35.0/001/ddb-es/index.js +0 -65
  82. package/migrations/5.35.0/001/ddb-es/index.js.map +0 -1
  83. package/migrations/5.35.0/001/entities/createFileEntity.d.ts +0 -92
  84. package/migrations/5.35.0/001/entities/createFileEntity.js +0 -61
  85. package/migrations/5.35.0/001/entities/createFileEntity.js.map +0 -1
  86. package/migrations/5.35.0/001/entities/createLocaleEntity.d.ts +0 -42
  87. package/migrations/5.35.0/001/entities/createLocaleEntity.js +0 -52
  88. package/migrations/5.35.0/001/entities/createLocaleEntity.js.map +0 -1
  89. package/migrations/5.35.0/001/entities/createSettingsEntity.d.ts +0 -90
  90. package/migrations/5.35.0/001/entities/createSettingsEntity.js +0 -37
  91. package/migrations/5.35.0/001/entities/createSettingsEntity.js.map +0 -1
  92. package/migrations/5.35.0/001/entities/createTenantEntity.d.ts +0 -42
  93. package/migrations/5.35.0/001/entities/createTenantEntity.js +0 -69
  94. package/migrations/5.35.0/001/entities/createTenantEntity.js.map +0 -1
  95. package/migrations/5.35.0/001/types.d.ts +0 -19
  96. package/migrations/5.35.0/001/types.js +0 -7
  97. package/migrations/5.35.0/001/types.js.map +0 -1
  98. package/migrations/5.35.0/002/createLocaleEntity.d.ts +0 -42
  99. package/migrations/5.35.0/002/createLocaleEntity.js +0 -32
  100. package/migrations/5.35.0/002/createLocaleEntity.js.map +0 -1
  101. package/migrations/5.35.0/002/createSettingsEntity.d.ts +0 -90
  102. package/migrations/5.35.0/002/createSettingsEntity.js +0 -61
  103. package/migrations/5.35.0/002/createSettingsEntity.js.map +0 -1
  104. package/migrations/5.35.0/002/createTenantEntity.d.ts +0 -42
  105. package/migrations/5.35.0/002/createTenantEntity.js +0 -46
  106. package/migrations/5.35.0/002/createTenantEntity.js.map +0 -1
  107. package/migrations/5.35.0/002/index.d.ts +0 -13
  108. package/migrations/5.35.0/002/index.js +0 -117
  109. package/migrations/5.35.0/002/index.js.map +0 -1
  110. package/migrations/5.35.0/003/createTenantEntity.d.ts +0 -42
  111. package/migrations/5.35.0/003/createTenantEntity.js +0 -46
  112. package/migrations/5.35.0/003/createTenantEntity.js.map +0 -1
  113. package/migrations/5.35.0/003/createUserEntity.d.ts +0 -90
  114. package/migrations/5.35.0/003/createUserEntity.js +0 -55
  115. package/migrations/5.35.0/003/createUserEntity.js.map +0 -1
  116. package/migrations/5.35.0/003/index.d.ts +0 -12
  117. package/migrations/5.35.0/003/index.js +0 -92
  118. package/migrations/5.35.0/003/index.js.map +0 -1
  119. package/migrations/5.35.0/004/createTenantEntity.d.ts +0 -90
  120. package/migrations/5.35.0/004/createTenantEntity.js +0 -57
  121. package/migrations/5.35.0/004/createTenantEntity.js.map +0 -1
  122. package/migrations/5.35.0/004/index.d.ts +0 -11
  123. package/migrations/5.35.0/004/index.js +0 -80
  124. package/migrations/5.35.0/004/index.js.map +0 -1
  125. package/migrations/5.35.0/005/createLocaleEntity.d.ts +0 -42
  126. package/migrations/5.35.0/005/createLocaleEntity.js +0 -32
  127. package/migrations/5.35.0/005/createLocaleEntity.js.map +0 -1
  128. package/migrations/5.35.0/005/createModelEntity.d.ts +0 -42
  129. package/migrations/5.35.0/005/createModelEntity.js +0 -101
  130. package/migrations/5.35.0/005/createModelEntity.js.map +0 -1
  131. package/migrations/5.35.0/005/createTenantEntity.d.ts +0 -48
  132. package/migrations/5.35.0/005/createTenantEntity.js +0 -13
  133. package/migrations/5.35.0/005/createTenantEntity.js.map +0 -1
  134. package/migrations/5.35.0/005/index.d.ts +0 -15
  135. package/migrations/5.35.0/005/index.js +0 -144
  136. package/migrations/5.35.0/005/index.js.map +0 -1
  137. package/migrations/5.35.0/005/types.d.ts +0 -42
  138. package/migrations/5.35.0/005/types.js +0 -7
  139. package/migrations/5.35.0/005/types.js.map +0 -1
  140. package/migrations/5.35.0/006/constants.d.ts +0 -3
  141. package/migrations/5.35.0/006/constants.js +0 -11
  142. package/migrations/5.35.0/006/constants.js.map +0 -1
  143. package/migrations/5.35.0/006/ddb/PageDataMigration.d.ts +0 -17
  144. package/migrations/5.35.0/006/ddb/PageDataMigration.js +0 -249
  145. package/migrations/5.35.0/006/ddb/PageDataMigration.js.map +0 -1
  146. package/migrations/5.35.0/006/ddb/index.d.ts +0 -10
  147. package/migrations/5.35.0/006/ddb/index.js +0 -49
  148. package/migrations/5.35.0/006/ddb/index.js.map +0 -1
  149. package/migrations/5.35.0/006/ddb-es/PageDataMigration.d.ts +0 -22
  150. package/migrations/5.35.0/006/ddb-es/PageDataMigration.js +0 -413
  151. package/migrations/5.35.0/006/ddb-es/PageDataMigration.js.map +0 -1
  152. package/migrations/5.35.0/006/ddb-es/index.d.ts +0 -12
  153. package/migrations/5.35.0/006/ddb-es/index.js +0 -64
  154. package/migrations/5.35.0/006/ddb-es/index.js.map +0 -1
  155. package/migrations/5.35.0/006/entities/createEntryEntity.d.ts +0 -89
  156. package/migrations/5.35.0/006/entities/createEntryEntity.js +0 -106
  157. package/migrations/5.35.0/006/entities/createEntryEntity.js.map +0 -1
  158. package/migrations/5.35.0/006/entities/createLocaleEntity.d.ts +0 -42
  159. package/migrations/5.35.0/006/entities/createLocaleEntity.js +0 -32
  160. package/migrations/5.35.0/006/entities/createLocaleEntity.js.map +0 -1
  161. package/migrations/5.35.0/006/entities/createPageEntity.d.ts +0 -89
  162. package/migrations/5.35.0/006/entities/createPageEntity.js +0 -113
  163. package/migrations/5.35.0/006/entities/createPageEntity.js.map +0 -1
  164. package/migrations/5.35.0/006/entities/createTenantEntity.d.ts +0 -48
  165. package/migrations/5.35.0/006/entities/createTenantEntity.js +0 -13
  166. package/migrations/5.35.0/006/entities/createTenantEntity.js.map +0 -1
  167. package/migrations/5.35.0/006/types.d.ts +0 -91
  168. package/migrations/5.35.0/006/types.js +0 -7
  169. package/migrations/5.35.0/006/types.js.map +0 -1
  170. package/migrations/5.35.0/006/utils/getCompressedData.js +0 -19
  171. package/migrations/5.35.0/006/utils/getCompressedData.js.map +0 -1
  172. package/migrations/5.35.0/006/utils/getLexicalContentText.d.ts +0 -1
  173. package/migrations/5.35.0/006/utils/getLexicalContentText.js +0 -29
  174. package/migrations/5.35.0/006/utils/getLexicalContentText.js.map +0 -1
  175. package/migrations/5.35.0/006/utils/getSearchableContent.d.ts +0 -6
  176. package/migrations/5.35.0/006/utils/getSearchableContent.js +0 -45
  177. package/migrations/5.35.0/006/utils/getSearchableContent.js.map +0 -1
  178. package/migrations/5.35.0/006/utils/processors/button.d.ts +0 -1
  179. package/migrations/5.35.0/006/utils/processors/button.js +0 -17
  180. package/migrations/5.35.0/006/utils/processors/button.js.map +0 -1
  181. package/migrations/5.35.0/006/utils/processors/image.d.ts +0 -1
  182. package/migrations/5.35.0/006/utils/processors/image.js +0 -17
  183. package/migrations/5.35.0/006/utils/processors/image.js.map +0 -1
  184. package/migrations/5.35.0/006/utils/processors/images.d.ts +0 -1
  185. package/migrations/5.35.0/006/utils/processors/images.js +0 -18
  186. package/migrations/5.35.0/006/utils/processors/images.js.map +0 -1
  187. package/migrations/5.35.0/006/utils/processors/index.d.ts +0 -1
  188. package/migrations/5.35.0/006/utils/processors/index.js +0 -13
  189. package/migrations/5.35.0/006/utils/processors/index.js.map +0 -1
  190. package/migrations/5.35.0/006/utils/processors/paragraph.d.ts +0 -1
  191. package/migrations/5.35.0/006/utils/processors/paragraph.js +0 -25
  192. package/migrations/5.35.0/006/utils/processors/paragraph.js.map +0 -1
  193. package/migrations/5.36.0/001/constants.d.ts +0 -3
  194. package/migrations/5.36.0/001/constants.js +0 -11
  195. package/migrations/5.36.0/001/constants.js.map +0 -1
  196. package/migrations/5.36.0/001/ddb/FileDataMigration.d.ts +0 -17
  197. package/migrations/5.36.0/001/ddb/FileDataMigration.js +0 -241
  198. package/migrations/5.36.0/001/ddb/FileDataMigration.js.map +0 -1
  199. package/migrations/5.36.0/001/ddb/index.d.ts +0 -10
  200. package/migrations/5.36.0/001/ddb/index.js +0 -49
  201. package/migrations/5.36.0/001/ddb/index.js.map +0 -1
  202. package/migrations/5.36.0/001/ddb-es/FileDataMigration.d.ts +0 -20
  203. package/migrations/5.36.0/001/ddb-es/FileDataMigration.js +0 -405
  204. package/migrations/5.36.0/001/ddb-es/FileDataMigration.js.map +0 -1
  205. package/migrations/5.36.0/001/ddb-es/index.d.ts +0 -12
  206. package/migrations/5.36.0/001/ddb-es/index.js +0 -64
  207. package/migrations/5.36.0/001/ddb-es/index.js.map +0 -1
  208. package/migrations/5.36.0/001/entities/createEntryEntity.d.ts +0 -89
  209. package/migrations/5.36.0/001/entities/createEntryEntity.js +0 -106
  210. package/migrations/5.36.0/001/entities/createEntryEntity.js.map +0 -1
  211. package/migrations/5.36.0/001/entities/createFileEntity.d.ts +0 -95
  212. package/migrations/5.36.0/001/entities/createFileEntity.js +0 -33
  213. package/migrations/5.36.0/001/entities/createFileEntity.js.map +0 -1
  214. package/migrations/5.36.0/001/entities/createLocaleEntity.d.ts +0 -42
  215. package/migrations/5.36.0/001/entities/createLocaleEntity.js +0 -32
  216. package/migrations/5.36.0/001/entities/createLocaleEntity.js.map +0 -1
  217. package/migrations/5.36.0/001/entities/createTenantEntity.d.ts +0 -48
  218. package/migrations/5.36.0/001/entities/createTenantEntity.js +0 -13
  219. package/migrations/5.36.0/001/entities/createTenantEntity.js.map +0 -1
  220. package/migrations/5.36.0/001/types.d.ts +0 -67
  221. package/migrations/5.36.0/001/types.js +0 -7
  222. package/migrations/5.36.0/001/types.js.map +0 -1
  223. package/migrations/5.36.0/001/utils/createMimeTag.d.ts +0 -1
  224. package/migrations/5.36.0/001/utils/createMimeTag.js +0 -10
  225. package/migrations/5.36.0/001/utils/createMimeTag.js.map +0 -1
  226. package/migrations/5.36.0/001/utils/getCompressedData.d.ts +0 -4
  227. package/migrations/5.36.0/001/utils/getCompressedData.js +0 -19
  228. package/migrations/5.36.0/001/utils/getCompressedData.js.map +0 -1
  229. package/migrations/5.37.0/001/TenantLinkDataMigration.d.ts +0 -14
  230. package/migrations/5.37.0/001/TenantLinkDataMigration.js +0 -106
  231. package/migrations/5.37.0/001/TenantLinkDataMigration.js.map +0 -1
  232. package/migrations/5.37.0/001/entities/createTenantEntity.d.ts +0 -48
  233. package/migrations/5.37.0/001/entities/createTenantEntity.js +0 -13
  234. package/migrations/5.37.0/001/entities/createTenantEntity.js.map +0 -1
  235. package/migrations/5.37.0/001/entities/createTenantLinkEntity.d.ts +0 -48
  236. package/migrations/5.37.0/001/entities/createTenantLinkEntity.js +0 -17
  237. package/migrations/5.37.0/001/entities/createTenantLinkEntity.js.map +0 -1
  238. package/migrations/5.37.0/001/index.d.ts +0 -10
  239. package/migrations/5.37.0/001/index.js +0 -49
  240. package/migrations/5.37.0/001/index.js.map +0 -1
  241. package/migrations/5.37.0/001/types.d.ts +0 -25
  242. package/migrations/5.37.0/001/types.js +0 -7
  243. package/migrations/5.37.0/001/types.js.map +0 -1
  244. package/migrations/5.37.0/001/utils/isMigratedTenantLink.d.ts +0 -2
  245. package/migrations/5.37.0/001/utils/isMigratedTenantLink.js +0 -12
  246. package/migrations/5.37.0/001/utils/isMigratedTenantLink.js.map +0 -1
  247. package/migrations/5.37.0/002/constants.d.ts +0 -1
  248. package/migrations/5.37.0/002/constants.js +0 -9
  249. package/migrations/5.37.0/002/constants.js.map +0 -1
  250. package/migrations/5.37.0/002/ddb/index.d.ts +0 -22
  251. package/migrations/5.37.0/002/ddb/index.js +0 -133
  252. package/migrations/5.37.0/002/ddb/index.js.map +0 -1
  253. package/migrations/5.37.0/002/ddb-es/index.d.ts +0 -35
  254. package/migrations/5.37.0/002/ddb-es/index.js +0 -321
  255. package/migrations/5.37.0/002/ddb-es/index.js.map +0 -1
  256. package/migrations/5.37.0/002/entities/createEntryEntity.d.ts +0 -89
  257. package/migrations/5.37.0/002/entities/createEntryEntity.js +0 -109
  258. package/migrations/5.37.0/002/entities/createEntryEntity.js.map +0 -1
  259. package/migrations/5.37.0/002/entities/createLocaleEntity.d.ts +0 -42
  260. package/migrations/5.37.0/002/entities/createLocaleEntity.js +0 -32
  261. package/migrations/5.37.0/002/entities/createLocaleEntity.js.map +0 -1
  262. package/migrations/5.37.0/002/entities/createTenantEntity.d.ts +0 -48
  263. package/migrations/5.37.0/002/entities/createTenantEntity.js +0 -13
  264. package/migrations/5.37.0/002/entities/createTenantEntity.js.map +0 -1
  265. package/migrations/5.37.0/002/types.d.ts +0 -53
  266. package/migrations/5.37.0/002/types.js +0 -7
  267. package/migrations/5.37.0/002/types.js.map +0 -1
  268. package/migrations/5.37.0/002/utils/getCompressedData.d.ts +0 -4
  269. package/migrations/5.37.0/002/utils/getCompressedData.js +0 -19
  270. package/migrations/5.37.0/002/utils/getCompressedData.js.map +0 -1
  271. package/migrations/5.37.0/002/utils/getDecompressedData.d.ts +0 -1
  272. package/migrations/5.37.0/002/utils/getDecompressedData.js +0 -31
  273. package/migrations/5.37.0/002/utils/getDecompressedData.js.map +0 -1
  274. package/migrations/5.37.0/003/constants.d.ts +0 -3
  275. package/migrations/5.37.0/003/constants.js +0 -11
  276. package/migrations/5.37.0/003/constants.js.map +0 -1
  277. package/migrations/5.37.0/003/ddb/AcoFolderMigration.d.ts +0 -15
  278. package/migrations/5.37.0/003/ddb/AcoFolderMigration.js +0 -179
  279. package/migrations/5.37.0/003/ddb/AcoFolderMigration.js.map +0 -1
  280. package/migrations/5.37.0/003/ddb/index.d.ts +0 -10
  281. package/migrations/5.37.0/003/ddb/index.js +0 -49
  282. package/migrations/5.37.0/003/ddb/index.js.map +0 -1
  283. package/migrations/5.37.0/003/ddb-es/AcoFolderMigration.d.ts +0 -20
  284. package/migrations/5.37.0/003/ddb-es/AcoFolderMigration.js +0 -313
  285. package/migrations/5.37.0/003/ddb-es/AcoFolderMigration.js.map +0 -1
  286. package/migrations/5.37.0/003/ddb-es/index.d.ts +0 -12
  287. package/migrations/5.37.0/003/ddb-es/index.js +0 -64
  288. package/migrations/5.37.0/003/ddb-es/index.js.map +0 -1
  289. package/migrations/5.37.0/003/ddb-es/latestElasticsearchData.d.ts +0 -4
  290. package/migrations/5.37.0/003/ddb-es/latestElasticsearchData.js +0 -30
  291. package/migrations/5.37.0/003/ddb-es/latestElasticsearchData.js.map +0 -1
  292. package/migrations/5.37.0/003/entities/createEntryEntity.d.ts +0 -89
  293. package/migrations/5.37.0/003/entities/createEntryEntity.js +0 -109
  294. package/migrations/5.37.0/003/entities/createEntryEntity.js.map +0 -1
  295. package/migrations/5.37.0/003/entities/createLocaleEntity.d.ts +0 -42
  296. package/migrations/5.37.0/003/entities/createLocaleEntity.js +0 -32
  297. package/migrations/5.37.0/003/entities/createLocaleEntity.js.map +0 -1
  298. package/migrations/5.37.0/003/entities/createTenantEntity.d.ts +0 -48
  299. package/migrations/5.37.0/003/entities/createTenantEntity.js +0 -13
  300. package/migrations/5.37.0/003/entities/createTenantEntity.js.map +0 -1
  301. package/migrations/5.37.0/003/types.d.ts +0 -46
  302. package/migrations/5.37.0/003/types.js +0 -7
  303. package/migrations/5.37.0/003/types.js.map +0 -1
  304. package/migrations/5.37.0/003/utils/getCompressedData.d.ts +0 -4
  305. package/migrations/5.37.0/003/utils/getCompressedData.js +0 -19
  306. package/migrations/5.37.0/003/utils/getCompressedData.js.map +0 -1
  307. package/migrations/5.37.0/003/utils/getDecompressedData.d.ts +0 -1
  308. package/migrations/5.37.0/003/utils/getDecompressedData.js +0 -31
  309. package/migrations/5.37.0/003/utils/getDecompressedData.js.map +0 -1
  310. package/migrations/5.37.0/004/constants.d.ts +0 -7
  311. package/migrations/5.37.0/004/constants.js +0 -15
  312. package/migrations/5.37.0/004/constants.js.map +0 -1
  313. package/migrations/5.37.0/004/ddb/PageDataMigration.d.ts +0 -17
  314. package/migrations/5.37.0/004/ddb/PageDataMigration.js +0 -269
  315. package/migrations/5.37.0/004/ddb/PageDataMigration.js.map +0 -1
  316. package/migrations/5.37.0/004/ddb/index.d.ts +0 -10
  317. package/migrations/5.37.0/004/ddb/index.js +0 -49
  318. package/migrations/5.37.0/004/ddb/index.js.map +0 -1
  319. package/migrations/5.37.0/004/ddb-es/PageDataMigration.d.ts +0 -22
  320. package/migrations/5.37.0/004/ddb-es/PageDataMigration.js +0 -364
  321. package/migrations/5.37.0/004/ddb-es/PageDataMigration.js.map +0 -1
  322. package/migrations/5.37.0/004/ddb-es/index.d.ts +0 -12
  323. package/migrations/5.37.0/004/ddb-es/index.js +0 -64
  324. package/migrations/5.37.0/004/ddb-es/index.js.map +0 -1
  325. package/migrations/5.37.0/004/entities/createEntryEntity.d.ts +0 -89
  326. package/migrations/5.37.0/004/entities/createEntryEntity.js +0 -109
  327. package/migrations/5.37.0/004/entities/createEntryEntity.js.map +0 -1
  328. package/migrations/5.37.0/004/entities/createLocaleEntity.d.ts +0 -42
  329. package/migrations/5.37.0/004/entities/createLocaleEntity.js +0 -32
  330. package/migrations/5.37.0/004/entities/createLocaleEntity.js.map +0 -1
  331. package/migrations/5.37.0/004/entities/createPageEntity.d.ts +0 -89
  332. package/migrations/5.37.0/004/entities/createPageEntity.js +0 -113
  333. package/migrations/5.37.0/004/entities/createPageEntity.js.map +0 -1
  334. package/migrations/5.37.0/004/entities/createTenantEntity.d.ts +0 -48
  335. package/migrations/5.37.0/004/entities/createTenantEntity.js +0 -13
  336. package/migrations/5.37.0/004/entities/createTenantEntity.js.map +0 -1
  337. package/migrations/5.37.0/004/types.d.ts +0 -149
  338. package/migrations/5.37.0/004/types.js +0 -7
  339. package/migrations/5.37.0/004/types.js.map +0 -1
  340. package/migrations/5.37.0/004/utils/getCompressedData.d.ts +0 -4
  341. package/migrations/5.37.0/004/utils/getCompressedData.js +0 -19
  342. package/migrations/5.37.0/004/utils/getCompressedData.js.map +0 -1
  343. package/migrations/5.37.0/005/constants.d.ts +0 -3
  344. package/migrations/5.37.0/005/constants.js +0 -11
  345. package/migrations/5.37.0/005/constants.js.map +0 -1
  346. package/migrations/5.37.0/005/ddb/index.d.ts +0 -20
  347. package/migrations/5.37.0/005/ddb/index.js +0 -245
  348. package/migrations/5.37.0/005/ddb/index.js.map +0 -1
  349. package/migrations/5.37.0/005/ddb-es/index.d.ts +0 -22
  350. package/migrations/5.37.0/005/ddb-es/index.js +0 -382
  351. package/migrations/5.37.0/005/ddb-es/index.js.map +0 -1
  352. package/migrations/5.37.0/005/entities/createEntryEntity.d.ts +0 -89
  353. package/migrations/5.37.0/005/entities/createEntryEntity.js +0 -109
  354. package/migrations/5.37.0/005/entities/createEntryEntity.js.map +0 -1
  355. package/migrations/5.37.0/005/entities/createFileEntity.d.ts +0 -95
  356. package/migrations/5.37.0/005/entities/createFileEntity.js +0 -33
  357. package/migrations/5.37.0/005/entities/createFileEntity.js.map +0 -1
  358. package/migrations/5.37.0/005/entities/createLocaleEntity.d.ts +0 -42
  359. package/migrations/5.37.0/005/entities/createLocaleEntity.js +0 -32
  360. package/migrations/5.37.0/005/entities/createLocaleEntity.js.map +0 -1
  361. package/migrations/5.37.0/005/entities/createTenantEntity.d.ts +0 -48
  362. package/migrations/5.37.0/005/entities/createTenantEntity.js +0 -13
  363. package/migrations/5.37.0/005/entities/createTenantEntity.js.map +0 -1
  364. package/migrations/5.37.0/005/entities/createTenantLinkEntity.d.ts +0 -48
  365. package/migrations/5.37.0/005/entities/createTenantLinkEntity.js +0 -17
  366. package/migrations/5.37.0/005/entities/createTenantLinkEntity.js.map +0 -1
  367. package/migrations/5.37.0/005/types.d.ts +0 -109
  368. package/migrations/5.37.0/005/types.js +0 -7
  369. package/migrations/5.37.0/005/types.js.map +0 -1
  370. package/migrations/5.38.0/001/ddb/index.d.ts +0 -11
  371. package/migrations/5.38.0/001/ddb/index.js +0 -116
  372. package/migrations/5.38.0/001/ddb/index.js.map +0 -1
  373. package/migrations/5.38.0/001/ddb-es/index.d.ts +0 -13
  374. package/migrations/5.38.0/001/ddb-es/index.js +0 -211
  375. package/migrations/5.38.0/001/ddb-es/index.js.map +0 -1
  376. package/migrations/5.38.0/001/entities/createFormEntity.d.ts +0 -42
  377. package/migrations/5.38.0/001/entities/createFormEntity.js +0 -92
  378. package/migrations/5.38.0/001/entities/createFormEntity.js.map +0 -1
  379. package/migrations/5.38.0/001/types.d.ts +0 -11
  380. package/migrations/5.38.0/001/types.js +0 -7
  381. package/migrations/5.38.0/001/types.js.map +0 -1
  382. package/migrations/5.38.0/002/ddb/index.d.ts +0 -22
  383. package/migrations/5.38.0/002/ddb/index.js +0 -140
  384. package/migrations/5.38.0/002/ddb/index.js.map +0 -1
  385. package/migrations/5.38.0/002/ddb-es/index.d.ts +0 -32
  386. package/migrations/5.38.0/002/ddb-es/index.js +0 -250
  387. package/migrations/5.38.0/002/ddb-es/index.js.map +0 -1
  388. package/migrations/5.38.0/002/entities/createFormEntity.d.ts +0 -42
  389. package/migrations/5.38.0/002/entities/createFormEntity.js +0 -92
  390. package/migrations/5.38.0/002/entities/createFormEntity.js.map +0 -1
  391. package/migrations/5.38.0/002/entities/createFormSubmissionDdbEsEntity.d.ts +0 -48
  392. package/migrations/5.38.0/002/entities/createFormSubmissionDdbEsEntity.js +0 -29
  393. package/migrations/5.38.0/002/entities/createFormSubmissionDdbEsEntity.js.map +0 -1
  394. package/migrations/5.38.0/002/entities/createFormSubmissionEntity.d.ts +0 -42
  395. package/migrations/5.38.0/002/entities/createFormSubmissionEntity.js +0 -56
  396. package/migrations/5.38.0/002/entities/createFormSubmissionEntity.js.map +0 -1
  397. package/migrations/5.38.0/002/types.d.ts +0 -23
  398. package/migrations/5.38.0/002/types.js +0 -7
  399. package/migrations/5.38.0/002/types.js.map +0 -1
  400. package/migrations/5.38.0/003/ddb/compressContent.d.ts +0 -4
  401. package/migrations/5.38.0/003/ddb/compressContent.js +0 -17
  402. package/migrations/5.38.0/003/ddb/compressContent.js.map +0 -1
  403. package/migrations/5.38.0/003/ddb/index.d.ts +0 -12
  404. package/migrations/5.38.0/003/ddb/index.js +0 -143
  405. package/migrations/5.38.0/003/ddb/index.js.map +0 -1
  406. package/migrations/5.38.0/003/entities/createPageBlockEntity.d.ts +0 -83
  407. package/migrations/5.38.0/003/entities/createPageBlockEntity.js +0 -68
  408. package/migrations/5.38.0/003/entities/createPageBlockEntity.js.map +0 -1
  409. package/migrations/5.38.0/003/types.d.ts +0 -8
  410. package/migrations/5.38.0/003/types.js +0 -7
  411. package/migrations/5.38.0/003/types.js.map +0 -1
  412. package/migrations/5.39.0/001/ddb/index.d.ts +0 -20
  413. package/migrations/5.39.0/001/ddb/index.js +0 -136
  414. package/migrations/5.39.0/001/ddb/index.js.map +0 -1
  415. package/migrations/5.39.0/001/ddb-es/index.d.ts +0 -30
  416. package/migrations/5.39.0/001/ddb-es/index.js +0 -266
  417. package/migrations/5.39.0/001/ddb-es/index.js.map +0 -1
  418. package/migrations/5.39.0/001/entities/createEntryEntity.d.ts +0 -89
  419. package/migrations/5.39.0/001/entities/createEntryEntity.js +0 -188
  420. package/migrations/5.39.0/001/entities/createEntryEntity.js.map +0 -1
  421. package/migrations/5.39.0/001/types.d.ts +0 -136
  422. package/migrations/5.39.0/001/types.js +0 -7
  423. package/migrations/5.39.0/001/types.js.map +0 -1
  424. package/migrations/5.39.0/001/utils/assignNewMetaFields.d.ts +0 -11
  425. package/migrations/5.39.0/001/utils/assignNewMetaFields.js +0 -44
  426. package/migrations/5.39.0/001/utils/assignNewMetaFields.js.map +0 -1
  427. package/migrations/5.39.0/001/utils/ensureAllNonNullableValues.d.ts +0 -8
  428. package/migrations/5.39.0/001/utils/ensureAllNonNullableValues.js +0 -38
  429. package/migrations/5.39.0/001/utils/ensureAllNonNullableValues.js.map +0 -1
  430. package/migrations/5.39.0/001/utils/fixTypeFieldValue.d.ts +0 -3
  431. package/migrations/5.39.0/001/utils/fixTypeFieldValue.js +0 -33
  432. package/migrations/5.39.0/001/utils/fixTypeFieldValue.js.map +0 -1
  433. package/migrations/5.39.0/001/utils/getCompressedData.d.ts +0 -4
  434. package/migrations/5.39.0/001/utils/getCompressedData.js +0 -19
  435. package/migrations/5.39.0/001/utils/getCompressedData.js.map +0 -1
  436. package/migrations/5.39.0/001/utils/getDecompressedData.d.ts +0 -1
  437. package/migrations/5.39.0/001/utils/getDecompressedData.js +0 -31
  438. package/migrations/5.39.0/001/utils/getDecompressedData.js.map +0 -1
  439. package/migrations/5.39.0/001/utils/getFallbackIdentity.d.ts +0 -8
  440. package/migrations/5.39.0/001/utils/getFallbackIdentity.js +0 -44
  441. package/migrations/5.39.0/001/utils/getFallbackIdentity.js.map +0 -1
  442. package/migrations/5.39.0/001/utils/getFirstLastPublishedOn.d.ts +0 -11
  443. package/migrations/5.39.0/001/utils/getFirstLastPublishedOn.js +0 -40
  444. package/migrations/5.39.0/001/utils/getFirstLastPublishedOn.js.map +0 -1
  445. package/migrations/5.39.0/001/utils/getNonNullableFieldsWithMissingValues.d.ts +0 -2
  446. package/migrations/5.39.0/001/utils/getNonNullableFieldsWithMissingValues.js +0 -22
  447. package/migrations/5.39.0/001/utils/getNonNullableFieldsWithMissingValues.js.map +0 -1
  448. package/migrations/5.39.0/001/utils/getOldestRevisionCreatedOn.d.ts +0 -11
  449. package/migrations/5.39.0/001/utils/getOldestRevisionCreatedOn.js +0 -33
  450. package/migrations/5.39.0/001/utils/getOldestRevisionCreatedOn.js.map +0 -1
  451. package/migrations/5.39.0/001/utils/hasAllNonNullableValues.d.ts +0 -2
  452. package/migrations/5.39.0/001/utils/hasAllNonNullableValues.js +0 -21
  453. package/migrations/5.39.0/001/utils/hasAllNonNullableValues.js.map +0 -1
  454. package/migrations/5.39.0/001/utils/hasValidTypeFieldValue.d.ts +0 -4
  455. package/migrations/5.39.0/001/utils/hasValidTypeFieldValue.js +0 -21
  456. package/migrations/5.39.0/001/utils/hasValidTypeFieldValue.js.map +0 -1
  457. package/migrations/5.39.0/001/utils/isMigratedEntry.d.ts +0 -2
  458. package/migrations/5.39.0/001/utils/isMigratedEntry.js +0 -12
  459. package/migrations/5.39.0/001/utils/isMigratedEntry.js.map +0 -1
  460. package/migrations/5.39.0/002/ddb/FileManager_5_39_0_002.d.ts +0 -14
  461. package/migrations/5.39.0/002/ddb/FileManager_5_39_0_002.js +0 -133
  462. package/migrations/5.39.0/002/ddb/FileManager_5_39_0_002.js.map +0 -1
  463. package/migrations/5.39.0/002/ddb/index.d.ts +0 -1
  464. package/migrations/5.39.0/002/ddb/index.js +0 -18
  465. package/migrations/5.39.0/002/ddb/index.js.map +0 -1
  466. package/migrations/5.39.0/002/ddb-es/FileManager_5_39_0_002.d.ts +0 -15
  467. package/migrations/5.39.0/002/ddb-es/FileManager_5_39_0_002.js +0 -190
  468. package/migrations/5.39.0/002/ddb-es/FileManager_5_39_0_002.js.map +0 -1
  469. package/migrations/5.39.0/002/ddb-es/index.d.ts +0 -1
  470. package/migrations/5.39.0/002/ddb-es/index.js +0 -18
  471. package/migrations/5.39.0/002/ddb-es/index.js.map +0 -1
  472. package/migrations/5.39.0/002/utils/FileMetadata.d.ts +0 -12
  473. package/migrations/5.39.0/002/utils/FileMetadata.js +0 -55
  474. package/migrations/5.39.0/002/utils/FileMetadata.js.map +0 -1
  475. package/migrations/5.39.0/002/utils/createFileEntity.d.ts +0 -53
  476. package/migrations/5.39.0/002/utils/createFileEntity.js +0 -50
  477. package/migrations/5.39.0/002/utils/createFileEntity.js.map +0 -1
  478. package/migrations/5.39.0/002/utils/createLocaleEntity.d.ts +0 -42
  479. package/migrations/5.39.0/002/utils/createLocaleEntity.js +0 -32
  480. package/migrations/5.39.0/002/utils/createLocaleEntity.js.map +0 -1
  481. package/migrations/5.39.0/002/utils/createTenantEntity.d.ts +0 -48
  482. package/migrations/5.39.0/002/utils/createTenantEntity.js +0 -13
  483. package/migrations/5.39.0/002/utils/createTenantEntity.js.map +0 -1
  484. package/migrations/5.39.2/001/ddb-es/index.d.ts +0 -30
  485. package/migrations/5.39.2/001/ddb-es/index.js +0 -276
  486. package/migrations/5.39.2/001/ddb-es/index.js.map +0 -1
  487. package/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.d.ts +0 -21
  488. package/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.js +0 -167
  489. package/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.js.map +0 -1
  490. package/migrations/5.39.6/001/ddb-es/SegmentProcessor.d.ts +0 -23
  491. package/migrations/5.39.6/001/ddb-es/SegmentProcessor.js +0 -31
  492. package/migrations/5.39.6/001/ddb-es/SegmentProcessor.js.map +0 -1
  493. package/migrations/5.39.6/001/ddb-es/bin.d.ts +0 -2
  494. package/migrations/5.39.6/001/ddb-es/bin.js +0 -83
  495. package/migrations/5.39.6/001/ddb-es/bin.js.map +0 -1
  496. package/migrations/5.39.6/001/ddb-es/createMetaFieldsDataMigrationDeploymentHook.d.ts +0 -11
  497. package/migrations/5.39.6/001/ddb-es/createMetaFieldsDataMigrationDeploymentHook.js +0 -83
  498. package/migrations/5.39.6/001/ddb-es/createMetaFieldsDataMigrationDeploymentHook.js.map +0 -1
  499. package/migrations/5.39.6/001/ddb-es/index.d.ts +0 -30
  500. package/migrations/5.39.6/001/ddb-es/index.js +0 -329
  501. package/migrations/5.39.6/001/ddb-es/index.js.map +0 -1
  502. package/migrations/5.39.6/001/ddb-es/utils.d.ts +0 -28
  503. package/migrations/5.39.6/001/ddb-es/utils.js +0 -60
  504. package/migrations/5.39.6/001/ddb-es/utils.js.map +0 -1
  505. package/migrations/5.39.6/001/ddb-es/worker.d.ts +0 -1
  506. package/migrations/5.39.6/001/ddb-es/worker.js +0 -352
  507. package/migrations/5.39.6/001/ddb-es/worker.js.map +0 -1
  508. package/migrations/5.40.0/001/ddb/compression.d.ts +0 -15
  509. package/migrations/5.40.0/001/ddb/compression.js +0 -42
  510. package/migrations/5.40.0/001/ddb/compression.js.map +0 -1
  511. package/migrations/5.40.0/001/ddb/createBlockEntity.d.ts +0 -42
  512. package/migrations/5.40.0/001/ddb/createBlockEntity.js +0 -54
  513. package/migrations/5.40.0/001/ddb/createBlockEntity.js.map +0 -1
  514. package/migrations/5.40.0/001/ddb/index.d.ts +0 -13
  515. package/migrations/5.40.0/001/ddb/index.js +0 -155
  516. package/migrations/5.40.0/001/ddb/index.js.map +0 -1
  517. package/migrations/5.40.0/001/ddb/types.d.ts +0 -20
  518. package/migrations/5.40.0/001/ddb/types.js +0 -7
  519. package/migrations/5.40.0/001/ddb/types.js.map +0 -1
  520. package/utils/createLocaleEntity.d.ts +0 -42
  521. package/utils/createLocaleEntity.js +0 -32
  522. package/utils/createLocaleEntity.js.map +0 -1
  523. package/utils/elasticsearch/plugins/japanese.d.ts +0 -4
  524. package/utils/elasticsearch/plugins/japanese.js +0 -13
  525. package/utils/elasticsearch/plugins/japanese.js.map +0 -1
  526. package/utils/forEachTenantLocale.d.ts +0 -13
  527. package/utils/forEachTenantLocale.js +0 -55
  528. package/utils/forEachTenantLocale.js.map +0 -1
  529. /package/{migrations/5.35.0/006/utils → utils}/getCompressedData.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_","require","fetchOriginalElasticsearchSettings","params","index","logger","settings","esGetIndexSettings","elasticsearchClient","fields","number_of_replicas","refresh_interval","ex","error","message","code","data","exports"],"sources":["fetchOriginalEsSettings.ts"],"sourcesContent":["import { esGetIndexSettings } from \"~/utils\";\nimport { Logger } from \"@webiny/data-migration\";\nimport { Client } from \"@elastic/elasticsearch\";\n\ninterface FetchOriginalElasticsearchSettingsParams {\n elasticsearchClient: Client;\n index: string;\n logger: Logger;\n}\n\ninterface IndexSettings {\n number_of_replicas: number;\n refresh_interval: `${number}s`;\n}\n\nexport const fetchOriginalElasticsearchSettings = async (\n params: FetchOriginalElasticsearchSettingsParams\n): Promise<IndexSettings | null> => {\n const { index, logger } = params;\n try {\n const settings = await esGetIndexSettings({\n elasticsearchClient: params.elasticsearchClient,\n index,\n fields: [\"number_of_replicas\", \"refresh_interval\"]\n });\n return {\n number_of_replicas: settings.number_of_replicas || 1,\n refresh_interval: settings.refresh_interval || \"1s\"\n };\n } catch (ex) {\n logger.error(`Failed to fetch original Elasticsearch settings for index \"${index}\".`);\n logger.error({\n ...ex,\n message: ex.message,\n code: ex.code,\n data: ex.data\n });\n }\n\n return null;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,OAAA;AAeO,MAAMC,kCAAkC,GAAG,MAC9CC,MAAgD,IAChB;EAChC,MAAM;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAChC,IAAI;IACA,MAAMG,QAAQ,GAAG,MAAM,IAAAC,oBAAkB,EAAC;MACtCC,mBAAmB,EAAEL,MAAM,CAACK,mBAAmB;MAC/CJ,KAAK;MACLK,MAAM,EAAE,CAAC,oBAAoB,EAAE,kBAAkB;IACrD,CAAC,CAAC;IACF,OAAO;MACHC,kBAAkB,EAAEJ,QAAQ,CAACI,kBAAkB,IAAI,CAAC;MACpDC,gBAAgB,EAAEL,QAAQ,CAACK,gBAAgB,IAAI;IACnD,CAAC;EACL,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTP,MAAM,CAACQ,KAAK,CAAE,8DAA6DT,KAAM,IAAG,CAAC;IACrFC,MAAM,CAACQ,KAAK,CAAC;MACT,GAAGD,EAAE;MACLE,OAAO,EAAEF,EAAE,CAACE,OAAO;MACnBC,IAAI,EAAEH,EAAE,CAACG,IAAI;MACbC,IAAI,EAAEJ,EAAE,CAACI;IACb,CAAC,CAAC;EACN;EAEA,OAAO,IAAI;AACf,CAAC;AAACC,OAAA,CAAAf,kCAAA,GAAAA,kCAAA","ignoreList":[]}
1
+ {"version":3,"names":["esGetIndexSettings","fetchOriginalElasticsearchSettings","params","index","logger","settings","elasticsearchClient","fields","refresh_interval","ex","error","message","code","data"],"sources":["fetchOriginalEsSettings.ts"],"sourcesContent":["import { esGetIndexSettings } from \"~/utils/index.js\";\nimport type { Logger } from \"@webiny/data-migration\";\nimport type { Client } from \"@elastic/elasticsearch\";\n\ninterface FetchOriginalElasticsearchSettingsParams {\n elasticsearchClient: Client;\n index: string;\n logger: Logger;\n}\n\ninterface IndexSettings {\n refresh_interval: `${number}s`;\n}\n\nexport const fetchOriginalElasticsearchSettings = async (\n params: FetchOriginalElasticsearchSettingsParams\n): Promise<IndexSettings | null> => {\n const { index, logger } = params;\n try {\n const settings = await esGetIndexSettings({\n elasticsearchClient: params.elasticsearchClient,\n index,\n fields: [\"refresh_interval\"]\n });\n return {\n refresh_interval: settings.refresh_interval || \"1s\"\n };\n } catch (ex) {\n logger.error(`Failed to fetch original Elasticsearch settings for index \"${index}\".`);\n logger.error({\n ...ex,\n message: ex.message,\n code: ex.code,\n data: ex.data\n });\n }\n\n return null;\n};\n"],"mappings":"AAAA,SAASA,kBAAkB;AAc3B,OAAO,MAAMC,kCAAkC,GAAG,MAC9CC,MAAgD,IAChB;EAChC,MAAM;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAChC,IAAI;IACA,MAAMG,QAAQ,GAAG,MAAML,kBAAkB,CAAC;MACtCM,mBAAmB,EAAEJ,MAAM,CAACI,mBAAmB;MAC/CH,KAAK;MACLI,MAAM,EAAE,CAAC,kBAAkB;IAC/B,CAAC,CAAC;IACF,OAAO;MACHC,gBAAgB,EAAEH,QAAQ,CAACG,gBAAgB,IAAI;IACnD,CAAC;EACL,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTL,MAAM,CAACM,KAAK,CAAC,8DAA8DP,KAAK,IAAI,CAAC;IACrFC,MAAM,CAACM,KAAK,CAAC;MACT,GAAGD,EAAE;MACLE,OAAO,EAAEF,EAAE,CAACE,OAAO;MACnBC,IAAI,EAAEH,EAAE,CAACG,IAAI;MACbC,IAAI,EAAEJ,EAAE,CAACI;IACb,CAAC,CAAC;EACN;EAEA,OAAO,IAAI;AACf,CAAC","ignoreList":[]}
@@ -1,12 +1,12 @@
1
- export * from "./esCreateIndex";
2
- export * from "./esFindOne";
3
- export * from "./esGetIndexExist";
4
- export * from "./esGetIndexName";
5
- export * from "./esGetIndexSettings";
6
- export * from "./esPutIndexSettings";
7
- export * from "./esQueryAllWithCallback";
8
- export * from "./esQueryAll";
9
- export * from "./esListIndexes";
10
- export * from "./disableEsIndexing";
11
- export * from "./fetchOriginalEsSettings";
12
- export * from "./restoreOriginalEsSettings";
1
+ export * from "./esCreateIndex.js";
2
+ export * from "./esFindOne.js";
3
+ export * from "./esGetIndexExist.js";
4
+ export * from "./esGetIndexName.js";
5
+ export * from "./esGetIndexSettings.js";
6
+ export * from "./esPutIndexSettings.js";
7
+ export * from "./esQueryAllWithCallback.js";
8
+ export * from "./esQueryAll.js";
9
+ export * from "./esListIndexes.js";
10
+ export * from "./disableEsIndexing.js";
11
+ export * from "./fetchOriginalEsSettings.js";
12
+ export * from "./restoreOriginalEsSettings.js";
@@ -1,139 +1,14 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _esCreateIndex = require("./esCreateIndex");
7
- Object.keys(_esCreateIndex).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _esCreateIndex[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _esCreateIndex[key];
14
- }
15
- });
16
- });
17
- var _esFindOne = require("./esFindOne");
18
- Object.keys(_esFindOne).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _esFindOne[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _esFindOne[key];
25
- }
26
- });
27
- });
28
- var _esGetIndexExist = require("./esGetIndexExist");
29
- Object.keys(_esGetIndexExist).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _esGetIndexExist[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _esGetIndexExist[key];
36
- }
37
- });
38
- });
39
- var _esGetIndexName = require("./esGetIndexName");
40
- Object.keys(_esGetIndexName).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _esGetIndexName[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function () {
46
- return _esGetIndexName[key];
47
- }
48
- });
49
- });
50
- var _esGetIndexSettings = require("./esGetIndexSettings");
51
- Object.keys(_esGetIndexSettings).forEach(function (key) {
52
- if (key === "default" || key === "__esModule") return;
53
- if (key in exports && exports[key] === _esGetIndexSettings[key]) return;
54
- Object.defineProperty(exports, key, {
55
- enumerable: true,
56
- get: function () {
57
- return _esGetIndexSettings[key];
58
- }
59
- });
60
- });
61
- var _esPutIndexSettings = require("./esPutIndexSettings");
62
- Object.keys(_esPutIndexSettings).forEach(function (key) {
63
- if (key === "default" || key === "__esModule") return;
64
- if (key in exports && exports[key] === _esPutIndexSettings[key]) return;
65
- Object.defineProperty(exports, key, {
66
- enumerable: true,
67
- get: function () {
68
- return _esPutIndexSettings[key];
69
- }
70
- });
71
- });
72
- var _esQueryAllWithCallback = require("./esQueryAllWithCallback");
73
- Object.keys(_esQueryAllWithCallback).forEach(function (key) {
74
- if (key === "default" || key === "__esModule") return;
75
- if (key in exports && exports[key] === _esQueryAllWithCallback[key]) return;
76
- Object.defineProperty(exports, key, {
77
- enumerable: true,
78
- get: function () {
79
- return _esQueryAllWithCallback[key];
80
- }
81
- });
82
- });
83
- var _esQueryAll = require("./esQueryAll");
84
- Object.keys(_esQueryAll).forEach(function (key) {
85
- if (key === "default" || key === "__esModule") return;
86
- if (key in exports && exports[key] === _esQueryAll[key]) return;
87
- Object.defineProperty(exports, key, {
88
- enumerable: true,
89
- get: function () {
90
- return _esQueryAll[key];
91
- }
92
- });
93
- });
94
- var _esListIndexes = require("./esListIndexes");
95
- Object.keys(_esListIndexes).forEach(function (key) {
96
- if (key === "default" || key === "__esModule") return;
97
- if (key in exports && exports[key] === _esListIndexes[key]) return;
98
- Object.defineProperty(exports, key, {
99
- enumerable: true,
100
- get: function () {
101
- return _esListIndexes[key];
102
- }
103
- });
104
- });
105
- var _disableEsIndexing = require("./disableEsIndexing");
106
- Object.keys(_disableEsIndexing).forEach(function (key) {
107
- if (key === "default" || key === "__esModule") return;
108
- if (key in exports && exports[key] === _disableEsIndexing[key]) return;
109
- Object.defineProperty(exports, key, {
110
- enumerable: true,
111
- get: function () {
112
- return _disableEsIndexing[key];
113
- }
114
- });
115
- });
116
- var _fetchOriginalEsSettings = require("./fetchOriginalEsSettings");
117
- Object.keys(_fetchOriginalEsSettings).forEach(function (key) {
118
- if (key === "default" || key === "__esModule") return;
119
- if (key in exports && exports[key] === _fetchOriginalEsSettings[key]) return;
120
- Object.defineProperty(exports, key, {
121
- enumerable: true,
122
- get: function () {
123
- return _fetchOriginalEsSettings[key];
124
- }
125
- });
126
- });
127
- var _restoreOriginalEsSettings = require("./restoreOriginalEsSettings");
128
- Object.keys(_restoreOriginalEsSettings).forEach(function (key) {
129
- if (key === "default" || key === "__esModule") return;
130
- if (key in exports && exports[key] === _restoreOriginalEsSettings[key]) return;
131
- Object.defineProperty(exports, key, {
132
- enumerable: true,
133
- get: function () {
134
- return _restoreOriginalEsSettings[key];
135
- }
136
- });
137
- });
1
+ export * from "./esCreateIndex.js";
2
+ export * from "./esFindOne.js";
3
+ export * from "./esGetIndexExist.js";
4
+ export * from "./esGetIndexName.js";
5
+ export * from "./esGetIndexSettings.js";
6
+ export * from "./esPutIndexSettings.js";
7
+ export * from "./esQueryAllWithCallback.js";
8
+ export * from "./esQueryAll.js";
9
+ export * from "./esListIndexes.js";
10
+ export * from "./disableEsIndexing.js";
11
+ export * from "./fetchOriginalEsSettings.js";
12
+ export * from "./restoreOriginalEsSettings.js";
138
13
 
139
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_esCreateIndex","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_esFindOne","_esGetIndexExist","_esGetIndexName","_esGetIndexSettings","_esPutIndexSettings","_esQueryAllWithCallback","_esQueryAll","_esListIndexes","_disableEsIndexing","_fetchOriginalEsSettings","_restoreOriginalEsSettings"],"sources":["index.ts"],"sourcesContent":["export * from \"./esCreateIndex\";\nexport * from \"./esFindOne\";\nexport * from \"./esGetIndexExist\";\nexport * from \"./esGetIndexName\";\nexport * from \"./esGetIndexSettings\";\nexport * from \"./esPutIndexSettings\";\nexport * from \"./esQueryAllWithCallback\";\nexport * from \"./esQueryAll\";\nexport * from \"./esListIndexes\";\nexport * from \"./disableEsIndexing\";\nexport * from \"./fetchOriginalEsSettings\";\nexport * from \"./restoreOriginalEsSettings\";\n"],"mappings":";;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,cAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,UAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,UAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,UAAA,CAAAL,GAAA;EAAAH,M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AG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAW,0BAAA,CAAAf,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./esCreateIndex.js\";\nexport * from \"./esFindOne.js\";\nexport * from \"./esGetIndexExist.js\";\nexport * from \"./esGetIndexName.js\";\nexport * from \"./esGetIndexSettings.js\";\nexport * from \"./esPutIndexSettings.js\";\nexport * from \"./esQueryAllWithCallback.js\";\nexport * from \"./esQueryAll.js\";\nexport * from \"./esListIndexes.js\";\nexport * from \"./disableEsIndexing.js\";\nexport * from \"./fetchOriginalEsSettings.js\";\nexport * from \"./restoreOriginalEsSettings.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -1,12 +1,6 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.base = void 0;
7
- var _apiElasticsearch = require("@webiny/api-elasticsearch");
8
- const base = exports.base = {
9
- body: (0, _apiElasticsearch.getBaseConfiguration)()
1
+ import { getBaseConfiguration } from "@webiny/api-elasticsearch";
2
+ export const base = {
3
+ body: getBaseConfiguration()
10
4
  };
11
5
 
12
6
  //# sourceMappingURL=base.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_apiElasticsearch","require","base","exports","body","getBaseConfiguration"],"sources":["base.ts"],"sourcesContent":["import { getBaseConfiguration } from \"@webiny/api-elasticsearch\";\n\nexport const base = {\n body: getBaseConfiguration()\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEO,MAAMC,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAChBE,IAAI,EAAE,IAAAC,sCAAoB,EAAC;AAC/B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["getBaseConfiguration","base","body"],"sources":["base.ts"],"sourcesContent":["import { getBaseConfiguration } from \"@webiny/api-elasticsearch\";\n\nexport const base = {\n body: getBaseConfiguration()\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,2BAA2B;AAEhE,OAAO,MAAMC,IAAI,GAAG;EAChBC,IAAI,EAAEF,oBAAoB,CAAC;AAC/B,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { ElasticsearchIndexRequestBody } from "@webiny/api-elasticsearch/types";
1
+ import type { ElasticsearchIndexRequestBody } from "@webiny/api-elasticsearch/types.js";
2
2
  export interface ElasticsearchIndexPlugins {
3
3
  body: ElasticsearchIndexRequestBody;
4
4
  locales?: string[];
@@ -1,14 +1,6 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.elasticsearchIndexPlugins = void 0;
7
- var _base = require("./base");
8
- var _japanese = require("./japanese");
9
- const elasticsearchIndexPlugins = () => {
10
- return [_base.base, _japanese.japanese];
1
+ import { base } from "./base.js";
2
+ export const elasticsearchIndexPlugins = () => {
3
+ return [base];
11
4
  };
12
- exports.elasticsearchIndexPlugins = elasticsearchIndexPlugins;
13
5
 
14
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_base","require","_japanese","elasticsearchIndexPlugins","base","japanese","exports"],"sources":["index.ts"],"sourcesContent":["import { ElasticsearchIndexRequestBody } from \"@webiny/api-elasticsearch/types\";\n\nimport { base } from \"./base\";\nimport { japanese } from \"./japanese\";\n\nexport interface ElasticsearchIndexPlugins {\n body: ElasticsearchIndexRequestBody;\n locales?: string[];\n}\n\nexport const elasticsearchIndexPlugins = (): ElasticsearchIndexPlugins[] => {\n return [base, japanese];\n};\n"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAOO,MAAME,yBAAyB,GAAGA,CAAA,KAAmC;EACxE,OAAO,CAACC,UAAI,EAAEC,kBAAQ,CAAC;AAC3B,CAAC;AAACC,OAAA,CAAAH,yBAAA,GAAAA,yBAAA","ignoreList":[]}
1
+ {"version":3,"names":["base","elasticsearchIndexPlugins"],"sources":["index.ts"],"sourcesContent":["import type { ElasticsearchIndexRequestBody } from \"@webiny/api-elasticsearch/types.js\";\n\nimport { base } from \"./base.js\";\n\nexport interface ElasticsearchIndexPlugins {\n body: ElasticsearchIndexRequestBody;\n locales?: string[];\n}\n\nexport const elasticsearchIndexPlugins = (): ElasticsearchIndexPlugins[] => {\n return [base];\n};\n"],"mappings":"AAEA,SAASA,IAAI;AAOb,OAAO,MAAMC,yBAAyB,GAAGA,CAAA,KAAmC;EACxE,OAAO,CAACD,IAAI,CAAC;AACjB,CAAC","ignoreList":[]}
@@ -1,8 +1,7 @@
1
- import { Logger } from "@webiny/data-migration";
2
- import { Client } from "@elastic/elasticsearch";
1
+ import type { Logger } from "@webiny/data-migration";
2
+ import type { Client } from "@elastic/elasticsearch";
3
3
  interface IndexSettings {
4
- number_of_replicas: number;
5
- refresh_interval: `${number}s`;
4
+ refresh_interval: `${number}s` | "-1";
6
5
  }
7
6
  interface RestoreOriginalElasticsearchSettingsParams {
8
7
  indexSettings: {
@@ -1,11 +1,5 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.restoreOriginalElasticsearchSettings = void 0;
7
- var _ = require("./..");
8
- const restoreOriginalElasticsearchSettings = async params => {
1
+ import { esPutIndexSettings } from "../index.js";
2
+ export const restoreOriginalElasticsearchSettings = async params => {
9
3
  const {
10
4
  indexSettings,
11
5
  logger
@@ -19,13 +13,21 @@ const restoreOriginalElasticsearchSettings = async params => {
19
13
  if (!settings || typeof settings !== "object") {
20
14
  continue;
21
15
  }
16
+
17
+ // We must ensure that the refresh interval is not set to a negative value. Why?
18
+ // We've had a case where a migration run has been manually stopped, and the index settings
19
+ // were never restored. Once a second run was started and this restore function
20
+ // was called, the refresh interval was set to `-1s`, which effectively disabled indexing.
21
+ let refreshInterval = settings.refresh_interval || `1s`;
22
+ if (refreshInterval === "-1") {
23
+ refreshInterval = "1s";
24
+ }
22
25
  try {
23
- await (0, _.esPutIndexSettings)({
26
+ await esPutIndexSettings({
24
27
  elasticsearchClient: params.elasticsearchClient,
25
28
  index,
26
29
  settings: {
27
- number_of_replicas: settings.number_of_replicas || 1,
28
- refresh_interval: settings.refresh_interval || `1s`
30
+ refresh_interval: refreshInterval
29
31
  }
30
32
  });
31
33
  } catch (ex) {
@@ -39,6 +41,5 @@ const restoreOriginalElasticsearchSettings = async params => {
39
41
  }
40
42
  }
41
43
  };
42
- exports.restoreOriginalElasticsearchSettings = restoreOriginalElasticsearchSettings;
43
44
 
44
45
  //# sourceMappingURL=restoreOriginalEsSettings.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_","require","restoreOriginalElasticsearchSettings","params","indexSettings","logger","indexes","index","settings","esPutIndexSettings","elasticsearchClient","number_of_replicas","refresh_interval","ex","error","message","code","data","exports"],"sources":["restoreOriginalEsSettings.ts"],"sourcesContent":["import { esPutIndexSettings } from \"~/utils\";\nimport { Logger } from \"@webiny/data-migration\";\nimport { Client } from \"@elastic/elasticsearch\";\n\ninterface IndexSettings {\n number_of_replicas: number;\n refresh_interval: `${number}s`;\n}\n\ninterface RestoreOriginalElasticsearchSettingsParams {\n indexSettings: {\n [index: string]: IndexSettings | null;\n };\n logger: Logger;\n elasticsearchClient: Client;\n}\n\nexport const restoreOriginalElasticsearchSettings = async (\n params: RestoreOriginalElasticsearchSettingsParams\n): Promise<void> => {\n const { indexSettings, logger } = params;\n\n const indexes = indexSettings;\n if (!indexes || typeof indexes !== \"object\") {\n return;\n }\n\n for (const index in indexes) {\n const settings = indexes[index];\n if (!settings || typeof settings !== \"object\") {\n continue;\n }\n try {\n await esPutIndexSettings({\n elasticsearchClient: params.elasticsearchClient,\n index,\n settings: {\n number_of_replicas: settings.number_of_replicas || 1,\n refresh_interval: settings.refresh_interval || `1s`\n }\n });\n } catch (ex) {\n logger.error(\n `Failed to restore original settings for index \"${index}\". Please do it manually.`\n );\n logger.error({\n ...ex,\n message: ex.message,\n code: ex.code,\n data: ex.data\n });\n }\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,OAAA;AAiBO,MAAMC,oCAAoC,GAAG,MAChDC,MAAkD,IAClC;EAChB,MAAM;IAAEC,aAAa;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAExC,MAAMG,OAAO,GAAGF,aAAa;EAC7B,IAAI,CAACE,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IACzC;EACJ;EAEA,KAAK,MAAMC,KAAK,IAAID,OAAO,EAAE;IACzB,MAAME,QAAQ,GAAGF,OAAO,CAACC,KAAK,CAAC;IAC/B,IAAI,CAACC,QAAQ,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAE;MAC3C;IACJ;IACA,IAAI;MACA,MAAM,IAAAC,oBAAkB,EAAC;QACrBC,mBAAmB,EAAEP,MAAM,CAACO,mBAAmB;QAC/CH,KAAK;QACLC,QAAQ,EAAE;UACNG,kBAAkB,EAAEH,QAAQ,CAACG,kBAAkB,IAAI,CAAC;UACpDC,gBAAgB,EAAEJ,QAAQ,CAACI,gBAAgB,IAAK;QACpD;MACJ,CAAC,CAAC;IACN,CAAC,CAAC,OAAOC,EAAE,EAAE;MACTR,MAAM,CAACS,KAAK,CACP,kDAAiDP,KAAM,2BAC5D,CAAC;MACDF,MAAM,CAACS,KAAK,CAAC;QACT,GAAGD,EAAE;QACLE,OAAO,EAAEF,EAAE,CAACE,OAAO;QACnBC,IAAI,EAAEH,EAAE,CAACG,IAAI;QACbC,IAAI,EAAEJ,EAAE,CAACI;MACb,CAAC,CAAC;IACN;EACJ;AACJ,CAAC;AAACC,OAAA,CAAAhB,oCAAA,GAAAA,oCAAA","ignoreList":[]}
1
+ {"version":3,"names":["esPutIndexSettings","restoreOriginalElasticsearchSettings","params","indexSettings","logger","indexes","index","settings","refreshInterval","refresh_interval","elasticsearchClient","ex","error","message","code","data"],"sources":["restoreOriginalEsSettings.ts"],"sourcesContent":["import { esPutIndexSettings } from \"~/utils/index.js\";\nimport type { Logger } from \"@webiny/data-migration\";\nimport type { Client } from \"@elastic/elasticsearch\";\n\ninterface IndexSettings {\n refresh_interval: `${number}s` | \"-1\";\n}\n\ninterface RestoreOriginalElasticsearchSettingsParams {\n indexSettings: {\n [index: string]: IndexSettings | null;\n };\n logger: Logger;\n elasticsearchClient: Client;\n}\n\nexport const restoreOriginalElasticsearchSettings = async (\n params: RestoreOriginalElasticsearchSettingsParams\n): Promise<void> => {\n const { indexSettings, logger } = params;\n\n const indexes = indexSettings;\n if (!indexes || typeof indexes !== \"object\") {\n return;\n }\n\n for (const index in indexes) {\n const settings = indexes[index];\n if (!settings || typeof settings !== \"object\") {\n continue;\n }\n\n // We must ensure that the refresh interval is not set to a negative value. Why?\n // We've had a case where a migration run has been manually stopped, and the index settings\n // were never restored. Once a second run was started and this restore function\n // was called, the refresh interval was set to `-1s`, which effectively disabled indexing.\n let refreshInterval = settings.refresh_interval || `1s`;\n if (refreshInterval === \"-1\") {\n refreshInterval = \"1s\";\n }\n\n try {\n await esPutIndexSettings({\n elasticsearchClient: params.elasticsearchClient,\n index,\n settings: {\n refresh_interval: refreshInterval\n }\n });\n } catch (ex) {\n logger.error(\n `Failed to restore original settings for index \"${index}\". Please do it manually.`\n );\n logger.error({\n ...ex,\n message: ex.message,\n code: ex.code,\n data: ex.data\n });\n }\n }\n};\n"],"mappings":"AAAA,SAASA,kBAAkB;AAgB3B,OAAO,MAAMC,oCAAoC,GAAG,MAChDC,MAAkD,IAClC;EAChB,MAAM;IAAEC,aAAa;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAExC,MAAMG,OAAO,GAAGF,aAAa;EAC7B,IAAI,CAACE,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IACzC;EACJ;EAEA,KAAK,MAAMC,KAAK,IAAID,OAAO,EAAE;IACzB,MAAME,QAAQ,GAAGF,OAAO,CAACC,KAAK,CAAC;IAC/B,IAAI,CAACC,QAAQ,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAE;MAC3C;IACJ;;IAEA;IACA;IACA;IACA;IACA,IAAIC,eAAe,GAAGD,QAAQ,CAACE,gBAAgB,IAAI,IAAI;IACvD,IAAID,eAAe,KAAK,IAAI,EAAE;MAC1BA,eAAe,GAAG,IAAI;IAC1B;IAEA,IAAI;MACA,MAAMR,kBAAkB,CAAC;QACrBU,mBAAmB,EAAER,MAAM,CAACQ,mBAAmB;QAC/CJ,KAAK;QACLC,QAAQ,EAAE;UACNE,gBAAgB,EAAED;QACtB;MACJ,CAAC,CAAC;IACN,CAAC,CAAC,OAAOG,EAAE,EAAE;MACTP,MAAM,CAACQ,KAAK,CACR,kDAAkDN,KAAK,2BAC3D,CAAC;MACDF,MAAM,CAACQ,KAAK,CAAC;QACT,GAAGD,EAAE;QACLE,OAAO,EAAEF,EAAE,CAACE,OAAO;QACnBC,IAAI,EAAEH,EAAE,CAACG,IAAI;QACbC,IAAI,EAAEJ,EAAE,CAACI;MACb,CAAC,CAAC;IACN;EACJ;AACJ,CAAC","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ import { compress as gzip } from "@webiny/utils/compression/gzip.js";
2
+ const GZIP = "gzip";
3
+ const TO_STORAGE_ENCODING = "base64";
4
+ export const getCompressedData = async data => {
5
+ const value = await gzip(JSON.stringify(data));
6
+ return {
7
+ compression: GZIP,
8
+ value: value.toString(TO_STORAGE_ENCODING)
9
+ };
10
+ };
11
+
12
+ //# sourceMappingURL=getCompressedData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["compress","gzip","GZIP","TO_STORAGE_ENCODING","getCompressedData","data","value","JSON","stringify","compression","toString"],"sources":["getCompressedData.ts"],"sourcesContent":["import { compress as gzip } from \"@webiny/utils/compression/gzip.js\";\n\nconst GZIP = \"gzip\";\nconst TO_STORAGE_ENCODING = \"base64\";\n\nexport const getCompressedData = async (data: any) => {\n const value = await gzip(JSON.stringify(data));\n\n return {\n compression: GZIP,\n value: value.toString(TO_STORAGE_ENCODING)\n };\n};\n"],"mappings":"AAAA,SAASA,QAAQ,IAAIC,IAAI,QAAQ,mCAAmC;AAEpE,MAAMC,IAAI,GAAG,MAAM;AACnB,MAAMC,mBAAmB,GAAG,QAAQ;AAEpC,OAAO,MAAMC,iBAAiB,GAAG,MAAOC,IAAS,IAAK;EAClD,MAAMC,KAAK,GAAG,MAAML,IAAI,CAACM,IAAI,CAACC,SAAS,CAACH,IAAI,CAAC,CAAC;EAE9C,OAAO;IACHI,WAAW,EAAEP,IAAI;IACjBI,KAAK,EAAEA,KAAK,CAACI,QAAQ,CAACP,mBAAmB;EAC7C,CAAC;AACL,CAAC","ignoreList":[]}
package/utils/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- export * from "./dynamoDb";
2
- export * from "./elasticsearch";
3
- export * from "./forEachTenantLocale";
4
- export * from "./createEntity";
5
- export * from "./createLocaleEntity";
6
- export * from "./createTenantEntity";
1
+ export * from "./dynamoDb.js";
2
+ export * from "./elasticsearch/index.js";
3
+ export * from "./createEntity.js";
4
+ export * from "./createTenantEntity.js";
5
+ export * from "./getCompressedData.js";
package/utils/index.js CHANGED
@@ -1,73 +1,7 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _dynamoDb = require("./dynamoDb");
7
- Object.keys(_dynamoDb).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _dynamoDb[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _dynamoDb[key];
14
- }
15
- });
16
- });
17
- var _elasticsearch = require("./elasticsearch");
18
- Object.keys(_elasticsearch).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _elasticsearch[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _elasticsearch[key];
25
- }
26
- });
27
- });
28
- var _forEachTenantLocale = require("./forEachTenantLocale");
29
- Object.keys(_forEachTenantLocale).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _forEachTenantLocale[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _forEachTenantLocale[key];
36
- }
37
- });
38
- });
39
- var _createEntity = require("./createEntity");
40
- Object.keys(_createEntity).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _createEntity[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function () {
46
- return _createEntity[key];
47
- }
48
- });
49
- });
50
- var _createLocaleEntity = require("./createLocaleEntity");
51
- Object.keys(_createLocaleEntity).forEach(function (key) {
52
- if (key === "default" || key === "__esModule") return;
53
- if (key in exports && exports[key] === _createLocaleEntity[key]) return;
54
- Object.defineProperty(exports, key, {
55
- enumerable: true,
56
- get: function () {
57
- return _createLocaleEntity[key];
58
- }
59
- });
60
- });
61
- var _createTenantEntity = require("./createTenantEntity");
62
- Object.keys(_createTenantEntity).forEach(function (key) {
63
- if (key === "default" || key === "__esModule") return;
64
- if (key in exports && exports[key] === _createTenantEntity[key]) return;
65
- Object.defineProperty(exports, key, {
66
- enumerable: true,
67
- get: function () {
68
- return _createTenantEntity[key];
69
- }
70
- });
71
- });
1
+ export * from "./dynamoDb.js";
2
+ export * from "./elasticsearch/index.js";
3
+ export * from "./createEntity.js";
4
+ export * from "./createTenantEntity.js";
5
+ export * from "./getCompressedData.js";
72
6
 
73
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_dynamoDb","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_elasticsearch","_forEachTenantLocale","_createEntity","_createLocaleEntity","_createTenantEntity"],"sources":["index.ts"],"sourcesContent":["export * from \"./dynamoDb\";\nexport * from \"./elasticsearch\";\nexport * from \"./forEachTenantLocale\";\nexport * from \"./createEntity\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,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,aAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,aAAA,CAAAP,GAAA;IAAA;EAAA;AAAA;AACA,IAAAQ,mBAAA,GAAAZ,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAU,mBAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,mBAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,mBAAA,CAAAR,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,mBAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,mBAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,mBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,mBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./dynamoDb.js\";\nexport * from \"./elasticsearch/index.js\";\nexport * from \"./createEntity.js\";\nexport * from \"./createTenantEntity.js\";\nexport * from \"./getCompressedData.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -1,12 +0,0 @@
1
- import { Table } from "@webiny/db-dynamodb/toolbox";
2
- import { DataMigrationContext } from "@webiny/data-migration";
3
- export declare class FileManager_5_35_0_001_FileManagerSettings {
4
- private readonly newSettingsEntity;
5
- private readonly legacySettingsEntity;
6
- private readonly tenantEntity;
7
- constructor(table: Table<string, string, string>);
8
- getId(): string;
9
- getDescription(): string;
10
- shouldExecute({ logger }: DataMigrationContext): Promise<boolean>;
11
- execute({ logger }: DataMigrationContext): Promise<void>;
12
- }
@@ -1,93 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.FileManager_5_35_0_001_FileManagerSettings = void 0;
7
- var _utils = require("../../../utils");
8
- var _createTenantEntity = require("./entities/createTenantEntity");
9
- var _createSettingsEntity = require("./entities/createSettingsEntity");
10
- var _dbDynamodb = require("@webiny/db-dynamodb");
11
- class FileManager_5_35_0_001_FileManagerSettings {
12
- constructor(table) {
13
- this.newSettingsEntity = (0, _utils.createStandardEntity)(table, "FM.Settings");
14
- this.legacySettingsEntity = (0, _createSettingsEntity.createLegacySettingsEntity)(table);
15
- this.tenantEntity = (0, _createTenantEntity.createTenantEntity)(table);
16
- }
17
- getId() {
18
- return "FM Settings";
19
- }
20
- getDescription() {
21
- return "";
22
- }
23
- async shouldExecute({
24
- logger
25
- }) {
26
- const settings = await (0, _utils.queryOne)({
27
- entity: this.legacySettingsEntity,
28
- partitionKey: `T#root#FM#SETTINGS`,
29
- options: {
30
- eq: "default"
31
- }
32
- });
33
- if (!settings) {
34
- logger.info(`Settings not found; system is not yet installed.`);
35
- // The system is not yet installed, skip migration.
36
- return false;
37
- }
38
- const newSettings = await (0, _utils.queryOne)({
39
- entity: this.newSettingsEntity,
40
- partitionKey: `T#root#FM#SETTINGS`,
41
- options: {
42
- eq: "A"
43
- }
44
- });
45
- if (newSettings) {
46
- logger.info(`Settings record seems to be in order.`);
47
- return false;
48
- }
49
- return true;
50
- }
51
- async execute({
52
- logger
53
- }) {
54
- const tenants = await (0, _utils.queryAll)({
55
- entity: this.tenantEntity,
56
- partitionKey: "TENANTS",
57
- options: {
58
- index: "GSI1",
59
- gt: " "
60
- }
61
- });
62
- for (const tenant of tenants) {
63
- const settings = await (0, _utils.queryOne)({
64
- entity: this.legacySettingsEntity,
65
- partitionKey: `T#${tenant.id}#FM#SETTINGS`,
66
- options: {
67
- eq: "default"
68
- }
69
- });
70
- if (!settings) {
71
- // It's possible that a tenant exists, but it was not yet installed.
72
- logger.info(`Tenant ${tenant.name} (${tenant.id}) is not installed. Skipping migration of settings.`);
73
- continue;
74
- }
75
- logger.info(`Updating FM settings for tenant ${tenant.name} (${tenant.id}).`);
76
- await (0, _dbDynamodb.put)({
77
- entity: this.newSettingsEntity,
78
- item: {
79
- PK: `T#${tenant.id}#FM#SETTINGS`,
80
- SK: "A",
81
- TYPE: "fm.settings",
82
- data: {
83
- ...(0, _createSettingsEntity.getSettingsData)(settings),
84
- tenant: tenant.id
85
- }
86
- }
87
- });
88
- }
89
- }
90
- }
91
- exports.FileManager_5_35_0_001_FileManagerSettings = FileManager_5_35_0_001_FileManagerSettings;
92
-
93
- //# sourceMappingURL=FileSettingsMigration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_utils","require","_createTenantEntity","_createSettingsEntity","_dbDynamodb","FileManager_5_35_0_001_FileManagerSettings","constructor","table","newSettingsEntity","createStandardEntity","legacySettingsEntity","createLegacySettingsEntity","tenantEntity","createTenantEntity","getId","getDescription","shouldExecute","logger","settings","queryOne","entity","partitionKey","options","eq","info","newSettings","execute","tenants","queryAll","index","gt","tenant","id","name","put","item","PK","SK","TYPE","data","getSettingsData","exports"],"sources":["FileSettingsMigration.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { DataMigrationContext } from \"@webiny/data-migration\";\nimport { createStandardEntity, queryAll, queryOne } from \"~/utils\";\nimport { createTenantEntity } from \"./entities/createTenantEntity\";\nimport {\n createLegacySettingsEntity,\n createSettingsEntity,\n getSettingsData\n} from \"./entities/createSettingsEntity\";\nimport { put } from \"@webiny/db-dynamodb\";\n\nexport class FileManager_5_35_0_001_FileManagerSettings {\n private readonly newSettingsEntity: ReturnType<typeof createSettingsEntity>;\n private readonly legacySettingsEntity: ReturnType<typeof createLegacySettingsEntity>;\n private readonly tenantEntity: ReturnType<typeof createTenantEntity>;\n\n constructor(table: Table<string, string, string>) {\n this.newSettingsEntity = createStandardEntity(table, \"FM.Settings\");\n this.legacySettingsEntity = createLegacySettingsEntity(table);\n this.tenantEntity = createTenantEntity(table);\n }\n\n getId() {\n return \"FM Settings\";\n }\n\n getDescription() {\n return \"\";\n }\n\n async shouldExecute({ logger }: DataMigrationContext): Promise<boolean> {\n const settings = await queryOne({\n entity: this.legacySettingsEntity,\n partitionKey: `T#root#FM#SETTINGS`,\n options: {\n eq: \"default\"\n }\n });\n\n if (!settings) {\n logger.info(`Settings not found; system is not yet installed.`);\n // The system is not yet installed, skip migration.\n return false;\n }\n\n const newSettings = await queryOne({\n entity: this.newSettingsEntity,\n partitionKey: `T#root#FM#SETTINGS`,\n options: {\n eq: \"A\"\n }\n });\n\n if (newSettings) {\n logger.info(`Settings record seems to be in order.`);\n return false;\n }\n\n return true;\n }\n\n async execute({ logger }: DataMigrationContext): Promise<void> {\n const tenants = await queryAll<{ id: string; name: string }>({\n entity: this.tenantEntity,\n partitionKey: \"TENANTS\",\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n for (const tenant of tenants) {\n const settings = await queryOne({\n entity: this.legacySettingsEntity,\n partitionKey: `T#${tenant.id}#FM#SETTINGS`,\n options: {\n eq: \"default\"\n }\n });\n\n if (!settings) {\n // It's possible that a tenant exists, but it was not yet installed.\n logger.info(\n `Tenant ${tenant.name} (${tenant.id}) is not installed. Skipping migration of settings.`\n );\n continue;\n }\n\n logger.info(`Updating FM settings for tenant ${tenant.name} (${tenant.id}).`);\n await put({\n entity: this.newSettingsEntity,\n item: {\n PK: `T#${tenant.id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import { DataMigration, DataMigrationContext } from "@webiny/data-migration";
3
- export declare type FileMigrationCheckpoint = Record<string, string | boolean | undefined>;
4
- export declare class FileManager_5_35_0_001_FileData implements DataMigration<FileMigrationCheckpoint> {
5
- private readonly newFileEntity;
6
- private readonly legacyFileEntity;
7
- private readonly tenantEntity;
8
- private readonly localeEntity;
9
- constructor(table: Table<string, string, string>);
10
- getId(): string;
11
- getDescription(): string;
12
- shouldExecute({ logger }: DataMigrationContext): Promise<boolean>;
13
- execute({ logger, ...context }: DataMigrationContext): Promise<void>;
14
- }