@webiny/migrations 5.39.8 → 5.40.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 (201) hide show
  1. package/ddb-es.d.ts +2 -1
  2. package/ddb-es.js +4 -1
  3. package/ddb-es.js.map +1 -1
  4. package/ddb.d.ts +2 -1
  5. package/ddb.js +6 -1
  6. package/ddb.js.map +1 -1
  7. package/migrations/5.35.0/001/FileSettingsMigration.js.map +1 -1
  8. package/migrations/5.35.0/001/ddb/FileDataMigration.js.map +1 -1
  9. package/migrations/5.35.0/001/ddb/index.js.map +1 -1
  10. package/migrations/5.35.0/001/ddb-es/FileDataMigration.js.map +1 -1
  11. package/migrations/5.35.0/001/ddb-es/index.js.map +1 -1
  12. package/migrations/5.35.0/001/entities/createFileEntity.js +1 -2
  13. package/migrations/5.35.0/001/entities/createFileEntity.js.map +1 -1
  14. package/migrations/5.35.0/001/entities/createLocaleEntity.js.map +1 -1
  15. package/migrations/5.35.0/001/entities/createSettingsEntity.js.map +1 -1
  16. package/migrations/5.35.0/001/entities/createTenantEntity.js.map +1 -1
  17. package/migrations/5.35.0/001/types.js.map +1 -1
  18. package/migrations/5.35.0/002/createLocaleEntity.js.map +1 -1
  19. package/migrations/5.35.0/002/createSettingsEntity.js.map +1 -1
  20. package/migrations/5.35.0/002/createTenantEntity.js.map +1 -1
  21. package/migrations/5.35.0/002/index.js.map +1 -1
  22. package/migrations/5.35.0/003/createTenantEntity.js.map +1 -1
  23. package/migrations/5.35.0/003/createUserEntity.js.map +1 -1
  24. package/migrations/5.35.0/003/index.js.map +1 -1
  25. package/migrations/5.35.0/004/createTenantEntity.js.map +1 -1
  26. package/migrations/5.35.0/004/index.js.map +1 -1
  27. package/migrations/5.35.0/005/createLocaleEntity.js.map +1 -1
  28. package/migrations/5.35.0/005/createModelEntity.js.map +1 -1
  29. package/migrations/5.35.0/005/createTenantEntity.js.map +1 -1
  30. package/migrations/5.35.0/005/index.js.map +1 -1
  31. package/migrations/5.35.0/005/types.js.map +1 -1
  32. package/migrations/5.35.0/006/constants.js +3 -6
  33. package/migrations/5.35.0/006/constants.js.map +1 -1
  34. package/migrations/5.35.0/006/ddb/PageDataMigration.js.map +1 -1
  35. package/migrations/5.35.0/006/ddb/index.js.map +1 -1
  36. package/migrations/5.35.0/006/ddb-es/PageDataMigration.js.map +1 -1
  37. package/migrations/5.35.0/006/ddb-es/index.js.map +1 -1
  38. package/migrations/5.35.0/006/entities/createEntryEntity.js.map +1 -1
  39. package/migrations/5.35.0/006/entities/createLocaleEntity.js.map +1 -1
  40. package/migrations/5.35.0/006/entities/createPageEntity.js.map +1 -1
  41. package/migrations/5.35.0/006/entities/createTenantEntity.js.map +1 -1
  42. package/migrations/5.35.0/006/types.js.map +1 -1
  43. package/migrations/5.35.0/006/utils/getCompressedData.js.map +1 -1
  44. package/migrations/5.35.0/006/utils/getLexicalContentText.js.map +1 -1
  45. package/migrations/5.35.0/006/utils/getSearchableContent.js.map +1 -1
  46. package/migrations/5.35.0/006/utils/processors/button.js.map +1 -1
  47. package/migrations/5.35.0/006/utils/processors/image.js.map +1 -1
  48. package/migrations/5.35.0/006/utils/processors/images.js.map +1 -1
  49. package/migrations/5.35.0/006/utils/processors/index.js +1 -2
  50. package/migrations/5.35.0/006/utils/processors/index.js.map +1 -1
  51. package/migrations/5.35.0/006/utils/processors/paragraph.js.map +1 -1
  52. package/migrations/5.36.0/001/constants.js +3 -6
  53. package/migrations/5.36.0/001/constants.js.map +1 -1
  54. package/migrations/5.36.0/001/ddb/FileDataMigration.js.map +1 -1
  55. package/migrations/5.36.0/001/ddb/index.js.map +1 -1
  56. package/migrations/5.36.0/001/ddb-es/FileDataMigration.js.map +1 -1
  57. package/migrations/5.36.0/001/ddb-es/index.js.map +1 -1
  58. package/migrations/5.36.0/001/entities/createEntryEntity.js.map +1 -1
  59. package/migrations/5.36.0/001/entities/createFileEntity.js.map +1 -1
  60. package/migrations/5.36.0/001/entities/createLocaleEntity.js.map +1 -1
  61. package/migrations/5.36.0/001/entities/createTenantEntity.js.map +1 -1
  62. package/migrations/5.36.0/001/types.js.map +1 -1
  63. package/migrations/5.36.0/001/utils/createMimeTag.js.map +1 -1
  64. package/migrations/5.36.0/001/utils/getCompressedData.js.map +1 -1
  65. package/migrations/5.37.0/001/TenantLinkDataMigration.js.map +1 -1
  66. package/migrations/5.37.0/001/entities/createTenantEntity.js.map +1 -1
  67. package/migrations/5.37.0/001/entities/createTenantLinkEntity.js.map +1 -1
  68. package/migrations/5.37.0/001/index.js.map +1 -1
  69. package/migrations/5.37.0/001/types.js.map +1 -1
  70. package/migrations/5.37.0/001/utils/isMigratedTenantLink.js.map +1 -1
  71. package/migrations/5.37.0/002/constants.js +1 -2
  72. package/migrations/5.37.0/002/constants.js.map +1 -1
  73. package/migrations/5.37.0/002/ddb/index.js.map +1 -1
  74. package/migrations/5.37.0/002/ddb-es/index.js.map +1 -1
  75. package/migrations/5.37.0/002/entities/createEntryEntity.js.map +1 -1
  76. package/migrations/5.37.0/002/entities/createLocaleEntity.js.map +1 -1
  77. package/migrations/5.37.0/002/entities/createTenantEntity.js.map +1 -1
  78. package/migrations/5.37.0/002/types.js.map +1 -1
  79. package/migrations/5.37.0/002/utils/getCompressedData.js.map +1 -1
  80. package/migrations/5.37.0/002/utils/getDecompressedData.js.map +1 -1
  81. package/migrations/5.37.0/003/constants.js +3 -6
  82. package/migrations/5.37.0/003/constants.js.map +1 -1
  83. package/migrations/5.37.0/003/ddb/AcoFolderMigration.js.map +1 -1
  84. package/migrations/5.37.0/003/ddb/index.js.map +1 -1
  85. package/migrations/5.37.0/003/ddb-es/AcoFolderMigration.js.map +1 -1
  86. package/migrations/5.37.0/003/ddb-es/index.js.map +1 -1
  87. package/migrations/5.37.0/003/ddb-es/latestElasticsearchData.js.map +1 -1
  88. package/migrations/5.37.0/003/entities/createEntryEntity.js.map +1 -1
  89. package/migrations/5.37.0/003/entities/createLocaleEntity.js.map +1 -1
  90. package/migrations/5.37.0/003/entities/createTenantEntity.js.map +1 -1
  91. package/migrations/5.37.0/003/types.js.map +1 -1
  92. package/migrations/5.37.0/003/utils/getCompressedData.js.map +1 -1
  93. package/migrations/5.37.0/003/utils/getDecompressedData.js.map +1 -1
  94. package/migrations/5.37.0/004/constants.js +7 -14
  95. package/migrations/5.37.0/004/constants.js.map +1 -1
  96. package/migrations/5.37.0/004/ddb/PageDataMigration.js.map +1 -1
  97. package/migrations/5.37.0/004/ddb/index.js.map +1 -1
  98. package/migrations/5.37.0/004/ddb-es/PageDataMigration.js.map +1 -1
  99. package/migrations/5.37.0/004/ddb-es/index.js.map +1 -1
  100. package/migrations/5.37.0/004/entities/createEntryEntity.js.map +1 -1
  101. package/migrations/5.37.0/004/entities/createLocaleEntity.js.map +1 -1
  102. package/migrations/5.37.0/004/entities/createPageEntity.js.map +1 -1
  103. package/migrations/5.37.0/004/entities/createTenantEntity.js.map +1 -1
  104. package/migrations/5.37.0/004/types.js.map +1 -1
  105. package/migrations/5.37.0/004/utils/getCompressedData.js.map +1 -1
  106. package/migrations/5.37.0/005/constants.js +3 -6
  107. package/migrations/5.37.0/005/constants.js.map +1 -1
  108. package/migrations/5.37.0/005/ddb/index.js.map +1 -1
  109. package/migrations/5.37.0/005/ddb-es/index.js.map +1 -1
  110. package/migrations/5.37.0/005/entities/createEntryEntity.js.map +1 -1
  111. package/migrations/5.37.0/005/entities/createFileEntity.js.map +1 -1
  112. package/migrations/5.37.0/005/entities/createLocaleEntity.js.map +1 -1
  113. package/migrations/5.37.0/005/entities/createTenantEntity.js.map +1 -1
  114. package/migrations/5.37.0/005/entities/createTenantLinkEntity.js.map +1 -1
  115. package/migrations/5.37.0/005/types.js.map +1 -1
  116. package/migrations/5.38.0/001/ddb/index.js.map +1 -1
  117. package/migrations/5.38.0/001/ddb-es/index.js.map +1 -1
  118. package/migrations/5.38.0/001/entities/createFormEntity.js.map +1 -1
  119. package/migrations/5.38.0/001/types.js.map +1 -1
  120. package/migrations/5.38.0/002/ddb/index.js.map +1 -1
  121. package/migrations/5.38.0/002/ddb-es/index.js.map +1 -1
  122. package/migrations/5.38.0/002/entities/createFormEntity.js.map +1 -1
  123. package/migrations/5.38.0/002/entities/createFormSubmissionDdbEsEntity.js.map +1 -1
  124. package/migrations/5.38.0/002/entities/createFormSubmissionEntity.js.map +1 -1
  125. package/migrations/5.38.0/002/types.js.map +1 -1
  126. package/migrations/5.38.0/003/ddb/compressContent.js.map +1 -1
  127. package/migrations/5.38.0/003/ddb/index.js.map +1 -1
  128. package/migrations/5.38.0/003/entities/createPageBlockEntity.js.map +1 -1
  129. package/migrations/5.38.0/003/types.js.map +1 -1
  130. package/migrations/5.39.0/001/ddb/index.js.map +1 -1
  131. package/migrations/5.39.0/001/ddb-es/index.js.map +1 -1
  132. package/migrations/5.39.0/001/entities/createEntryEntity.js +24 -0
  133. package/migrations/5.39.0/001/entities/createEntryEntity.js.map +1 -1
  134. package/migrations/5.39.0/001/types.js.map +1 -1
  135. package/migrations/5.39.0/001/utils/assignNewMetaFields.js.map +1 -1
  136. package/migrations/5.39.0/001/utils/ensureAllNonNullableValues.js.map +1 -1
  137. package/migrations/5.39.0/001/utils/fixTypeFieldValue.js.map +1 -1
  138. package/migrations/5.39.0/001/utils/getCompressedData.js.map +1 -1
  139. package/migrations/5.39.0/001/utils/getDecompressedData.js.map +1 -1
  140. package/migrations/5.39.0/001/utils/getFallbackIdentity.js.map +1 -1
  141. package/migrations/5.39.0/001/utils/getFirstLastPublishedOn.js.map +1 -1
  142. package/migrations/5.39.0/001/utils/getNonNullableFieldsWithMissingValues.d.ts +1 -1
  143. package/migrations/5.39.0/001/utils/getNonNullableFieldsWithMissingValues.js.map +1 -1
  144. package/migrations/5.39.0/001/utils/getOldestRevisionCreatedOn.js.map +1 -1
  145. package/migrations/5.39.0/001/utils/hasAllNonNullableValues.js.map +1 -1
  146. package/migrations/5.39.0/001/utils/hasValidTypeFieldValue.js.map +1 -1
  147. package/migrations/5.39.0/001/utils/isMigratedEntry.js.map +1 -1
  148. package/migrations/5.39.0/002/ddb/FileManager_5_39_0_002.js.map +1 -1
  149. package/migrations/5.39.0/002/ddb/index.js.map +1 -1
  150. package/migrations/5.39.0/002/ddb-es/FileManager_5_39_0_002.js.map +1 -1
  151. package/migrations/5.39.0/002/ddb-es/index.js.map +1 -1
  152. package/migrations/5.39.0/002/utils/FileMetadata.js.map +1 -1
  153. package/migrations/5.39.0/002/utils/createFileEntity.js.map +1 -1
  154. package/migrations/5.39.0/002/utils/createLocaleEntity.js.map +1 -1
  155. package/migrations/5.39.0/002/utils/createTenantEntity.js.map +1 -1
  156. package/migrations/5.39.2/001/ddb-es/index.js.map +1 -1
  157. package/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.js.map +1 -1
  158. package/migrations/5.39.6/001/ddb-es/SegmentProcessor.js.map +1 -1
  159. package/migrations/5.39.6/001/ddb-es/bin.js.map +1 -1
  160. package/migrations/5.39.6/001/ddb-es/createMetaFieldsDataMigrationDeploymentHook.js.map +1 -1
  161. package/migrations/5.39.6/001/ddb-es/index.js.map +1 -1
  162. package/migrations/5.39.6/001/ddb-es/utils.js +2 -4
  163. package/migrations/5.39.6/001/ddb-es/utils.js.map +1 -1
  164. package/migrations/5.39.6/001/ddb-es/worker.js.map +1 -1
  165. package/migrations/5.40.0/001/ddb/compression.d.ts +15 -0
  166. package/migrations/5.40.0/001/ddb/compression.js +42 -0
  167. package/migrations/5.40.0/001/ddb/compression.js.map +1 -0
  168. package/migrations/5.40.0/001/ddb/createBlockEntity.d.ts +42 -0
  169. package/migrations/5.40.0/001/ddb/createBlockEntity.js +54 -0
  170. package/migrations/5.40.0/001/ddb/createBlockEntity.js.map +1 -0
  171. package/migrations/5.40.0/001/ddb/index.d.ts +13 -0
  172. package/migrations/5.40.0/001/ddb/index.js +155 -0
  173. package/migrations/5.40.0/001/ddb/index.js.map +1 -0
  174. package/migrations/5.40.0/001/ddb/types.d.ts +20 -0
  175. package/migrations/5.40.0/001/ddb/types.js +7 -0
  176. package/migrations/5.40.0/001/ddb/types.js.map +1 -0
  177. package/package.json +17 -17
  178. package/utils/createEntity.js.map +1 -1
  179. package/utils/createLocaleEntity.js.map +1 -1
  180. package/utils/createTenantEntity.js.map +1 -1
  181. package/utils/dynamoDb.js.map +1 -1
  182. package/utils/elasticsearch/disableEsIndexing.js.map +1 -1
  183. package/utils/elasticsearch/esCreateIndex.js.map +1 -1
  184. package/utils/elasticsearch/esFindOne.js.map +1 -1
  185. package/utils/elasticsearch/esGetIndexExist.js.map +1 -1
  186. package/utils/elasticsearch/esGetIndexName.js.map +1 -1
  187. package/utils/elasticsearch/esGetIndexSettings.js.map +1 -1
  188. package/utils/elasticsearch/esListIndexes.js.map +1 -1
  189. package/utils/elasticsearch/esPutIndexSettings.js.map +1 -1
  190. package/utils/elasticsearch/esQueryAll.js.map +1 -1
  191. package/utils/elasticsearch/esQueryAllWithCallback.js.map +1 -1
  192. package/utils/elasticsearch/fetchOriginalEsSettings.js.map +1 -1
  193. package/utils/elasticsearch/index.js.map +1 -1
  194. package/utils/elasticsearch/plugins/base.js +1 -2
  195. package/utils/elasticsearch/plugins/base.js.map +1 -1
  196. package/utils/elasticsearch/plugins/index.js.map +1 -1
  197. package/utils/elasticsearch/plugins/japanese.js +1 -2
  198. package/utils/elasticsearch/plugins/japanese.js.map +1 -1
  199. package/utils/elasticsearch/restoreOriginalEsSettings.js.map +1 -1
  200. package/utils/forEachTenantLocale.js.map +1 -1
  201. package/utils/index.js.map +1 -1
package/ddb-es.d.ts CHANGED
@@ -15,4 +15,5 @@ import { MultiStepForms_5_38_0_002 } from "./migrations/5.38.0/002/ddb-es";
15
15
  import { PageBlocks_5_38_0_003 } from "./migrations/5.38.0/003/ddb";
16
16
  import { FileManager_5_39_0_002 } from "./migrations/5.39.0/002/ddb-es";
17
17
  import { CmsEntriesInitNewMetaFields_5_39_6_001 } from "./migrations/5.39.6/001/ddb-es";
18
- export declare const migrations: () => (typeof FileManager_5_35_0_001 | typeof PageBuilder_5_35_0_002 | typeof AdminUsers_5_35_0_003 | typeof Tenancy_5_35_0_004 | typeof CmsModels_5_35_0_005 | typeof AcoRecords_5_35_0_006 | typeof AcoRecords_5_36_0_001 | typeof TenantLinkRecords_5_37_0_001 | typeof CmsEntriesRootFolder_5_37_0_002 | typeof AcoFolders_5_37_0_003 | typeof AcoRecords_5_37_0_004 | typeof FileManager_5_37_0_005 | typeof MultiStepForms_5_38_0_001 | typeof MultiStepForms_5_38_0_002 | typeof PageBlocks_5_38_0_003 | typeof FileManager_5_39_0_002 | typeof CmsEntriesInitNewMetaFields_5_39_6_001)[];
18
+ import { PbUniqueBlockElementIds_5_40_0_001 } from "./migrations/5.40.0/001/ddb";
19
+ export declare const migrations: () => (typeof FileManager_5_35_0_001 | typeof PageBuilder_5_35_0_002 | typeof AdminUsers_5_35_0_003 | typeof Tenancy_5_35_0_004 | typeof CmsModels_5_35_0_005 | typeof AcoRecords_5_35_0_006 | typeof AcoRecords_5_36_0_001 | typeof TenantLinkRecords_5_37_0_001 | typeof CmsEntriesRootFolder_5_37_0_002 | typeof AcoFolders_5_37_0_003 | typeof AcoRecords_5_37_0_004 | typeof FileManager_5_37_0_005 | typeof MultiStepForms_5_38_0_001 | typeof MultiStepForms_5_38_0_002 | typeof PageBlocks_5_38_0_003 | typeof FileManager_5_39_0_002 | typeof CmsEntriesInitNewMetaFields_5_39_6_001 | typeof PbUniqueBlockElementIds_5_40_0_001)[];
package/ddb-es.js CHANGED
@@ -21,6 +21,7 @@ var _ddbEs9 = require("./migrations/5.38.0/002/ddb-es");
21
21
  var _ddb = require("./migrations/5.38.0/003/ddb");
22
22
  var _ddbEs10 = require("./migrations/5.39.0/002/ddb-es");
23
23
  var _ddbEs11 = require("./migrations/5.39.6/001/ddb-es");
24
+ var _ddb2 = require("./migrations/5.40.0/001/ddb");
24
25
  // 5.35.0
25
26
 
26
27
  // 5.36.0
@@ -60,7 +61,9 @@ const migrations = () => {
60
61
  // CmsEntriesInitNewMetaFields_5_39_2_001
61
62
 
62
63
  // 5.39.6
63
- _ddbEs11.CmsEntriesInitNewMetaFields_5_39_6_001];
64
+ _ddbEs11.CmsEntriesInitNewMetaFields_5_39_6_001,
65
+ // 5.40.0
66
+ _ddb2.PbUniqueBlockElementIds_5_40_0_001];
64
67
  };
65
68
  exports.migrations = migrations;
66
69
 
package/ddb-es.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_ddbEs","require","_","_2","_3","_4","_ddbEs2","_ddbEs3","_5","_ddbEs4","_ddbEs5","_ddbEs6","_ddbEs7","_ddbEs8","_ddbEs9","_ddb","_ddbEs10","_ddbEs11","migrations","FileManager_5_35_0_001","PageBuilder_5_35_0_002","AdminUsers_5_35_0_003","Tenancy_5_35_0_004","CmsModels_5_35_0_005","AcoRecords_5_35_0_006","AcoRecords_5_36_0_001","TenantLinkRecords_5_37_0_001","CmsEntriesRootFolder_5_37_0_002","AcoFolders_5_37_0_003","AcoRecords_5_37_0_004","FileManager_5_37_0_005","MultiStepForms_5_38_0_001","MultiStepForms_5_38_0_002","PageBlocks_5_38_0_003","FileManager_5_39_0_002","CmsEntriesInitNewMetaFields_5_39_6_001","exports"],"sources":["ddb-es.ts"],"sourcesContent":["// 5.35.0\nimport { FileManager_5_35_0_001 } from \"./migrations/5.35.0/001/ddb-es\";\nimport { PageBuilder_5_35_0_002 } from \"~/migrations/5.35.0/002\";\nimport { AdminUsers_5_35_0_003 } from \"~/migrations/5.35.0/003\";\nimport { Tenancy_5_35_0_004 } from \"~/migrations/5.35.0/004\";\nimport { CmsModels_5_35_0_005 } from \"~/migrations/5.35.0/005\";\nimport { AcoRecords_5_35_0_006 } from \"~/migrations/5.35.0/006/ddb-es\";\n\n// 5.36.0\nimport { AcoRecords_5_36_0_001 } from \"~/migrations/5.36.0/001/ddb-es\";\n\n// 5.37.0\nimport { TenantLinkRecords_5_37_0_001 } from \"~/migrations/5.37.0/001\";\nimport { CmsEntriesRootFolder_5_37_0_002 } from \"~/migrations/5.37.0/002/ddb-es\";\nimport { AcoFolders_5_37_0_003 } from \"~/migrations/5.37.0/003/ddb-es\";\nimport { AcoRecords_5_37_0_004 } from \"~/migrations/5.37.0/004/ddb-es\";\nimport { FileManager_5_37_0_005 } from \"~/migrations/5.37.0/005/ddb-es\";\n\n// 5.38.0\nimport { MultiStepForms_5_38_0_001 } from \"~/migrations/5.38.0/001/ddb-es\";\nimport { MultiStepForms_5_38_0_002 } from \"~/migrations/5.38.0/002/ddb-es\";\n// Page Blocks storage is the same for both DDB abd DDB-ES projects.\nimport { PageBlocks_5_38_0_003 } from \"~/migrations/5.38.0/003/ddb\";\n\n// 5.39.0\n// Because of the 5.39.6-001 migration, this one is no longer needed.\n// import { CmsEntriesInitNewMetaFields_5_39_0_001 } from \"~/migrations/5.39.0/001/ddb-es\";\nimport { FileManager_5_39_0_002 } from \"~/migrations/5.39.0/002/ddb-es\";\n\n// 5.39.2\n// Because of the 5.39.6-001 migration, this one is no longer needed.\n// import { CmsEntriesInitNewMetaFields_5_39_2_001 } from \"~/migrations/5.39.2/001/ddb-es\";\n\n// 5.39.6\nimport { CmsEntriesInitNewMetaFields_5_39_6_001 } from \"~/migrations/5.39.6/001/ddb-es\";\n\nexport const migrations = () => {\n return [\n // 5.35.0\n FileManager_5_35_0_001,\n PageBuilder_5_35_0_002,\n AdminUsers_5_35_0_003,\n Tenancy_5_35_0_004,\n CmsModels_5_35_0_005,\n AcoRecords_5_35_0_006,\n\n // 5.36.0\n AcoRecords_5_36_0_001,\n\n // 5.37.0\n TenantLinkRecords_5_37_0_001,\n CmsEntriesRootFolder_5_37_0_002,\n AcoFolders_5_37_0_003,\n AcoRecords_5_37_0_004,\n FileManager_5_37_0_005,\n\n // 5.38.0\n MultiStepForms_5_38_0_001,\n MultiStepForms_5_38_0_002,\n PageBlocks_5_38_0_003,\n\n // 5.39.0\n // Because of the 5.39.6-001 migration, this one is no longer needed.\n // CmsEntriesInitNewMetaFields_5_39_0_001,\n FileManager_5_39_0_002,\n\n // 5.39.2\n // Because of the 5.39.6-001 migration, this one is no longer needed.\n // CmsEntriesInitNewMetaFields_5_39_2_001\n\n // 5.39.6\n CmsEntriesInitNewMetaFields_5_39_6_001\n ];\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GAAAD,OAAA;AACA,IAAAE,EAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAH,OAAA;AACA,IAAAI,EAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAGA,IAAAM,OAAA,GAAAN,OAAA;AAGA,IAAAO,EAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AAGA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AAEA,IAAAc,IAAA,GAAAd,OAAA;AAKA,IAAAe,QAAA,GAAAf,OAAA;AAOA,IAAAgB,QAAA,GAAAhB,OAAA;AAlCA;;AAQA;;AAGA;;AAOA;;AAGA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;;AAGO,MAAMiB,UAAU,GAAGA,CAAA,KAAM;EAC5B,OAAO;EACH;EACAC,6BAAsB,EACtBC,wBAAsB,EACtBC,wBAAqB,EACrBC,qBAAkB,EAClBC,uBAAoB,EACpBC,6BAAqB;EAErB;EACAC,6BAAqB;EAErB;EACAC,+BAA4B,EAC5BC,uCAA+B,EAC/BC,6BAAqB,EACrBC,6BAAqB,EACrBC,8BAAsB;EAEtB;EACAC,iCAAyB,EACzBC,iCAAyB,EACzBC,0BAAqB;EAErB;EACA;EACA;EACAC,+BAAsB;EAEtB;EACA;EACA;;EAEA;EACAC,+CAAsC,CACzC;AACL,CAAC;AAACC,OAAA,CAAAlB,UAAA,GAAAA,UAAA"}
1
+ {"version":3,"names":["_ddbEs","require","_","_2","_3","_4","_ddbEs2","_ddbEs3","_5","_ddbEs4","_ddbEs5","_ddbEs6","_ddbEs7","_ddbEs8","_ddbEs9","_ddb","_ddbEs10","_ddbEs11","_ddb2","migrations","FileManager_5_35_0_001","PageBuilder_5_35_0_002","AdminUsers_5_35_0_003","Tenancy_5_35_0_004","CmsModels_5_35_0_005","AcoRecords_5_35_0_006","AcoRecords_5_36_0_001","TenantLinkRecords_5_37_0_001","CmsEntriesRootFolder_5_37_0_002","AcoFolders_5_37_0_003","AcoRecords_5_37_0_004","FileManager_5_37_0_005","MultiStepForms_5_38_0_001","MultiStepForms_5_38_0_002","PageBlocks_5_38_0_003","FileManager_5_39_0_002","CmsEntriesInitNewMetaFields_5_39_6_001","PbUniqueBlockElementIds_5_40_0_001","exports"],"sources":["ddb-es.ts"],"sourcesContent":["// 5.35.0\nimport { FileManager_5_35_0_001 } from \"./migrations/5.35.0/001/ddb-es\";\nimport { PageBuilder_5_35_0_002 } from \"~/migrations/5.35.0/002\";\nimport { AdminUsers_5_35_0_003 } from \"~/migrations/5.35.0/003\";\nimport { Tenancy_5_35_0_004 } from \"~/migrations/5.35.0/004\";\nimport { CmsModels_5_35_0_005 } from \"~/migrations/5.35.0/005\";\nimport { AcoRecords_5_35_0_006 } from \"~/migrations/5.35.0/006/ddb-es\";\n\n// 5.36.0\nimport { AcoRecords_5_36_0_001 } from \"~/migrations/5.36.0/001/ddb-es\";\n\n// 5.37.0\nimport { TenantLinkRecords_5_37_0_001 } from \"~/migrations/5.37.0/001\";\nimport { CmsEntriesRootFolder_5_37_0_002 } from \"~/migrations/5.37.0/002/ddb-es\";\nimport { AcoFolders_5_37_0_003 } from \"~/migrations/5.37.0/003/ddb-es\";\nimport { AcoRecords_5_37_0_004 } from \"~/migrations/5.37.0/004/ddb-es\";\nimport { FileManager_5_37_0_005 } from \"~/migrations/5.37.0/005/ddb-es\";\n\n// 5.38.0\nimport { MultiStepForms_5_38_0_001 } from \"~/migrations/5.38.0/001/ddb-es\";\nimport { MultiStepForms_5_38_0_002 } from \"~/migrations/5.38.0/002/ddb-es\";\n// Page Blocks storage is the same for both DDB abd DDB-ES projects.\nimport { PageBlocks_5_38_0_003 } from \"~/migrations/5.38.0/003/ddb\";\n\n// 5.39.0\n// Because of the 5.39.6-001 migration, this one is no longer needed.\n// import { CmsEntriesInitNewMetaFields_5_39_0_001 } from \"~/migrations/5.39.0/001/ddb-es\";\nimport { FileManager_5_39_0_002 } from \"~/migrations/5.39.0/002/ddb-es\";\n\n// 5.39.2\n// Because of the 5.39.6-001 migration, this one is no longer needed.\n// import { CmsEntriesInitNewMetaFields_5_39_2_001 } from \"~/migrations/5.39.2/001/ddb-es\";\n\n// 5.39.6\nimport { CmsEntriesInitNewMetaFields_5_39_6_001 } from \"~/migrations/5.39.6/001/ddb-es\";\n\nimport { PbUniqueBlockElementIds_5_40_0_001 } from \"~/migrations/5.40.0/001/ddb\";\n\nexport const migrations = () => {\n return [\n // 5.35.0\n FileManager_5_35_0_001,\n PageBuilder_5_35_0_002,\n AdminUsers_5_35_0_003,\n Tenancy_5_35_0_004,\n CmsModels_5_35_0_005,\n AcoRecords_5_35_0_006,\n\n // 5.36.0\n AcoRecords_5_36_0_001,\n\n // 5.37.0\n TenantLinkRecords_5_37_0_001,\n CmsEntriesRootFolder_5_37_0_002,\n AcoFolders_5_37_0_003,\n AcoRecords_5_37_0_004,\n FileManager_5_37_0_005,\n\n // 5.38.0\n MultiStepForms_5_38_0_001,\n MultiStepForms_5_38_0_002,\n PageBlocks_5_38_0_003,\n\n // 5.39.0\n // Because of the 5.39.6-001 migration, this one is no longer needed.\n // CmsEntriesInitNewMetaFields_5_39_0_001,\n FileManager_5_39_0_002,\n\n // 5.39.2\n // Because of the 5.39.6-001 migration, this one is no longer needed.\n // CmsEntriesInitNewMetaFields_5_39_2_001\n\n // 5.39.6\n CmsEntriesInitNewMetaFields_5_39_6_001,\n\n // 5.40.0\n PbUniqueBlockElementIds_5_40_0_001\n ];\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GAAAD,OAAA;AACA,IAAAE,EAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAH,OAAA;AACA,IAAAI,EAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAGA,IAAAM,OAAA,GAAAN,OAAA;AAGA,IAAAO,EAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AAGA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AAEA,IAAAc,IAAA,GAAAd,OAAA;AAKA,IAAAe,QAAA,GAAAf,OAAA;AAOA,IAAAgB,QAAA,GAAAhB,OAAA;AAEA,IAAAiB,KAAA,GAAAjB,OAAA;AApCA;;AAQA;;AAGA;;AAOA;;AAGA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;;AAKO,MAAMkB,UAAU,GAAGA,CAAA,KAAM;EAC5B,OAAO;EACH;EACAC,6BAAsB,EACtBC,wBAAsB,EACtBC,wBAAqB,EACrBC,qBAAkB,EAClBC,uBAAoB,EACpBC,6BAAqB;EAErB;EACAC,6BAAqB;EAErB;EACAC,+BAA4B,EAC5BC,uCAA+B,EAC/BC,6BAAqB,EACrBC,6BAAqB,EACrBC,8BAAsB;EAEtB;EACAC,iCAAyB,EACzBC,iCAAyB,EACzBC,0BAAqB;EAErB;EACA;EACA;EACAC,+BAAsB;EAEtB;EACA;EACA;;EAEA;EACAC,+CAAsC;EAEtC;EACAC,wCAAkC,CACrC;AACL,CAAC;AAACC,OAAA,CAAAnB,UAAA,GAAAA,UAAA","ignoreList":[]}
package/ddb.d.ts CHANGED
@@ -15,4 +15,5 @@ import { MultiStepForms_5_38_0_002 } from "./migrations/5.38.0/002/ddb";
15
15
  import { PageBlocks_5_38_0_003 } from "./migrations/5.38.0/003/ddb";
16
16
  import { CmsEntriesInitNewMetaFields_5_39_0_001 } from "./migrations/5.39.0/001/ddb";
17
17
  import { FileManager_5_39_0_002 } from "./migrations/5.39.0/002/ddb";
18
- export declare const migrations: () => (typeof PageBuilder_5_35_0_002 | typeof AdminUsers_5_35_0_003 | typeof Tenancy_5_35_0_004 | typeof CmsModels_5_35_0_005 | typeof TenantLinkRecords_5_37_0_001 | typeof PageBlocks_5_38_0_003 | typeof FileManager_5_35_0_001 | typeof AcoRecords_5_35_0_006 | typeof AcoRecords_5_36_0_001 | typeof CmsEntriesRootFolder_5_37_0_002 | typeof AcoFolders_5_37_0_003 | typeof AcoRecords_5_37_0_004 | typeof FileManager_5_37_0_005 | typeof MultiStepForms_5_38_0_001 | typeof MultiStepForms_5_38_0_002 | typeof CmsEntriesInitNewMetaFields_5_39_0_001 | typeof FileManager_5_39_0_002)[];
18
+ import { PbUniqueBlockElementIds_5_40_0_001 } from "./migrations/5.40.0/001/ddb";
19
+ export declare const migrations: () => (typeof PageBuilder_5_35_0_002 | typeof AdminUsers_5_35_0_003 | typeof Tenancy_5_35_0_004 | typeof CmsModels_5_35_0_005 | typeof TenantLinkRecords_5_37_0_001 | typeof PageBlocks_5_38_0_003 | typeof PbUniqueBlockElementIds_5_40_0_001 | typeof FileManager_5_35_0_001 | typeof AcoRecords_5_35_0_006 | typeof AcoRecords_5_36_0_001 | typeof CmsEntriesRootFolder_5_37_0_002 | typeof AcoFolders_5_37_0_003 | typeof AcoRecords_5_37_0_004 | typeof FileManager_5_37_0_005 | typeof MultiStepForms_5_38_0_001 | typeof MultiStepForms_5_38_0_002 | typeof CmsEntriesInitNewMetaFields_5_39_0_001 | typeof FileManager_5_39_0_002)[];
package/ddb.js CHANGED
@@ -21,6 +21,7 @@ var _ddb9 = require("./migrations/5.38.0/002/ddb");
21
21
  var _ddb10 = require("./migrations/5.38.0/003/ddb");
22
22
  var _ddb11 = require("./migrations/5.39.0/001/ddb");
23
23
  var _ddb12 = require("./migrations/5.39.0/002/ddb");
24
+ var _ddb13 = require("./migrations/5.40.0/001/ddb");
24
25
  // 5.35.0
25
26
 
26
27
  // 5.36.0
@@ -31,6 +32,8 @@ var _ddb12 = require("./migrations/5.39.0/002/ddb");
31
32
 
32
33
  // 5.39.0
33
34
 
35
+ // Page Blocks storage is the same for both DDB abd DDB-ES projects.
36
+
34
37
  const migrations = () => {
35
38
  return [
36
39
  // 5.35.0
@@ -42,7 +45,9 @@ const migrations = () => {
42
45
  // 5.38.0
43
46
  _ddb8.MultiStepForms_5_38_0_001, _ddb9.MultiStepForms_5_38_0_002, _ddb10.PageBlocks_5_38_0_003,
44
47
  // 5.39.0
45
- _ddb11.CmsEntriesInitNewMetaFields_5_39_0_001, _ddb12.FileManager_5_39_0_002];
48
+ _ddb11.CmsEntriesInitNewMetaFields_5_39_0_001, _ddb12.FileManager_5_39_0_002,
49
+ // 5.40.0
50
+ _ddb13.PbUniqueBlockElementIds_5_40_0_001];
46
51
  };
47
52
  exports.migrations = migrations;
48
53
 
package/ddb.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_ddb","require","_","_2","_3","_4","_ddb2","_ddb3","_5","_ddb4","_ddb5","_ddb6","_ddb7","_ddb8","_ddb9","_ddb10","_ddb11","_ddb12","migrations","FileManager_5_35_0_001","PageBuilder_5_35_0_002","AdminUsers_5_35_0_003","Tenancy_5_35_0_004","CmsModels_5_35_0_005","AcoRecords_5_35_0_006","AcoRecords_5_36_0_001","TenantLinkRecords_5_37_0_001","CmsEntriesRootFolder_5_37_0_002","AcoFolders_5_37_0_003","AcoRecords_5_37_0_004","FileManager_5_37_0_005","MultiStepForms_5_38_0_001","MultiStepForms_5_38_0_002","PageBlocks_5_38_0_003","CmsEntriesInitNewMetaFields_5_39_0_001","FileManager_5_39_0_002","exports"],"sources":["ddb.ts"],"sourcesContent":["// 5.35.0\nimport { FileManager_5_35_0_001 } from \"./migrations/5.35.0/001/ddb\";\nimport { PageBuilder_5_35_0_002 } from \"~/migrations/5.35.0/002\";\nimport { AdminUsers_5_35_0_003 } from \"~/migrations/5.35.0/003\";\nimport { Tenancy_5_35_0_004 } from \"~/migrations/5.35.0/004\";\nimport { CmsModels_5_35_0_005 } from \"~/migrations/5.35.0/005\";\nimport { AcoRecords_5_35_0_006 } from \"~/migrations/5.35.0/006/ddb\";\n// 5.36.0\nimport { AcoRecords_5_36_0_001 } from \"~/migrations/5.36.0/001/ddb\";\n// 5.37.0\nimport { TenantLinkRecords_5_37_0_001 } from \"~/migrations/5.37.0/001\";\nimport { CmsEntriesRootFolder_5_37_0_002 } from \"~/migrations/5.37.0/002/ddb\";\nimport { AcoFolders_5_37_0_003 } from \"~/migrations/5.37.0/003/ddb\";\nimport { AcoRecords_5_37_0_004 } from \"~/migrations/5.37.0/004/ddb\";\nimport { FileManager_5_37_0_005 } from \"~/migrations/5.37.0/005/ddb\";\n// 5.38.0\nimport { MultiStepForms_5_38_0_001 } from \"~/migrations/5.38.0/001/ddb\";\nimport { MultiStepForms_5_38_0_002 } from \"~/migrations/5.38.0/002/ddb\";\nimport { PageBlocks_5_38_0_003 } from \"~/migrations/5.38.0/003/ddb\";\n// 5.39.0\nimport { CmsEntriesInitNewMetaFields_5_39_0_001 } from \"~/migrations/5.39.0/001/ddb\";\nimport { FileManager_5_39_0_002 } from \"~/migrations/5.39.0/002/ddb\";\n\nexport const migrations = () => {\n return [\n // 5.35.0\n FileManager_5_35_0_001,\n PageBuilder_5_35_0_002,\n AdminUsers_5_35_0_003,\n Tenancy_5_35_0_004,\n CmsModels_5_35_0_005,\n AcoRecords_5_35_0_006,\n // 5.36.0\n AcoRecords_5_36_0_001,\n // 5.37.0\n TenantLinkRecords_5_37_0_001,\n CmsEntriesRootFolder_5_37_0_002,\n AcoFolders_5_37_0_003,\n AcoRecords_5_37_0_004,\n FileManager_5_37_0_005,\n // 5.38.0\n MultiStepForms_5_38_0_001,\n MultiStepForms_5_38_0_002,\n PageBlocks_5_38_0_003,\n // 5.39.0\n CmsEntriesInitNewMetaFields_5_39_0_001,\n FileManager_5_39_0_002\n ];\n};\n"],"mappings":";;;;;;AACA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GAAAD,OAAA;AACA,IAAAE,EAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAH,OAAA;AACA,IAAAI,EAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAN,OAAA;AAEA,IAAAO,EAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,KAAA,GAAAV,OAAA;AACA,IAAAW,KAAA,GAAAX,OAAA;AAEA,IAAAY,KAAA,GAAAZ,OAAA;AACA,IAAAa,KAAA,GAAAb,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AAEA,IAAAe,MAAA,GAAAf,OAAA;AACA,IAAAgB,MAAA,GAAAhB,OAAA;AArBA;;AAOA;;AAEA;;AAMA;;AAIA;;AAIO,MAAMiB,UAAU,GAAGA,CAAA,KAAM;EAC5B,OAAO;EACH;EACAC,2BAAsB,EACtBC,wBAAsB,EACtBC,wBAAqB,EACrBC,qBAAkB,EAClBC,uBAAoB,EACpBC,2BAAqB;EACrB;EACAC,2BAAqB;EACrB;EACAC,+BAA4B,EAC5BC,qCAA+B,EAC/BC,2BAAqB,EACrBC,2BAAqB,EACrBC,4BAAsB;EACtB;EACAC,+BAAyB,EACzBC,+BAAyB,EACzBC,4BAAqB;EACrB;EACAC,6CAAsC,EACtCC,6BAAsB,CACzB;AACL,CAAC;AAACC,OAAA,CAAAlB,UAAA,GAAAA,UAAA"}
1
+ {"version":3,"names":["_ddb","require","_","_2","_3","_4","_ddb2","_ddb3","_5","_ddb4","_ddb5","_ddb6","_ddb7","_ddb8","_ddb9","_ddb10","_ddb11","_ddb12","_ddb13","migrations","FileManager_5_35_0_001","PageBuilder_5_35_0_002","AdminUsers_5_35_0_003","Tenancy_5_35_0_004","CmsModels_5_35_0_005","AcoRecords_5_35_0_006","AcoRecords_5_36_0_001","TenantLinkRecords_5_37_0_001","CmsEntriesRootFolder_5_37_0_002","AcoFolders_5_37_0_003","AcoRecords_5_37_0_004","FileManager_5_37_0_005","MultiStepForms_5_38_0_001","MultiStepForms_5_38_0_002","PageBlocks_5_38_0_003","CmsEntriesInitNewMetaFields_5_39_0_001","FileManager_5_39_0_002","PbUniqueBlockElementIds_5_40_0_001","exports"],"sources":["ddb.ts"],"sourcesContent":["// 5.35.0\nimport { FileManager_5_35_0_001 } from \"./migrations/5.35.0/001/ddb\";\nimport { PageBuilder_5_35_0_002 } from \"~/migrations/5.35.0/002\";\nimport { AdminUsers_5_35_0_003 } from \"~/migrations/5.35.0/003\";\nimport { Tenancy_5_35_0_004 } from \"~/migrations/5.35.0/004\";\nimport { CmsModels_5_35_0_005 } from \"~/migrations/5.35.0/005\";\nimport { AcoRecords_5_35_0_006 } from \"~/migrations/5.35.0/006/ddb\";\n// 5.36.0\nimport { AcoRecords_5_36_0_001 } from \"~/migrations/5.36.0/001/ddb\";\n// 5.37.0\nimport { TenantLinkRecords_5_37_0_001 } from \"~/migrations/5.37.0/001\";\nimport { CmsEntriesRootFolder_5_37_0_002 } from \"~/migrations/5.37.0/002/ddb\";\nimport { AcoFolders_5_37_0_003 } from \"~/migrations/5.37.0/003/ddb\";\nimport { AcoRecords_5_37_0_004 } from \"~/migrations/5.37.0/004/ddb\";\nimport { FileManager_5_37_0_005 } from \"~/migrations/5.37.0/005/ddb\";\n// 5.38.0\nimport { MultiStepForms_5_38_0_001 } from \"~/migrations/5.38.0/001/ddb\";\nimport { MultiStepForms_5_38_0_002 } from \"~/migrations/5.38.0/002/ddb\";\nimport { PageBlocks_5_38_0_003 } from \"~/migrations/5.38.0/003/ddb\";\n// 5.39.0\nimport { CmsEntriesInitNewMetaFields_5_39_0_001 } from \"~/migrations/5.39.0/001/ddb\";\nimport { FileManager_5_39_0_002 } from \"~/migrations/5.39.0/002/ddb\";\n// Page Blocks storage is the same for both DDB abd DDB-ES projects.\nimport { PbUniqueBlockElementIds_5_40_0_001 } from \"~/migrations/5.40.0/001/ddb\";\n\nexport const migrations = () => {\n return [\n // 5.35.0\n FileManager_5_35_0_001,\n PageBuilder_5_35_0_002,\n AdminUsers_5_35_0_003,\n Tenancy_5_35_0_004,\n CmsModels_5_35_0_005,\n AcoRecords_5_35_0_006,\n // 5.36.0\n AcoRecords_5_36_0_001,\n // 5.37.0\n TenantLinkRecords_5_37_0_001,\n CmsEntriesRootFolder_5_37_0_002,\n AcoFolders_5_37_0_003,\n AcoRecords_5_37_0_004,\n FileManager_5_37_0_005,\n // 5.38.0\n MultiStepForms_5_38_0_001,\n MultiStepForms_5_38_0_002,\n PageBlocks_5_38_0_003,\n // 5.39.0\n CmsEntriesInitNewMetaFields_5_39_0_001,\n FileManager_5_39_0_002,\n // 5.40.0\n PbUniqueBlockElementIds_5_40_0_001\n ];\n};\n"],"mappings":";;;;;;AACA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GAAAD,OAAA;AACA,IAAAE,EAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAH,OAAA;AACA,IAAAI,EAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAN,OAAA;AAEA,IAAAO,EAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,KAAA,GAAAV,OAAA;AACA,IAAAW,KAAA,GAAAX,OAAA;AAEA,IAAAY,KAAA,GAAAZ,OAAA;AACA,IAAAa,KAAA,GAAAb,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AAEA,IAAAe,MAAA,GAAAf,OAAA;AACA,IAAAgB,MAAA,GAAAhB,OAAA;AAEA,IAAAiB,MAAA,GAAAjB,OAAA;AAvBA;;AAOA;;AAEA;;AAMA;;AAIA;;AAGA;;AAGO,MAAMkB,UAAU,GAAGA,CAAA,KAAM;EAC5B,OAAO;EACH;EACAC,2BAAsB,EACtBC,wBAAsB,EACtBC,wBAAqB,EACrBC,qBAAkB,EAClBC,uBAAoB,EACpBC,2BAAqB;EACrB;EACAC,2BAAqB;EACrB;EACAC,+BAA4B,EAC5BC,qCAA+B,EAC/BC,2BAAqB,EACrBC,2BAAqB,EACrBC,4BAAsB;EACtB;EACAC,+BAAyB,EACzBC,+BAAyB,EACzBC,4BAAqB;EACrB;EACAC,6CAAsC,EACtCC,6BAAsB;EACtB;EACAC,yCAAkC,CACrC;AACL,CAAC;AAACC,OAAA,CAAAnB,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -1 +1 @@
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}#FM#SETTINGS`,\n SK: \"A\",\n TYPE: \"fm.settings\",\n data: {\n ...getSettingsData(settings),\n tenant: tenant.id\n }\n }\n });\n }\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AAEO,MAAMI,0CAA0C,CAAC;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,CAAC,CAAC;IAEF,KAAK,MAAMC,MAAM,IAAIJ,OAAO,EAAE;MAC1B,MAAMT,QAAQ,GAAG,MAAM,IAAAC,eAAQ,EAAC;QAC5BC,MAAM,EAAE,IAAI,CAACV,oBAAoB;QACjCW,YAAY,EAAG,KAAIU,MAAM,CAACC,EAAG,cAAa;QAC1CV,OAAO,EAAE;UACLC,EAAE,EAAE;QACR;MACJ,CAAC,CAAC;MAEF,IAAI,CAACL,QAAQ,EAAE;QACX;QACAD,MAAM,CAACO,IAAI,CACN,UAASO,MAAM,CAACE,IAAK,KAAIF,MAAM,CAACC,EAAG,qDACxC,CAAC;QACD;MACJ;MAEAf,MAAM,CAACO,IAAI,CAAE,mCAAkCO,MAAM,CAACE,IAAK,KAAIF,MAAM,CAACC,EAAG,IAAG,CAAC;MAC7E,MAAM,IAAAE,eAAG,EAAC;QACNd,MAAM,EAAE,IAAI,CAACZ,iBAAiB;QAC9B2B,IAAI,EAAE;UACFC,EAAE,EAAG,KAAIL,MAAM,CAACC,EAAG,cAAa;UAChCK,EAAE,EAAE,GAAG;UACPC,IAAI,EAAE,aAAa;UACnBC,IAAI,EAAE;YACF,GAAG,IAAAC,qCAAe,EAACtB,QAAQ,CAAC;YAC5Ba,MAAM,EAAEA,MAAM,CAACC;UACnB;QACJ;MACJ,CAAC,CAAC;IACN;EACJ;AACJ;AAACS,OAAA,CAAApC,0CAAA,GAAAA,0CAAA"}
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}#FM#SETTINGS`,\n SK: \"A\",\n TYPE: \"fm.settings\",\n data: {\n ...getSettingsData(settings),\n tenant: tenant.id\n }\n }\n });\n }\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AAEO,MAAMI,0CAA0C,CAAC;EAKpDC,WAAWA,CAACC,KAAoC,EAAE;IAC9C,IAAI,CAACC,iBAAiB,GAAG,IAAAC,2BAAoB,EAACF,KAAK,EAAE,aAAa,CAAC;IACnE,IAAI,CAACG,oBAAoB,GAAG,IAAAC,gDAA0B,EAACJ,KAAK,CAAC;IAC7D,IAAI,CAACK,YAAY,GAAG,IAAAC,sCAAkB,EAACN,KAAK,CAAC;EACjD;EAEAO,KAAKA,CAAA,EAAG;IACJ,OAAO,aAAa;EACxB;EAEAC,cAAcA,CAAA,EAAG;IACb,OAAO,EAAE;EACb;EAEA,MAAMC,aAAaA,CAAC;IAAEC;EAA6B,CAAC,EAAoB;IACpE,MAAMC,QAAQ,GAAG,MAAM,IAAAC,eAAQ,EAAC;MAC5BC,MAAM,EAAE,IAAI,CAACV,oBAAoB;MACjCW,YAAY,EAAG,oBAAmB;MAClCC,OAAO,EAAE;QACLC,EAAE,EAAE;MACR;IACJ,CAAC,CAAC;IAEF,IAAI,CAACL,QAAQ,EAAE;MACXD,MAAM,CAACO,IAAI,CAAE,kDAAiD,CAAC;MAC/D;MACA,OAAO,KAAK;IAChB;IAEA,MAAMC,WAAW,GAAG,MAAM,IAAAN,eAAQ,EAAC;MAC/BC,MAAM,EAAE,IAAI,CAACZ,iBAAiB;MAC9Ba,YAAY,EAAG,oBAAmB;MAClCC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;IACN;EACJ;AACJ;AAACS,OAAA,CAAApC,0CAAA,GAAAA,0CAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","_utils2","_createFileEntity","_createLocaleEntity","_createTenantEntity","isGroupMigrationCompleted","status","FileManager_5_35_0_001_FileData","constructor","table","newFileEntity","createStandardEntity","legacyFileEntity","createLegacyFileEntity","tenantEntity","createTenantEntity","localeEntity","createLocaleEntity","getId","getDescription","shouldExecute","logger","defaultLocale","queryOne","entity","partitionKey","options","eq","info","PK","code","lastLegacyFile","gt","reverse","lastNewFile","id","execute","context","tenants","queryAll","index","migrationStatus","checkpoint","tenant","locales","locale","groupId","batch","ddbQueryAllWithCallback","files","length","items","map","file","putBatch","SK","GSI1_PK","GSI1_SK","TYPE","data","getFileData","webinyVersion","process","env","WEBINY_VERSION","batchWriteAll","executeWithRetry","onFailedAttempt","error","attemptNumber","message","cursor","runningOutOfTime","createCheckpointAndExit","createCheckpoint","exports"],"sources":["FileDataMigration.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { DataMigration, DataMigrationContext } from \"@webiny/data-migration\";\nimport { PrimitiveValue } from \"@webiny/api-elasticsearch/types\";\nimport { executeWithRetry } from \"@webiny/utils\";\nimport {\n createStandardEntity,\n queryOne,\n queryAll,\n ddbQueryAllWithCallback,\n batchWriteAll\n} from \"~/utils\";\nimport {\n createFileEntity,\n getFileData,\n createLegacyFileEntity\n} from \"../entities/createFileEntity\";\nimport { createLocaleEntity } from \"../entities/createLocaleEntity\";\nimport { createTenantEntity } from \"../entities/createTenantEntity\";\n\nexport type FileMigrationCheckpoint = Record<string, string | boolean | undefined>;\n\nconst isGroupMigrationCompleted = (\n status: PrimitiveValue[] | boolean | undefined\n): status is boolean => {\n return typeof status === \"boolean\";\n};\n\nexport class FileManager_5_35_0_001_FileData implements DataMigration<FileMigrationCheckpoint> {\n private readonly newFileEntity: ReturnType<typeof createFileEntity>;\n private readonly legacyFileEntity: ReturnType<typeof createLegacyFileEntity>;\n private readonly tenantEntity: ReturnType<typeof createTenantEntity>;\n private readonly localeEntity: ReturnType<typeof createLocaleEntity>;\n\n constructor(table: Table<string, string, string>) {\n this.newFileEntity = createStandardEntity(table, \"File\");\n this.legacyFileEntity = createLegacyFileEntity(table);\n this.tenantEntity = createTenantEntity(table);\n this.localeEntity = createLocaleEntity(table);\n }\n\n getId() {\n return \"FileData\";\n }\n\n getDescription() {\n return \"\";\n }\n\n async shouldExecute({ logger }: DataMigrationContext): Promise<boolean> {\n const defaultLocale = await queryOne<{ code: string }>({\n entity: this.localeEntity,\n partitionKey: `T#root#I18N#L#D`,\n options: {\n eq: \"default\"\n }\n });\n\n if (!defaultLocale) {\n logger.info(`Default locale not found; system is not yet installed.`);\n // The system is not yet installed, skip migration.\n return false;\n }\n\n // Check if there are file records using the old record structure\n const PK = `T#root#L#${defaultLocale.code}#FM#F`;\n const lastLegacyFile = await queryOne<{ id: string }>({\n entity: this.legacyFileEntity,\n partitionKey: PK,\n options: { gt: \" \", reverse: true }\n });\n\n if (!lastLegacyFile) {\n logger.info(`No applicable files were found to migrate.`);\n return false;\n }\n\n if (lastLegacyFile) {\n // Check if there's a corresponding new file for the same file ID\n const lastNewFile = await queryOne({\n entity: this.newFileEntity,\n partitionKey: `T#root#L#${defaultLocale.code}#FM#FILE#${lastLegacyFile.id}`,\n options: {\n eq: \"A\"\n }\n });\n\n if (lastNewFile) {\n logger.info(`All files seem to be in order.`);\n return false;\n }\n }\n\n return true;\n }\n\n async execute({ logger, ...context }: DataMigrationContext): Promise<void> {\n const tenants = await queryAll<{ id: string }>({\n entity: this.tenantEntity,\n partitionKey: \"TENANTS\",\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n const migrationStatus = context.checkpoint || {};\n\n for (const tenant of tenants) {\n const locales = await queryAll<{ code: string }>({\n entity: this.localeEntity,\n partitionKey: `T#${tenant.id}#I18N#L`,\n options: {\n gt: \" \"\n }\n });\n\n for (const locale of locales) {\n const groupId = `${tenant.id}:${locale.code}`;\n const status = migrationStatus[groupId];\n\n if (isGroupMigrationCompleted(status)) {\n continue;\n }\n\n let batch = 0;\n await ddbQueryAllWithCallback<{ id: string }>(\n {\n entity: this.legacyFileEntity,\n partitionKey: `T#${tenant.id}#L#${locale.code}#FM#F`,\n options: {\n gt: status || \" \"\n }\n },\n async files => {\n batch++;\n logger.info(\n `Processing batch #${batch} in group ${groupId} (${files.length} files).`\n );\n const items = files.map(file => {\n return this.newFileEntity.putBatch({\n PK: `T#${tenant.id}#L#${locale.code}#FM#FILE#${file.id}`,\n SK: \"A\",\n GSI1_PK: `T#${tenant.id}#L#${locale.code}#FM#FILES`,\n GSI1_SK: file.id,\n TYPE: \"fm.file\",\n data: {\n ...getFileData(file),\n webinyVersion: process.env.WEBINY_VERSION\n }\n });\n });\n\n const execute = () => {\n return batchWriteAll({ table: this.newFileEntity.table, items });\n };\n\n await executeWithRetry(execute, {\n onFailedAttempt: error => {\n logger.error(\n `\"batchWriteAll\" attempt #${error.attemptNumber} failed.`\n );\n logger.error(error.message);\n }\n });\n\n const cursor = files[files.length - 1].id;\n\n // Update checkpoint after every batch\n migrationStatus[groupId] = cursor;\n\n // Check if we should store checkpoint and exit.\n if (context.runningOutOfTime()) {\n await context.createCheckpointAndExit(migrationStatus);\n } else {\n await context.createCheckpoint(migrationStatus);\n }\n }\n );\n\n migrationStatus[groupId] = true;\n await context.createCheckpoint(migrationStatus);\n }\n }\n }\n}\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAOA,IAAAE,iBAAA,GAAAF,OAAA;AAKA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AAIA,MAAMK,yBAAyB,GAC3BC,MAA8C,IAC1B;EACpB,OAAO,OAAOA,MAAM,KAAK,SAAS;AACtC,CAAC;AAEM,MAAMC,+BAA+B,CAAmD;EAM3FC,WAAWA,C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GtB,KAAK,CAACA,KAAK,CAACC,MAAM,GAAG,CAAC,CAAC,CAACf,EAAE;;UAEzC;UACAM,eAAe,CAACK,OAAO,CAAC,GAAGyB,MAAM;;UAEjC;UACA,IAAIlC,OAAO,CAACmC,gBAAgB,CAAC,CAAC,EAAE;YAC5B,MAAMnC,OAAO,CAACoC,uBAAuB,CAAChC,eAAe,CAAC;UAC1D,CAAC,MAAM;YACH,MAAMJ,OAAO,CAACqC,gBAAgB,CAACjC,eAAe,CAAC;UACnD;QACJ,CACJ,CAAC;QAEDA,eAAe,CAACK,OAAO,CAAC,GAAG,IAAI;QAC/B,MAAMT,OAAO,CAACqC,gBAAgB,CAACjC,eAAe,CAAC;MACnD;IACJ;EACJ;AACJ;AAACkC,OAAA,CAAApE,+BAAA,GAAAA,+BAAA"}
1
+ {"version":3,"names":["_utils","require","_utils2","_createFileEntity","_createLocaleEntity","_createTenantEntity","isGroupMigrationCompleted","status","FileManager_5_35_0_001_FileData","constructor","table","newFileEntity","createStandardEntity","legacyFileEntity","createLegacyFileEntity","tenantEntity","createTenantEntity","localeEntity","createLocaleEntity","getId","getDescription","shouldExecute","logger","defaultLocale","queryOne","entity","partitionKey","options","eq","info","PK","code","lastLegacyFile","gt","reverse","lastNewFile","id","execute","context","tenants","queryAll","index","migrationStatus","checkpoint","tenant","locales","locale","groupId","batch","ddbQueryAllWithCallback","files","length","items","map","file","putBatch","SK","GSI1_PK","GSI1_SK","TYPE","data","getFileData","webinyVersion","process","env","WEBINY_VERSION","batchWriteAll","executeWithRetry","onFailedAttempt","error","attemptNumber","message","cursor","runningOutOfTime","createCheckpointAndExit","createCheckpoint","exports"],"sources":["FileDataMigration.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { DataMigration, DataMigrationContext } from \"@webiny/data-migration\";\nimport { PrimitiveValue } from \"@webiny/api-elasticsearch/types\";\nimport { executeWithRetry } from \"@webiny/utils\";\nimport {\n createStandardEntity,\n queryOne,\n queryAll,\n ddbQueryAllWithCallback,\n batchWriteAll\n} from \"~/utils\";\nimport {\n createFileEntity,\n getFileData,\n createLegacyFileEntity\n} from \"../entities/createFileEntity\";\nimport { createLocaleEntity } from \"../entities/createLocaleEntity\";\nimport { createTenantEntity } from \"../entities/createTenantEntity\";\n\nexport type FileMigrationCheckpoint = Record<string, string | boolean | undefined>;\n\nconst isGroupMigrationCompleted = (\n status: PrimitiveValue[] | boolean | undefined\n): status is boolean => {\n return typeof status === \"boolean\";\n};\n\nexport class FileManager_5_35_0_001_FileData implements DataMigration<FileMigrationCheckpoint> {\n private readonly newFileEntity: ReturnType<typeof createFileEntity>;\n private readonly legacyFileEntity: ReturnType<typeof createLegacyFileEntity>;\n private readonly tenantEntity: ReturnType<typeof createTenantEntity>;\n private readonly localeEntity: ReturnType<typeof createLocaleEntity>;\n\n constructor(table: Table<string, string, string>) {\n this.newFileEntity = createStandardEntity(table, \"File\");\n this.legacyFileEntity = createLegacyFileEntity(table);\n this.tenantEntity = createTenantEntity(table);\n this.localeEntity = createLocaleEntity(table);\n }\n\n getId() {\n return \"FileData\";\n }\n\n getDescription() {\n return \"\";\n }\n\n async shouldExecute({ logger }: DataMigrationContext): Promise<boolean> {\n const defaultLocale = await queryOne<{ code: string }>({\n entity: this.localeEntity,\n partitionKey: `T#root#I18N#L#D`,\n options: {\n eq: \"default\"\n }\n });\n\n if (!defaultLocale) {\n logger.info(`Default locale not found; system is not yet installed.`);\n // The system is not yet installed, skip migration.\n return false;\n }\n\n // Check if there are file records using the old record structure\n const PK = `T#root#L#${defaultLocale.code}#FM#F`;\n const lastLegacyFile = await queryOne<{ id: string }>({\n entity: this.legacyFileEntity,\n partitionKey: PK,\n options: { gt: \" \", reverse: true }\n });\n\n if (!lastLegacyFile) {\n logger.info(`No applicable files were found to migrate.`);\n return false;\n }\n\n if (lastLegacyFile) {\n // Check if there's a corresponding new file for the same file ID\n const lastNewFile = await queryOne({\n entity: this.newFileEntity,\n partitionKey: `T#root#L#${defaultLocale.code}#FM#FILE#${lastLegacyFile.id}`,\n options: {\n eq: \"A\"\n }\n });\n\n if (lastNewFile) {\n logger.info(`All files seem to be in order.`);\n return false;\n }\n }\n\n return true;\n }\n\n async execute({ logger, ...context }: DataMigrationContext): Promise<void> {\n const tenants = await queryAll<{ id: string }>({\n entity: this.tenantEntity,\n partitionKey: \"TENANTS\",\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n const migrationStatus = context.checkpoint || {};\n\n for (const tenant of tenants) {\n const locales = await queryAll<{ code: string }>({\n entity: this.localeEntity,\n partitionKey: `T#${tenant.id}#I18N#L`,\n options: {\n gt: \" \"\n }\n });\n\n for (const locale of locales) {\n const groupId = `${tenant.id}:${locale.code}`;\n const status = migrationStatus[groupId];\n\n if (isGroupMigrationCompleted(status)) {\n continue;\n }\n\n let batch = 0;\n await ddbQueryAllWithCallback<{ id: string }>(\n {\n entity: this.legacyFileEntity,\n partitionKey: `T#${tenant.id}#L#${locale.code}#FM#F`,\n options: {\n gt: status || \" \"\n }\n },\n async files => {\n batch++;\n logger.info(\n `Processing batch #${batch} in group ${groupId} (${files.length} files).`\n );\n const items = files.map(file => {\n return this.newFileEntity.putBatch({\n PK: `T#${tenant.id}#L#${locale.code}#FM#FILE#${file.id}`,\n SK: \"A\",\n GSI1_PK: `T#${tenant.id}#L#${locale.code}#FM#FILES`,\n GSI1_SK: file.id,\n TYPE: \"fm.file\",\n data: {\n ...getFileData(file),\n webinyVersion: process.env.WEBINY_VERSION\n }\n });\n });\n\n const execute = () => {\n return batchWriteAll({ table: this.newFileEntity.table, items });\n };\n\n await executeWithRetry(execute, {\n onFailedAttempt: error => {\n logger.error(\n `\"batchWriteAll\" attempt #${error.attemptNumber} failed.`\n );\n logger.error(error.message);\n }\n });\n\n const cursor = files[files.length - 1].id;\n\n // Update checkpoint after every batch\n migrationStatus[groupId] = cursor;\n\n // Check if we should store checkpoint and exit.\n if (context.runningOutOfTime()) {\n await context.createCheckpointAndExit(migrationStatus);\n } else {\n await context.createCheckpoint(migrationStatus);\n }\n }\n );\n\n migrationStatus[groupId] = true;\n await context.createCheckpoint(migrationStatus);\n }\n }\n }\n}\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAOA,IAAAE,iBAAA,GAAAF,OAAA;AAKA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AAIA,MAAMK,yBAAyB,GAC3BC,MAA8C,IAC1B;EACpB,OAAO,OAAOA,MAAM,KAAK,SAAS;AACtC,CAAC;AAEM,MAAMC,+BAA+B,CAAmD;EAM3FC,WAAWA,CAACC,KAAoC,EAAE;IAC9C,IAAI,CAACC,aAAa,GAAG,IAAAC,4BAAoB,EAACF,KAAK,EAAE,MAAM,CAAC;IACxD,IAAI,CAACG,gBAAgB,GAAG,IAAAC,wCAAsB,EAACJ,KAAK,CAAC;IACrD,IAAI,CAACK,YAAY,GAAG,IAAAC,sCAAkB,EAACN,KAAK,CAAC;IAC7C,IAAI,CAACO,YAAY,GAAG,IAAAC,sCAAkB,EAACR,KAAK,CAAC;EACjD;EAEAS,KAAKA,CAAA,EAAG;IACJ,OAAO,UAAU;EACrB;EAEAC,cAAcA,CAAA,EAAG;IACb,OAAO,EAAE;EACb;EAEA,MAAMC,aAAaA,CAAC;IAAEC;EAA6B,CAAC,EAAoB;IACpE,MAAMC,aAAa,GAAG,MAAM,IAAAC,gBAAQ,EAAmB;MACnDC,MAAM,EAAE,IAAI,CAACR,YAAY;MACzBS,YAAY,EAAG,iBAAgB;MAC/BC,OAAO,EAAE;QACLC,EAAE,EAAE;MACR;IACJ,CAAC,CAAC;IAEF,IAAI,CAACL,aAAa,EAAE;MAChBD,MAAM,CAACO,IAAI,CAAE,wDAAuD,CAAC;MACrE;MACA,OAAO,KAAK;IAChB;;IAEA;IACA,MAAMC,EAAE,GAAI,YAAWP,aAAa,CAACQ,IAAK,OAAM;IAChD,MAAMC,cAA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MAAM5B,OAAO,GAAGA,CAAA,KAAM;YAClB,OAAO,IAAA6B,qBAAa,EAAC;cAAExD,KAAK,EAAE,IAAI,CAACC,aAAa,CAACD,KAAK;cAAE0C;YAAM,CAAC,CAAC;UACpE,CAAC;UAED,MAAM,IAAAe,uBAAgB,EAAC9B,OAAO,EAAE;YAC5B+B,eAAe,EAAEC,KAAK,IAAI;cACtB/C,MAAM,CAAC+C,KAAK,CACP,4BAA2BA,KAAK,CAACC,aAAc,UACpD,CAAC;cACDhD,MAAM,CAAC+C,KAAK,CAACA,KAAK,CAACE,OAAO,CAAC;YAC/B;UACJ,CAAC,CAAC;UAEF,MAAMC,MAAM,GAAGtB,KAAK,CAACA,KAAK,CAACC,MAAM,GAAG,CAAC,CAAC,CAACf,EAAE;;UAEzC;UACAM,eAAe,CAACK,OAAO,CAAC,GAAGyB,MAAM;;UAEjC;UACA,IAAIlC,OAAO,CAACmC,gBAAgB,CAAC,CAAC,EAAE;YAC5B,MAAMnC,OAAO,CAACoC,uBAAuB,CAAChC,eAAe,CAAC;UAC1D,CAAC,MAAM;YACH,MAAMJ,OAAO,CAACqC,gBAAgB,CAACjC,eAAe,CAAC;UACnD;QACJ,CACJ,CAAC;QAEDA,eAAe,CAACK,OAAO,CAAC,GAAG,IAAI;QAC/B,MAAMT,OAAO,CAACqC,gBAAgB,CAACjC,eAAe,CAAC;MACnD;IACJ;EACJ;AACJ;AAACkC,OAAA,CAAApE,+BAAA,GAAAA,+BAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_dataMigration","require","_ioc","_FileDataMigration","_FileSettingsMigration","FileManager_5_35_0_001","constructor","table","migrations","FileManager_5_35_0_001_FileData","FileManager_5_35_0_001_FileManagerSettings","getId","getDescription","shouldExecute","context","migration","childLogger","getChildLogger","logger","childContext","execute","exports","makeInjectable","inject","PrimaryDynamoTableSymbol"],"sources":["index.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport {\n DataMigration,\n DataMigrationContext,\n getChildLogger,\n PrimaryDynamoTableSymbol\n} from \"@webiny/data-migration\";\nimport { makeInjectable, inject } from \"@webiny/ioc\";\nimport { FileManager_5_35_0_001_FileData } from \"./FileDataMigration\";\nimport { FileManager_5_35_0_001_FileManagerSettings } from \"../FileSettingsMigration\";\n\nexport class FileManager_5_35_0_001 implements DataMigration {\n private migrations: DataMigration[];\n\n constructor(table: Table<string, string, string>) {\n this.migrations = [\n new FileManager_5_35_0_001_FileData(table),\n new FileManager_5_35_0_001_FileManagerSettings(table)\n ];\n }\n\n getId(): string {\n return \"5.35.0-001\";\n }\n\n getDescription(): string {\n return \"Upgrade File Manager to use better PKs and `data` envelope.\";\n }\n\n async shouldExecute(context: DataMigrationContext): Promise<boolean> {\n for (const migration of this.migrations) {\n const childLogger = getChildLogger(context.logger, migration);\n const childContext = { ...context, logger: childLogger };\n if (await migration.shouldExecute(childContext)) {\n return true;\n }\n }\n return false;\n }\n\n async execute(context: DataMigrationContext): Promise<void> {\n for (const migration of this.migrations) {\n const childLogger = getChildLogger(context.logger, migration);\n const childContext = { ...context, logger: childLogger };\n if (await migration.shouldExecute(childContext)) {\n await migration.execute(childContext);\n }\n }\n }\n}\n\nmakeInjectable(FileManager_5_35_0_001, [inject(PrimaryDynamoTableSymbol)]);\n"],"mappings":";;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AAMA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AAEO,MAAMI,sBAAsB,CAA0B;EAGzDC,WAAWA,CAACC,KAAoC,EAAE;IAC9C,IAAI,CAACC,UAAU,GAAG,CACd,IAAIC,kDAA+B,CAACF,KAAK,CAAC,EAC1C,IAAIG,iEAA0C,CAACH,KAAK,CAAC,CACxD;EACL;EAEAI,KAAKA,CAAA,EAAW;IACZ,OAAO,YAAY;EACvB;EAEAC,cAAcA,CAAA,EAAW;IACrB,OAAO,6DAA6D;EACxE;EAEA,MAAMC,aAAaA,CAACC,OAA6B,EAAoB;IACjE,KAAK,MAAMC,SAAS,IAAI,IAAI,CAACP,UAAU,EAAE;MACrC,MAAMQ,WAAW,GAAG,IAAAC,6BAAc,EAACH,OAAO,CAACI,MAAM,EAAEH,SAAS,CAAC;MAC7D,MAAMI,YAAY,GAAG;QAAE,GAAGL,OAAO;QAAEI,MAAM,EAAEF;MAAY,CAAC;MACxD,IAAI,MAAMD,SAAS,CAACF,aAAa,CAACM,YAAY,CAAC,EAAE;QAC7C,OAAO,IAAI;MACf;IACJ;IACA,OAAO,KAAK;EAChB;EAEA,MAAMC,OAAOA,CAACN,OAA6B,EAAiB;IACxD,KAAK,MAAMC,SAAS,IAAI,IAAI,CAACP,UAAU,EAAE;MACrC,MAAMQ,WAAW,GAAG,IAAAC,6BAAc,EAACH,OAAO,CAACI,MAAM,EAAEH,SAAS,CAAC;MAC7D,MAAMI,YAAY,GAAG;QAAE,GAAGL,OAAO;QAAEI,MAAM,EAAEF;MAAY,CAAC;MACxD,IAAI,MAAMD,SAAS,CAACF,aAAa,CAACM,YAAY,CAAC,EAAE;QAC7C,MAAMJ,SAAS,CAACK,OAAO,CAACD,YAAY,CAAC;MACzC;IACJ;EACJ;AACJ;AAACE,OAAA,CAAAhB,sBAAA,GAAAA,sBAAA;AAED,IAAAiB,mBAAc,EAACjB,sBAAsB,EAAE,CAAC,IAAAkB,WAAM,EAACC,uCAAwB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"names":["_dataMigration","require","_ioc","_FileDataMigration","_FileSettingsMigration","FileManager_5_35_0_001","constructor","table","migrations","FileManager_5_35_0_001_FileData","FileManager_5_35_0_001_FileManagerSettings","getId","getDescription","shouldExecute","context","migration","childLogger","getChildLogger","logger","childContext","execute","exports","makeInjectable","inject","PrimaryDynamoTableSymbol"],"sources":["index.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport {\n DataMigration,\n DataMigrationContext,\n getChildLogger,\n PrimaryDynamoTableSymbol\n} from \"@webiny/data-migration\";\nimport { makeInjectable, inject } from \"@webiny/ioc\";\nimport { FileManager_5_35_0_001_FileData } from \"./FileDataMigration\";\nimport { FileManager_5_35_0_001_FileManagerSettings } from \"../FileSettingsMigration\";\n\nexport class FileManager_5_35_0_001 implements DataMigration {\n private migrations: DataMigration[];\n\n constructor(table: Table<string, string, string>) {\n this.migrations = [\n new FileManager_5_35_0_001_FileData(table),\n new FileManager_5_35_0_001_FileManagerSettings(table)\n ];\n }\n\n getId(): string {\n return \"5.35.0-001\";\n }\n\n getDescription(): string {\n return \"Upgrade File Manager to use better PKs and `data` envelope.\";\n }\n\n async shouldExecute(context: DataMigrationContext): Promise<boolean> {\n for (const migration of this.migrations) {\n const childLogger = getChildLogger(context.logger, migration);\n const childContext = { ...context, logger: childLogger };\n if (await migration.shouldExecute(childContext)) {\n return true;\n }\n }\n return false;\n }\n\n async execute(context: DataMigrationContext): Promise<void> {\n for (const migration of this.migrations) {\n const childLogger = getChildLogger(context.logger, migration);\n const childContext = { ...context, logger: childLogger };\n if (await migration.shouldExecute(childContext)) {\n await migration.execute(childContext);\n }\n }\n }\n}\n\nmakeInjectable(FileManager_5_35_0_001, [inject(PrimaryDynamoTableSymbol)]);\n"],"mappings":";;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AAMA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AAEO,MAAMI,sBAAsB,CAA0B;EAGzDC,WAAWA,CAACC,KAAoC,EAAE;IAC9C,IAAI,CAACC,UAAU,GAAG,CACd,IAAIC,kDAA+B,CAACF,KAAK,CAAC,EAC1C,IAAIG,iEAA0C,CAACH,KAAK,CAAC,CACxD;EACL;EAEAI,KAAKA,CAAA,EAAW;IACZ,OAAO,YAAY;EACvB;EAEAC,cAAcA,CAAA,EAAW;IACrB,OAAO,6DAA6D;EACxE;EAEA,MAAMC,aAAaA,CAACC,OAA6B,EAAoB;IACjE,KAAK,MAAMC,SAAS,IAAI,IAAI,CAACP,UAAU,EAAE;MACrC,MAAMQ,WAAW,GAAG,IAAAC,6BAAc,EAACH,OAAO,CAACI,MAAM,EAAEH,SAAS,CAAC;MAC7D,MAAMI,YAAY,GAAG;QAAE,GAAGL,OAAO;QAAEI,MAAM,EAAEF;MAAY,CAAC;MACxD,IAAI,MAAMD,SAAS,CAACF,aAAa,CAACM,YAAY,CAAC,EAAE;QAC7C,OAAO,IAAI;MACf;IACJ;IACA,OAAO,KAAK;EAChB;EAEA,MAAMC,OAAOA,CAACN,OAA6B,EAAiB;IACxD,KAAK,MAAMC,SAAS,IAAI,IAAI,CAACP,UAAU,EAAE;MACrC,MAAMQ,WAAW,GAAG,IAAAC,6BAAc,EAACH,OAAO,CAACI,MAAM,EAAEH,SAAS,CAAC;MAC7D,MAAMI,YAAY,GAAG;QAAE,GAAGL,OAAO;QAAEI,MAAM,EAAEF;MAAY,CAAC;MACxD,IAAI,MAAMD,SAAS,CAACF,aAAa,CAACM,YAAY,CAAC,EAAE;QAC7C,MAAMJ,SAAS,CAACK,OAAO,CAACD,YAAY,CAAC;MACzC;IACJ;EACJ;AACJ;AAACE,OAAA,CAAAhB,sBAAA,GAAAA,sBAAA;AAED,IAAAiB,mBAAc,EAACjB,sBAAsB,EAAE,CAAC,IAAAkB,WAAM,EAACC,uCAAwB,CAAC,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_chunk","_interopRequireDefault","require","_utils","_utils2","_createFileEntity","_createLocaleEntity","_createTenantEntity","isGroupMigrationCompleted","status","FileManager_5_35_0_001_FileData","constructor","table","elasticsearchClient","newFileEntity","createStandardEntity","legacyAttributes","tenantEntity","createTenantEntity","localeEntity","createLocaleEntity","getId","getDescription","shouldExecute","logger","checkpoint","defaultLocale","queryOne","entity","partitionKey","options","eq","info","PK","code","newFile","gt","index","execute","context","tenants","queryAll","migrationStatus","tenant","locales","id","locale","groupId","batch","esQueryAllWithCallback","esGetIndexName","type","body","query","bool","filter","term","size","sort","search_after","callback","files","cursor","length","items","map","file","putBatch","SK","GSI1_PK","GSI1_SK","TYPE","getFileData","data","webinyVersion","process","env","WEBINY_VERSION","Promise","all","chunk","fileChunk","batchWriteAll","executeWithRetry","onFailedAttempt","error","attemptNumber","message","runningOutOfTime","createCheckpointAndExit","createCheckpoint","exports"],"sources":["FileDataMigration.ts"],"sourcesContent":["import chunk from \"lodash/chunk\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Client } from \"@elastic/elasticsearch\";\nimport { PrimitiveValue } from \"@webiny/api-elasticsearch/types\";\nimport { executeWithRetry } from \"@webiny/utils\";\nimport { DataMigration, DataMigrationContext } from \"@webiny/data-migration\";\nimport {\n createStandardEntity,\n queryOne,\n queryAll,\n batchWriteAll,\n esQueryAllWithCallback,\n esGetIndexName\n} from \"~/utils\";\nimport { createFileEntity, getFileData, legacyAttributes } from \"../entities/createFileEntity\";\nimport { createLocaleEntity } from \"../entities/createLocaleEntity\";\nimport { createTenantEntity } from \"../entities/createTenantEntity\";\nimport { File } from \"../types\";\n\ntype FileMigrationCheckpoint = Record<string, PrimitiveValue[] | boolean | undefined>;\n\nconst isGroupMigrationCompleted = (\n status: PrimitiveValue[] | boolean | undefined\n): status is boolean => {\n return typeof status === \"boolean\";\n};\n\nexport class FileManager_5_35_0_001_FileData implements DataMigration<FileMigrationCheckpoint> {\n private readonly elasticsearchClient: Client;\n private readonly newFileEntity: ReturnType<typeof createFileEntity>;\n private readonly tenantEntity: ReturnType<typeof createTenantEntity>;\n private readonly localeEntity: ReturnType<typeof createLocaleEntity>;\n\n constructor(table: Table<string, string, string>, elasticsearchClient: Client) {\n this.elasticsearchClient = elasticsearchClient;\n this.newFileEntity = createStandardEntity(table, \"File\", legacyAttributes);\n this.tenantEntity = createTenantEntity(table);\n this.localeEntity = createLocaleEntity(table);\n }\n\n getId() {\n return \"FileData\";\n }\n\n getDescription() {\n return \"\";\n }\n\n async shouldExecute({ logger, checkpoint }: DataMigrationContext): Promise<boolean> {\n if (checkpoint) {\n return true;\n }\n\n const defaultLocale = await queryOne<{ code: string }>({\n entity: this.localeEntity,\n partitionKey: `T#root#I18N#L#D`,\n options: {\n eq: \"default\"\n }\n });\n\n if (!defaultLocale) {\n logger.info(`Default locale not found; system is not yet installed.`);\n // The system is not yet installed, skip migration.\n return false;\n }\n\n // Check if there are files stored in the GSI1 index, which means files are already migrated.\n const PK = `T#root#L#${defaultLocale.code}#FM#FILES`;\n const newFile = await queryOne<{ id: string }>({\n entity: this.newFileEntity,\n partitionKey: PK,\n options: { gt: \" \", index: \"GSI1\" }\n });\n\n if (newFile) {\n logger.info(`Looks like files have already been migrated. Skipping migration.`);\n return false;\n }\n\n return true;\n }\n\n async execute({\n logger,\n ...context\n }: DataMigrationContext<FileMigrationCheckpoint>): Promise<void> {\n const tenants = await queryAll<{ id: string }>({\n entity: this.tenantEntity,\n partitionKey: \"TENANTS\",\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n const migrationStatus: FileMigrationCheckpoint = context.checkpoint || {};\n\n for (const tenant of tenants) {\n const locales = await queryAll<{ code: string }>({\n entity: this.localeEntity,\n partitionKey: `T#${tenant.id}#I18N#L`,\n options: {\n gt: \" \"\n }\n });\n\n for (const locale of locales) {\n const groupId = `${tenant.id}:${locale.code}`;\n const status = migrationStatus[groupId];\n\n if (isGroupMigrationCompleted(status)) {\n continue;\n }\n\n let batch = 0;\n await esQueryAllWithCallback<File>({\n elasticsearchClient: this.elasticsearchClient,\n index: esGetIndexName({\n tenant: tenant.id,\n locale: locale.code,\n type: \"file-manager\"\n }),\n body: {\n query: {\n bool: {\n filter: [\n { term: { \"tenant.keyword\": tenant.id } },\n { term: { \"locale.keyword\": locale.code } }\n ]\n }\n },\n size: 10000,\n sort: [\n {\n \"id.keyword\": \"asc\"\n }\n ],\n search_after: status\n },\n callback: async (files, cursor) => {\n batch++;\n logger.info(\n `Processing batch #${batch} in group ${groupId} (${files.length} files).`\n );\n const items = files.map(file => {\n return this.newFileEntity.putBatch({\n PK: `T#${tenant.id}#L#${locale.code}#FM#F${file.id}`,\n SK: \"A\",\n GSI1_PK: `T#${tenant.id}#L#${locale.code}#FM#FILES`,\n GSI1_SK: file.id,\n TYPE: \"fm.file\",\n ...getFileData(file),\n data: {\n ...getFileData(file),\n webinyVersion: process.env.WEBINY_VERSION\n }\n });\n });\n\n const execute = () => {\n return Promise.all(\n chunk(items, 200).map(fileChunk => {\n return batchWriteAll({\n table: this.newFileEntity.table,\n items: fileChunk\n });\n })\n );\n };\n\n await executeWithRetry(execute, {\n onFailedAttempt: error => {\n logger.error(\n `\"batchWriteAll\" attempt #${error.attemptNumber} failed.`\n );\n logger.error(error.message);\n }\n });\n\n // Update checkpoint after every batch\n migrationStatus[groupId] = cursor;\n\n // Check if we should store checkpoint and exit.\n if (context.runningOutOfTime()) {\n await context.createCheckpointAndExit(migrationStatus);\n } else {\n await context.createCheckpoint(migrationStatus);\n }\n }\n });\n\n migrationStatus[groupId] = true;\n await context.createCheckpoint(migrationStatus);\n }\n }\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAQA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAKA,MAAMM,yBAAyB,GAC3BC,MAA8C,IAC1B;EACpB,OAAO,OAAOA,MAAM,KAAK,SAAS;AACtC,CAAC;AAEM,MAAMC,+BAA+B,CAAmD;EAM3FC,WAAWA,CAACC,KAAoC,EAAEC,mBAA2B,EAAE;IAC3E,IAAI,CAACA,mBAAmB,GAAGA,mBAAmB;IAC9C,IAAI,CAACC,aAAa,GAAG,IAAAC,4BAAoB,EAACH,KAAK,EAAE,MAAM,EAAEI,kCAAgB,CAAC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,CAAC6D,KAAK,CACP,4BAA2BA,KAAK,CAACC,aAAc,UACpD,CAAC;gBACD9D,MAAM,CAAC6D,KAAK,CAACA,KAAK,CAACE,OAAO,CAAC;cAC/B;YACJ,CAAC,CAAC;;YAEF;YACA7C,eAAe,CAACK,OAAO,CAAC,GAAGe,MAAM;;YAEjC;YACA,IAAIvB,OAAO,CAACiD,gBAAgB,CAAC,CAAC,EAAE;cAC5B,MAAMjD,OAAO,CAACkD,uBAAuB,CAAC/C,eAAe,CAAC;YAC1D,CAAC,MAAM;cACH,MAAMH,OAAO,CAACmD,gBAAgB,CAAChD,eAAe,CAAC;YACnD;UACJ;QACJ,CAAC,CAAC;QAEFA,eAAe,CAACK,OAAO,CAAC,GAAG,IAAI;QAC/B,MAAMR,OAAO,CAACmD,gBAAgB,CAAChD,eAAe,CAAC;MACnD;IACJ;EACJ;AACJ;AAACiD,OAAA,CAAAjF,+BAAA,GAAAA,+BAAA"}
1
+ {"version":3,"names":["_chunk","_interopRequireDefault","require","_utils","_utils2","_createFileEntity","_createLocaleEntity","_createTenantEntity","isGroupMigrationCompleted","status","FileManager_5_35_0_001_FileData","constructor","table","elasticsearchClient","newFileEntity","createStandardEntity","legacyAttributes","tenantEntity","createTenantEntity","localeEntity","createLocaleEntity","getId","getDescription","shouldExecute","logger","checkpoint","defaultLocale","queryOne","entity","partitionKey","options","eq","info","PK","code","newFile","gt","index","execute","context","tenants","queryAll","migrationStatus","tenant","locales","id","locale","groupId","batch","esQueryAllWithCallback","esGetIndexName","type","body","query","bool","filter","term","size","sort","search_after","callback","files","cursor","length","items","map","file","putBatch","SK","GSI1_PK","GSI1_SK","TYPE","getFileData","data","webinyVersion","process","env","WEBINY_VERSION","Promise","all","chunk","fileChunk","batchWriteAll","executeWithRetry","onFailedAttempt","error","attemptNumber","message","runningOutOfTime","createCheckpointAndExit","createCheckpoint","exports"],"sources":["FileDataMigration.ts"],"sourcesContent":["import chunk from \"lodash/chunk\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Client } from \"@elastic/elasticsearch\";\nimport { PrimitiveValue } from \"@webiny/api-elasticsearch/types\";\nimport { executeWithRetry } from \"@webiny/utils\";\nimport { DataMigration, DataMigrationContext } from \"@webiny/data-migration\";\nimport {\n createStandardEntity,\n queryOne,\n queryAll,\n batchWriteAll,\n esQueryAllWithCallback,\n esGetIndexName\n} from \"~/utils\";\nimport { createFileEntity, getFileData, legacyAttributes } from \"../entities/createFileEntity\";\nimport { createLocaleEntity } from \"../entities/createLocaleEntity\";\nimport { createTenantEntity } from \"../entities/createTenantEntity\";\nimport { File } from \"../types\";\n\ntype FileMigrationCheckpoint = Record<string, PrimitiveValue[] | boolean | undefined>;\n\nconst isGroupMigrationCompleted = (\n status: PrimitiveValue[] | boolean | undefined\n): status is boolean => {\n return typeof status === \"boolean\";\n};\n\nexport class FileManager_5_35_0_001_FileData implements DataMigration<FileMigrationCheckpoint> {\n private readonly elasticsearchClient: Client;\n private readonly newFileEntity: ReturnType<typeof createFileEntity>;\n private readonly tenantEntity: ReturnType<typeof createTenantEntity>;\n private readonly localeEntity: ReturnType<typeof createLocaleEntity>;\n\n constructor(table: Table<string, string, string>, elasticsearchClient: Client) {\n this.elasticsearchClient = elasticsearchClient;\n this.newFileEntity = createStandardEntity(table, \"File\", legacyAttributes);\n this.tenantEntity = createTenantEntity(table);\n this.localeEntity = createLocaleEntity(table);\n }\n\n getId() {\n return \"FileData\";\n }\n\n getDescription() {\n return \"\";\n }\n\n async shouldExecute({ logger, checkpoint }: DataMigrationContext): Promise<boolean> {\n if (checkpoint) {\n return true;\n }\n\n const defaultLocale = await queryOne<{ code: string }>({\n entity: this.localeEntity,\n partitionKey: `T#root#I18N#L#D`,\n options: {\n eq: \"default\"\n }\n });\n\n if (!defaultLocale) {\n logger.info(`Default locale not found; system is not yet installed.`);\n // The system is not yet installed, skip migration.\n return false;\n }\n\n // Check if there are files stored in the GSI1 index, which means files are already migrated.\n const PK = `T#root#L#${defaultLocale.code}#FM#FILES`;\n const newFile = await queryOne<{ id: string }>({\n entity: this.newFileEntity,\n partitionKey: PK,\n options: { gt: \" \", index: \"GSI1\" }\n });\n\n if (newFile) {\n logger.info(`Looks like files have already been migrated. Skipping migration.`);\n return false;\n }\n\n return true;\n }\n\n async execute({\n logger,\n ...context\n }: DataMigrationContext<FileMigrationCheckpoint>): Promise<void> {\n const tenants = await queryAll<{ id: string }>({\n entity: this.tenantEntity,\n partitionKey: \"TENANTS\",\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n const migrationStatus: FileMigrationCheckpoint = context.checkpoint || {};\n\n for (const tenant of tenants) {\n const locales = await queryAll<{ code: string }>({\n entity: this.localeEntity,\n partitionKey: `T#${tenant.id}#I18N#L`,\n options: {\n gt: \" \"\n }\n });\n\n for (const locale of locales) {\n const groupId = `${tenant.id}:${locale.code}`;\n const status = migrationStatus[groupId];\n\n if (isGroupMigrationCompleted(status)) {\n continue;\n }\n\n let batch = 0;\n await esQueryAllWithCallback<File>({\n elasticsearchClient: this.elasticsearchClient,\n index: esGetIndexName({\n tenant: tenant.id,\n locale: locale.code,\n type: \"file-manager\"\n }),\n body: {\n query: {\n bool: {\n filter: [\n { term: { \"tenant.keyword\": tenant.id } },\n { term: { \"locale.keyword\": locale.code } }\n ]\n }\n },\n size: 10000,\n sort: [\n {\n \"id.keyword\": \"asc\"\n }\n ],\n search_after: status\n },\n callback: async (files, cursor) => {\n batch++;\n logger.info(\n `Processing batch #${batch} in group ${groupId} (${files.length} files).`\n );\n const items = files.map(file => {\n return this.newFileEntity.putBatch({\n PK: `T#${tenant.id}#L#${locale.code}#FM#F${file.id}`,\n SK: \"A\",\n GSI1_PK: `T#${tenant.id}#L#${locale.code}#FM#FILES`,\n GSI1_SK: file.id,\n TYPE: \"fm.file\",\n ...getFileData(file),\n data: {\n ...getFileData(file),\n webinyVersion: process.env.WEBINY_VERSION\n }\n });\n });\n\n const execute = () => {\n return Promise.all(\n chunk(items, 200).map(fileChunk => {\n return batchWriteAll({\n table: this.newFileEntity.table,\n items: fileChunk\n });\n })\n );\n };\n\n await executeWithRetry(execute, {\n onFailedAttempt: error => {\n logger.error(\n `\"batchWriteAll\" attempt #${error.attemptNumber} failed.`\n );\n logger.error(error.message);\n }\n });\n\n // Update checkpoint after every batch\n migrationStatus[groupId] = cursor;\n\n // Check if we should store checkpoint and exit.\n if (context.runningOutOfTime()) {\n await context.createCheckpointAndExit(migrationStatus);\n } else {\n await context.createCheckpoint(migrationStatus);\n }\n }\n });\n\n migrationStatus[groupId] = true;\n await context.createCheckpoint(migrationStatus);\n }\n }\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAQA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAKA,MAAMM,yBAAyB,GAC3BC,MAA8C,IAC1B;EACpB,OAAO,OAAOA,MAAM,KAAK,SAAS;AACtC,CAAC;AAEM,MAAMC,+BAA+B,CAAmD;EAM3FC,WAAWA,CAACC,KAAoC,EAAEC,mBAA2B,EAAE;IAC3E,IAAI,CAACA,mBAAmB,GAAGA,mBAAmB;IAC9C,IAAI,CAACC,aAAa,GAAG,IAAAC,4BAAoB,EAACH,KAAK,EAAE,MAAM,EAAEI,kCAAgB,CAAC;IAC1E,IAAI,CAACC,YAAY,GAAG,IAAAC,sCAAkB,EAACN,KAAK,CAAC;IAC7C,IAAI,CAACO,YAAY,GAAG,IAAAC,sCAAkB,EAACR,KAAK,CAAC;EACjD;EAEAS,KAAKA,CAAA,EAAG;IACJ,OAAO,UAAU;EACrB;EAEAC,cAAcA,CAAA,EAAG;IACb,OAAO,EAAE;EACb;EAEA,MAAMC,aAAaA,CAAC;IAAEC,MAAM;IAAEC;EAAiC,CAAC,EAAoB;IAChF,IAAIA,UAAU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,CAAC,MAAM;cACH,MAAMH,OAAO,CAACmD,gBAAgB,CAAChD,eAAe,CAAC;YACnD;UACJ;QACJ,CAAC,CAAC;QAEFA,eAAe,CAACK,OAAO,CAAC,GAAG,IAAI;QAC/B,MAAMR,OAAO,CAACmD,gBAAgB,CAAChD,eAAe,CAAC;MACnD;IACJ;EACJ;AACJ;AAACiD,OAAA,CAAAjF,+BAAA,GAAAA,+BAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_dataMigration","require","_ioc","_FileDataMigration","_FileSettingsMigration","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","FileManager_5_35_0_001","constructor","table","elasticsearchClient","migrations","FileManager_5_35_0_001_FileData","FileManager_5_35_0_001_FileManagerSettings","getId","getDescription","shouldExecute","context","migration","childLogger","getChildLogger","logger","childContext","execute","makeInjectable","inject","PrimaryDynamoTableSymbol","ElasticsearchClientSymbol"],"sources":["index.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Client } from \"@elastic/elasticsearch\";\nimport {\n DataMigration,\n DataMigrationContext,\n ElasticsearchClientSymbol,\n getChildLogger,\n PrimaryDynamoTableSymbol\n} from \"@webiny/data-migration\";\nimport { makeInjectable, inject } from \"@webiny/ioc\";\nimport { FileManager_5_35_0_001_FileData } from \"./FileDataMigration\";\nimport { FileManager_5_35_0_001_FileManagerSettings } from \"../FileSettingsMigration\";\nexport * from \"../types\";\n\nexport class FileManager_5_35_0_001 implements DataMigration {\n private migrations: DataMigration[];\n\n constructor(table: Table<string, string, string>, elasticsearchClient: Client) {\n this.migrations = [\n new FileManager_5_35_0_001_FileData(table, elasticsearchClient),\n new FileManager_5_35_0_001_FileManagerSettings(table)\n ];\n }\n\n getId(): string {\n return \"5.35.0-001\";\n }\n\n getDescription(): string {\n return \"Upgrade File Manager to use better PKs and `data` envelope.\";\n }\n\n async shouldExecute(context: DataMigrationContext): Promise<boolean> {\n for (const migration of this.migrations) {\n const childLogger = getChildLogger(context.logger, migration);\n const childContext = { ...context, logger: childLogger };\n if (await migration.shouldExecute(childContext)) {\n return true;\n }\n }\n return false;\n }\n\n async execute(context: DataMigrationContext): Promise<void> {\n for (const migration of this.migrations) {\n const childLogger = getChildLogger(context.logger, migration);\n const childContext = { ...context, logger: childLogger };\n if (await migration.shouldExecute(childContext)) {\n await migration.execute(childContext);\n }\n }\n }\n}\n\nmakeInjectable(FileManager_5_35_0_001, [\n inject(PrimaryDynamoTableSymbol),\n inject(ElasticsearchClientSymbol)\n]);\n"],"mappings":";;;;;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAOA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAAAK,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAEO,MAAMS,sBAAsB,CAA0B;EAGzDC,WAAWA,CAACC,KAAoC,EAAEC,mBAA2B,EAAE;IAC3E,IAAI,CAACC,UAAU,GAAG,CACd,IAAIC,kDAA+B,CAACH,KAAK,EAAEC,mBAAmB,CAAC,EAC/D,IAAIG,iEAA0C,CAACJ,KAAK,CAAC,CACxD;EACL;EAEAK,KAAKA,CAAA,EAAW;IACZ,OAAO,YAAY;EACvB;EAEAC,cAAcA,CAAA,EAAW;IACrB,OAAO,6DAA6D;EACxE;EAEA,MAAMC,aAAaA,CAACC,OAA6B,EAAoB;IACjE,KAAK,MAAMC,SAAS,IAAI,IAAI,CAACP,UAAU,EAAE;MACrC,MAAMQ,WAAW,GAAG,IAAAC,6BAAc,EAACH,OAAO,CAACI,MAAM,EAAEH,SAAS,CAAC;MAC7D,MAAMI,YAAY,GAAG;QAAE,GAAGL,OAAO;QAAEI,MAAM,EAAEF;MAAY,CAAC;MACxD,IAAI,MAAMD,SAAS,CAACF,aAAa,CAACM,YAAY,CAAC,EAAE;QAC7C,OAAO,IAAI;MACf;IACJ;IACA,OAAO,KAAK;EAChB;EAEA,MAAMC,OAAOA,CAACN,OAA6B,EAAiB;IACxD,KAAK,MAAMC,SAAS,IAAI,IAAI,CAACP,UAAU,EAAE;MACrC,MAAMQ,WAAW,GAAG,IAAAC,6BAAc,EAACH,OAAO,CAACI,MAAM,EAAEH,SAAS,CAAC;MAC7D,MAAMI,YAAY,GAAG;QAAE,GAAGL,OAAO;QAAEI,MAAM,EAAEF;MAAY,CAAC;MACxD,IAAI,MAAMD,SAAS,CAACF,aAAa,CAACM,YAAY,CAAC,EAAE;QAC7C,MAAMJ,SAAS,CAACK,OAAO,CAACD,YAAY,CAAC;MACzC;IACJ;EACJ;AACJ;AAACnB,OAAA,CAAAI,sBAAA,GAAAA,sBAAA;AAED,IAAAiB,mBAAc,EAACjB,sBAAsB,EAAE,CACnC,IAAAkB,WAAM,EAACC,uCAAwB,CAAC,EAChC,IAAAD,WAAM,EAACE,wCAAyB,CAAC,CACpC,CAAC"}
1
+ {"version":3,"names":["_dataMigration","require","_ioc","_FileDataMigration","_FileSettingsMigration","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","FileManager_5_35_0_001","constructor","table","elasticsearchClient","migrations","FileManager_5_35_0_001_FileData","FileManager_5_35_0_001_FileManagerSettings","getId","getDescription","shouldExecute","context","migration","childLogger","getChildLogger","logger","childContext","execute","makeInjectable","inject","PrimaryDynamoTableSymbol","ElasticsearchClientSymbol"],"sources":["index.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Client } from \"@elastic/elasticsearch\";\nimport {\n DataMigration,\n DataMigrationContext,\n ElasticsearchClientSymbol,\n getChildLogger,\n PrimaryDynamoTableSymbol\n} from \"@webiny/data-migration\";\nimport { makeInjectable, inject } from \"@webiny/ioc\";\nimport { FileManager_5_35_0_001_FileData } from \"./FileDataMigration\";\nimport { FileManager_5_35_0_001_FileManagerSettings } from \"../FileSettingsMigration\";\nexport * from \"../types\";\n\nexport class FileManager_5_35_0_001 implements DataMigration {\n private migrations: DataMigration[];\n\n constructor(table: Table<string, string, string>, elasticsearchClient: Client) {\n this.migrations = [\n new FileManager_5_35_0_001_FileData(table, elasticsearchClient),\n new FileManager_5_35_0_001_FileManagerSettings(table)\n ];\n }\n\n getId(): string {\n return \"5.35.0-001\";\n }\n\n getDescription(): string {\n return \"Upgrade File Manager to use better PKs and `data` envelope.\";\n }\n\n async shouldExecute(context: DataMigrationContext): Promise<boolean> {\n for (const migration of this.migrations) {\n const childLogger = getChildLogger(context.logger, migration);\n const childContext = { ...context, logger: childLogger };\n if (await migration.shouldExecute(childContext)) {\n return true;\n }\n }\n return false;\n }\n\n async execute(context: DataMigrationContext): Promise<void> {\n for (const migration of this.migrations) {\n const childLogger = getChildLogger(context.logger, migration);\n const childContext = { ...context, logger: childLogger };\n if (await migration.shouldExecute(childContext)) {\n await migration.execute(childContext);\n }\n }\n }\n}\n\nmakeInjectable(FileManager_5_35_0_001, [\n inject(PrimaryDynamoTableSymbol),\n inject(ElasticsearchClientSymbol)\n]);\n"],"mappings":";;;;;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAOA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OA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GAAG,IAAAC,6BAAc,EAACH,OAAO,CAACI,MAAM,EAAEH,SAAS,CAAC;MAC7D,MAAMI,YAAY,GAAG;QAAE,GAAGL,OAAO;QAAEI,MAAM,EAAEF;MAAY,CAAC;MACxD,IAAI,MAAMD,SAAS,CAACF,aAAa,CAACM,YAAY,CAAC,EAAE;QAC7C,MAAMJ,SAAS,CAACK,OAAO,CAACD,YAAY,CAAC;MACzC;IACJ;EACJ;AACJ;AAACnB,OAAA,CAAAI,sBAAA,GAAAA,sBAAA;AAED,IAAAiB,mBAAc,EAACjB,sBAAsB,EAAE,CACnC,IAAAkB,WAAM,EAACC,uCAAwB,CAAC,EAChC,IAAAD,WAAM,EAACE,wCAAyB,CAAC,CACpC,CAAC","ignoreList":[]}
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.legacyAttributes = exports.getFileData = exports.createLegacyFileEntity = exports.createFileEntity = void 0;
8
8
  var _pick = _interopRequireDefault(require("lodash/pick"));
9
9
  var _utils = require("../../../../utils");
10
- const legacyAttributes = {
10
+ const legacyAttributes = exports.legacyAttributes = {
11
11
  id: {
12
12
  type: "string"
13
13
  },
@@ -45,7 +45,6 @@ const legacyAttributes = {
45
45
  type: "string"
46
46
  }
47
47
  };
48
- exports.legacyAttributes = legacyAttributes;
49
48
  const getFileData = file => {
50
49
  return (0, _pick.default)(file, Object.keys(legacyAttributes));
51
50
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_pick","_interopRequireDefault","require","_utils","legacyAttributes","id","type","key","size","name","meta","tags","createdOn","createdBy","tenant","locale","webinyVersion","exports","getFileData","file","pick","Object","keys","createLegacyFileEntity","table","createLegacyEntity","createFileEntity","createStandardEntity"],"sources":["createFileEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport pick from \"lodash/pick\";\nimport { createLegacyEntity, createStandardEntity } from \"~/utils\";\n\nexport const legacyAttributes: Parameters<typeof createLegacyEntity>[2] = {\n id: {\n type: \"string\"\n },\n key: {\n type: \"string\"\n },\n size: {\n type: \"number\"\n },\n type: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n meta: {\n type: \"map\"\n },\n tags: {\n type: \"list\"\n },\n createdOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n }\n};\n\nexport const getFileData = (file: any) => {\n return pick(file, Object.keys(legacyAttributes));\n};\n\nexport const createLegacyFileEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"Files\", legacyAttributes);\n};\n\nexport const createFileEntity = (table: Table<string, string, string>) => {\n return createStandardEntity(table, \"FM.File\");\n};\n"],"mappings":";;;;;;;AACA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEO,MAAME,gBAA0D,GAAG;EACtEC,EAAE,EAAE;IACAC,IAAI,EAAE;EACV,CAAC;EACDC,GAAG,EAAE;IACDD,IAAI,EAAE;EACV,CAAC;EACDE,IAAI,EAAE;IACFF,IAAI,EAAE;EACV,CAAC;EACDA,IAAI,EAAE;IACFA,IAAI,EAAE;EACV,CAAC;EACDG,IAAI,EAAE;IACFH,IAAI,EAAE;EACV,CAAC;EACDI,IAAI,EAAE;IACFJ,IAAI,EAAE;EACV,CAAC;EACDK,IAAI,EAAE;IACFL,IAAI,EAAE;EACV,CAAC;EACDM,SAAS,EAAE;IACPN,IAAI,EAAE;EACV,CAAC;EACDO,SAAS,EAAE;IACPP,IAAI,EAAE;EACV,CAAC;EACDQ,MAAM,EAAE;IACJR,IAAI,EAAE;EACV,CAAC;EACDS,MAAM,EAAE;IACJT,IAAI,EAAE;EACV,CAAC;EACDU,aAAa,EAAE;IACXV,IAAI,EAAE;EACV;AACJ,CAAC;AAACW,OAAA,CAAAb,gBAAA,GAAAA,gBAAA;AAEK,MAAMc,WAAW,GAAIC,IAAS,IAAK;EACtC,OAAO,IAAAC,aAAI,EAACD,IAAI,EAAEE,MAAM,CAACC,IAAI,CAAClB,gBAAgB,CAAC,CAAC;AACpD,CAAC;AAACa,OAAA,CAAAC,WAAA,GAAAA,WAAA;AAEK,MAAMK,sBAAsB,GAAIC,KAAoC,IAAK;EAC5E,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,OAAO,EAAEpB,gBAAgB,CAAC;AAC/D,CAAC;AAACa,OAAA,CAAAM,sBAAA,GAAAA,sBAAA;AAEK,MAAMG,gBAAgB,GAAIF,KAAoC,IAAK;EACtE,OAAO,IAAAG,2BAAoB,EAACH,KAAK,EAAE,SAAS,CAAC;AACjD,CAAC;AAACP,OAAA,CAAAS,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["_pick","_interopRequireDefault","require","_utils","legacyAttributes","exports","id","type","key","size","name","meta","tags","createdOn","createdBy","tenant","locale","webinyVersion","getFileData","file","pick","Object","keys","createLegacyFileEntity","table","createLegacyEntity","createFileEntity","createStandardEntity"],"sources":["createFileEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport pick from \"lodash/pick\";\nimport { createLegacyEntity, createStandardEntity } from \"~/utils\";\n\nexport const legacyAttributes: Parameters<typeof createLegacyEntity>[2] = {\n id: {\n type: \"string\"\n },\n key: {\n type: \"string\"\n },\n size: {\n type: \"number\"\n },\n type: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n meta: {\n type: \"map\"\n },\n tags: {\n type: \"list\"\n },\n createdOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n }\n};\n\nexport const getFileData = (file: any) => {\n return pick(file, Object.keys(legacyAttributes));\n};\n\nexport const createLegacyFileEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"Files\", legacyAttributes);\n};\n\nexport const createFileEntity = (table: Table<string, string, string>) => {\n return createStand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BAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","createLocaleEntity","table","createLegacyEntity","createdOn","type","createdBy","code","default","webinyVersion","tenant","exports"],"sources":["createLocaleEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity } from \"~/utils\";\n\nexport const createLocaleEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"I18NLocale\", {\n createdOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n code: {\n type: \"string\"\n },\n default: {\n type: \"boolean\"\n },\n webinyVersion: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n }\n });\n};\n\n// [\n// {\n// PK: \"T#root#I18N#L\",\n// SK: \"en-US\",\n// code: \"en-US\",\n// createdBy: {\n// displayName: \"Pavel Denisjuk\",\n// id: \"e6ea2871-ba36-4494-87ac-afb73d4e7eb2\",\n// type: \"admin\"\n// },\n// createdOn: \"2023-01-25T09:38:22.029Z\",\n// default: true,\n// tenant: \"root\",\n// webinyVersion: \"0.0.0\",\n// _ct: \"2023-01-25T09:38:22.041Z\",\n// _et: \"I18NLocale\",\n// _md: \"2023-01-25T09:38:22.041Z\"\n// }\n// ];\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,kBAAkB,GAAIC,KAAoC,IAAK;EACxE,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,YAAY,EAAE;IAC3CE,SAAS,EAAE;MACPC,IAAI,EAAE;IACV,CAAC;IACDC,SAAS,EAAE;MACPD,IAAI,EAAE;IACV,CAAC;IACDE,IAAI,EAAE;MACFF,IAAI,EAAE;IACV,CAAC;IACDG,OAAO,EAAE;MACLH,IAAI,EAAE;IACV,CAAC;IACDI,aAAa,EAAE;MACXJ,IAAI,EAAE;IACV,CAAC;IACDK,MAAM,EAAE;MACJL,IAAI,EAAE;IACV;EACJ,CAAC,CAAC;AACN,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAAM,OAAA,CAAAV,kBAAA,GAAAA,kBAAA"}
1
+ {"version":3,"names":["_utils","require","createLocaleEntity","table","createLegacyEntity","createdOn","type","createdBy","code","default","webinyVersion","tenant","exports"],"sources":["createLocaleEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity } from \"~/utils\";\n\nexport const createLocaleEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"I18NLocale\", {\n createdOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n code: {\n type: \"string\"\n },\n default: {\n type: \"boolean\"\n },\n webinyVersion: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n }\n });\n};\n\n// [\n// {\n// PK: \"T#root#I18N#L\",\n// SK: \"en-US\",\n// code: \"en-US\",\n// createdBy: {\n// displayName: \"Pavel Denisjuk\",\n// id: \"e6ea2871-ba36-4494-87ac-afb73d4e7eb2\",\n// type: \"admin\"\n// },\n// createdOn: \"2023-01-25T09:38:22.029Z\",\n// default: true,\n// tenant: \"root\",\n// webinyVersion: \"0.0.0\",\n// _ct: \"2023-01-25T09:38:22.041Z\",\n// _et: \"I18NLocale\",\n// _md: \"2023-01-25T09:38:22.041Z\"\n// }\n// ];\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,kBAAkB,GAAIC,KAAoC,IAAK;EACxE,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,YAAY,EAAE;IAC3CE,SAAS,EAAE;MACPC,IAAI,EAAE;IACV,CAAC;IACDC,SAAS,EAAE;MACPD,IAAI,EAAE;IACV,CAAC;IACDE,IAAI,EAAE;MACFF,IAAI,EAAE;IACV,CAAC;IACDG,OAAO,EAAE;MACLH,IAAI,EAAE;IACV,CAAC;IACDI,aAAa,EAAE;MACXJ,IAAI,EAAE;IACV,CAAC;IACDK,MAAM,EAAE;MACJL,IAAI,EAAE;IACV;EACJ,CAAC,CAAC;AACN,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAAM,OAAA,CAAAV,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_pick","_interopRequireDefault","require","_utils","attributes","tenant","type","srcPrefix","uploadMaxFileSize","uploadMinFileSize","getSettingsData","settings","pick","Object","keys","exports","createLegacySettingsEntity","table","createLegacyEntity","createSettingsEntity","createStandardEntity"],"sources":["createSettingsEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport pick from \"lodash/pick\";\nimport { createLegacyEntity, createStandardEntity } from \"~/utils\";\n\nconst attributes: Parameters<typeof createLegacyEntity>[2] = {\n tenant: {\n type: \"string\"\n },\n srcPrefix: {\n type: \"string\"\n },\n uploadMaxFileSize: {\n type: \"number\"\n },\n uploadMinFileSize: {\n type: \"number\"\n }\n};\n\nexport const getSettingsData = (settings: any) => {\n return pick(settings, Object.keys(attributes));\n};\n\nexport const createLegacySettingsEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"Settings\", attributes);\n};\n\nexport const createSettingsEntity = (table: Table<string, string, string>) => {\n return createStandardEntity(table, \"FM.Settings\");\n};\n"],"mappings":";;;;;;;AACA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,MAAME,UAAoD,GAAG;EACzDC,MAAM,EAAE;IACJC,IAAI,EAAE;EACV,CAAC;EACDC,SAAS,EAAE;IACPD,IAAI,EAAE;EACV,CAAC;EACDE,iBAAiB,EAAE;IACfF,IAAI,EAAE;EACV,CAAC;EACDG,iBAAiB,EAAE;IACfH,IAAI,EAAE;EACV;AACJ,CAAC;AAEM,MAAMI,eAAe,GAAIC,QAAa,IAAK;EAC9C,OAAO,IAAAC,aAAI,EAACD,QAAQ,EAAEE,MAAM,CAACC,IAAI,CAACV,UAAU,CAAC,CAAC;AAClD,CAAC;AAACW,OAAA,CAAAL,eAAA,GAAAA,eAAA;AAEK,MAAMM,0BAA0B,GAAIC,KAAoC,IAAK;EAChF,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,UAAU,EAAEb,UAAU,CAAC;AAC5D,CAAC;AAACW,OAAA,CAAAC,0BAAA,GAAAA,0BAAA;AAEK,MAAMG,oBAAoB,GAAIF,KAAoC,IAAK;EAC1E,OAAO,IAAAG,2BAAoB,EAACH,KAAK,EAAE,aAAa,CAAC;AACrD,CAAC;AAACF,OAAA,CAAAI,oBAAA,GAAAA,oBAAA"}
1
+ {"version":3,"names":["_pick","_interopRequireDefault","require","_utils","attributes","tenant","type","srcPrefix","uploadMaxFileSize","uploadMinFileSize","getSettingsData","settings","pick","Object","keys","exports","createLegacySettingsEntity","table","createLegacyEntity","createSettingsEntity","createStandardEntity"],"sources":["createSettingsEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport pick from \"lodash/pick\";\nimport { createLegacyEntity, createStandardEntity } from \"~/utils\";\n\nconst attributes: Parameters<typeof createLegacyEntity>[2] = {\n tenant: {\n type: \"string\"\n },\n srcPrefix: {\n type: \"string\"\n },\n uploadMaxFileSize: {\n type: \"number\"\n },\n uploadMinFileSize: {\n type: \"number\"\n }\n};\n\nexport const getSettingsData = (settings: any) => {\n return pick(settings, Object.keys(attributes));\n};\n\nexport const createLegacySettingsEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"Settings\", attributes);\n};\n\nexport const createSettingsEntity = (table: Table<string, string, string>) => {\n return createStandardEntity(table, \"FM.Settings\");\n};\n"],"mappings":";;;;;;;AACA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,MAAME,UAAoD,GAAG;EACzDC,MAAM,EAAE;IACJC,IAAI,EAAE;EACV,CAAC;EACDC,SAAS,EAAE;IACPD,IAAI,EAAE;EACV,CAAC;EACDE,iBAAiB,EAAE;IACfF,IAAI,EAAE;EACV,CAAC;EACDG,iBAAiB,EAAE;IACfH,IAAI,EAAE;EACV;AACJ,CAAC;AAEM,MAAMI,eAAe,GAAIC,QAAa,IAAK;EAC9C,OAAO,IAAAC,aAAI,EAACD,QAAQ,EAAEE,MAAM,CAACC,IAAI,CAACV,UAAU,CAAC,CAAC;AAClD,CAAC;AAACW,OAAA,CAAAL,eAAA,GAAAA,eAAA;AAEK,MAAMM,0BAA0B,GAAIC,KAAoC,IAAK;EAChF,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,UAAU,EAAEb,UAAU,CAAC;AAC5D,CAAC;AAACW,OAAA,CAAAC,0BAAA,GAAAA,0BAAA;AAEK,MAAMG,oBAAoB,GAAIF,KAAoC,IAAK;EAC1E,OAAO,IAAAG,2BAAoB,EAACH,KAAK,EAAE,aAAa,CAAC;AACrD,CAAC;AAACF,OAAA,CAAAI,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","createTenantEntity","table","createLegacyEntity","id","type","name","description","status","default","createdOn","savedOn","createdBy","parent","webinyVersion","settings","exports"],"sources":["createTenantEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity } from \"~/utils\";\n\nexport const createTenantEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"TenancyTenant\", {\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n status: {\n type: \"string\",\n default: \"active\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n parent: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n settings: {\n type: \"map\",\n default: {}\n }\n });\n};\n\n// [\n// {\n// PK: \"T#root\",\n// SK: \"A\",\n// createdOn: \"2023-01-25T09:37:58.183Z\",\n// description: \"The top-level Webiny tenant.\",\n// GSI1_PK: \"TENANTS\",\n// GSI1_SK: \"T#null#2023-01-25T09:37:58.183Z\",\n// id: \"root\",\n// name: \"Root\",\n// savedOn: \"2023-01-25T09:37:58.183Z\",\n// settings: {\n// domains: []\n// },\n// status: \"active\",\n// TYPE: \"tenancy.tenant\",\n// webinyVersion: \"0.0.0\",\n// _ct: \"2023-01-25T09:37:58.220Z\",\n// _et: \"TenancyTenant\",\n// _md: \"2023-01-25T09:37:58.220Z\"\n// }\n// ];\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,kBAAkB,GAAIC,KAAoC,IAAK;EACxE,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,eAAe,EAAE;IAC9CE,EAAE,EAAE;MACAC,IAAI,EAAE;IACV,CAAC;IACDC,IAAI,EAAE;MACFD,IAAI,EAAE;IACV,CAAC;IACDE,WAAW,EAAE;MACTF,IAAI,EAAE;IACV,CAAC;IACDG,MAAM,EAAE;MACJH,IAAI,EAAE,QAAQ;MACdI,OAAO,EAAE;IACb,CAAC;IACDC,SAAS,EAAE;MACPL,IAAI,EAAE;IACV,CAAC;IACDM,OAAO,EAAE;MACLN,IAAI,EAAE;IACV,CAAC;IACDO,SAAS,EAAE;MACPP,IAAI,EAAE;IACV,CAAC;IACDQ,MAAM,EAAE;MACJR,IAAI,EAAE;IACV,CAAC;IACDS,aAAa,EAAE;MACXT,IAAI,EAAE;IACV,CAAC;IACDU,QAAQ,EAAE;MACNV,IAAI,EAAE,KAAK;MACXI,OAAO,EAAE,CAAC;IACd;EACJ,CAAC,CAAC;AACN,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAAO,OAAA,CAAAf,kBAAA,GAAAA,kBAAA"}
1
+ {"version":3,"names":["_utils","require","createTenantEntity","table","createLegacyEntity","id","type","name","description","status","default","createdOn","savedOn","createdBy","parent","webinyVersion","settings","exports"],"sources":["createTenantEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity } from \"~/utils\";\n\nexport const createTenantEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"TenancyTenant\", {\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n status: {\n type: \"string\",\n default: \"active\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n parent: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n settings: {\n type: \"map\",\n default: {}\n }\n });\n};\n\n// [\n// {\n// PK: \"T#root\",\n// SK: \"A\",\n// createdOn: \"2023-01-25T09:37:58.183Z\",\n// description: \"The top-level Webiny tenant.\",\n// GSI1_PK: \"TENANTS\",\n// GSI1_SK: \"T#null#2023-01-25T09:37:58.183Z\",\n// id: \"root\",\n// name: \"Root\",\n// savedOn: \"2023-01-25T09:37:58.183Z\",\n// settings: {\n// domains: []\n// },\n// status: \"active\",\n// TYPE: \"tenancy.tenant\",\n// webinyVersion: \"0.0.0\",\n// _ct: \"2023-01-25T09:37:58.220Z\",\n// _et: \"TenancyTenant\",\n// _md: \"2023-01-25T09:37:58.220Z\"\n// }\n// ];\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,kBAAkB,GAAIC,KAAoC,IAAK;EACxE,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,eAAe,EAAE;IAC9CE,EAAE,EAAE;MACAC,IAAI,EAAE;IACV,CAAC;IACDC,IAAI,EAAE;MACFD,IAAI,EAAE;IACV,CAAC;IACDE,WAAW,EAAE;MACTF,IAAI,EAAE;IACV,CAAC;IACDG,MAAM,EAAE;MACJH,IAAI,EAAE,QAAQ;MACdI,OAAO,EAAE;IACb,CAAC;IACDC,SAAS,EAAE;MACPL,IAAI,EAAE;IACV,CAAC;IACDM,OAAO,EAAE;MACLN,IAAI,EAAE;IACV,CAAC;IACDO,SAAS,EAAE;MACPP,IAAI,EAAE;IACV,CAAC;IACDQ,MAAM,EAAE;MACJR,IAAI,EAAE;IACV,CAAC;IACDS,aAAa,EAAE;MACXT,IAAI,EAAE;IACV,CAAC;IACDU,QAAQ,EAAE;MACNV,IAAI,EAAE,KAAK;MACXI,OAAO,EAAE,CAAC;IACd;EACJ,CAAC,CAAC;AACN,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAAO,OAAA,CAAAf,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface File {\n id: string;\n key: string;\n size: number;\n type: string;\n name: string;\n meta: Record<string, any>;\n tags: string[];\n createdOn: string;\n createdBy: CreatedBy;\n tenant: string;\n locale: string;\n webinyVersion: string;\n}\n\nexport interface CreatedBy {\n id: string;\n displayName: string | null;\n type: string;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface File {\n id: string;\n key: string;\n size: number;\n type: string;\n name: string;\n meta: Record<string, any>;\n tags: string[];\n createdOn: string;\n createdBy: CreatedBy;\n tenant: string;\n locale: string;\n webinyVersion: string;\n}\n\nexport interface CreatedBy {\n id: string;\n displayName: string | null;\n type: string;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","createLocaleEntity","table","createLegacyEntity","createdOn","type","createdBy","code","default","webinyVersion","tenant","exports"],"sources":["createLocaleEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity } from \"~/utils\";\n\nexport const createLocaleEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"I18NLocale\", {\n createdOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n code: {\n type: \"string\"\n },\n default: {\n type: \"boolean\"\n },\n webinyVersion: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,kBAAkB,GAAIC,KAAoC,IAAK;EACxE,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,YAAY,EAAE;IAC3CE,SAAS,EAAE;MACPC,IAAI,EAAE;IACV,CAAC;IACDC,SAAS,EAAE;MACPD,IAAI,EAAE;IACV,CAAC;IACDE,IAAI,EAAE;MACFF,IAAI,EAAE;IACV,CAAC;IACDG,OAAO,EAAE;MACLH,IAAI,EAAE;IACV,CAAC;IACDI,aAAa,EAAE;MACXJ,IAAI,EAAE;IACV,CAAC;IACDK,MAAM,EAAE;MACJL,IAAI,EAAE;IACV;EACJ,CAAC,CAAC;AACN,CAAC;AAACM,OAAA,CAAAV,kBAAA,GAAAA,kBAAA"}
1
+ {"version":3,"names":["_utils","require","createLocaleEntity","table","createLegacyEntity","createdOn","type","createdBy","code","default","webinyVersion","tenant","exports"],"sources":["createLocaleEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity } from \"~/utils\";\n\nexport const createLocaleEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"I18NLocale\", {\n createdOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n code: {\n type: \"string\"\n },\n default: {\n type: \"boolean\"\n },\n webinyVersion: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,kBAAkB,GAAIC,KAAoC,IAAK;EACxE,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,YAAY,EAAE;IAC3CE,SAAS,EAAE;MACPC,IAAI,EAAE;IACV,CAAC;IACDC,SAAS,EAAE;MACPD,IAAI,EAAE;IACV,CAAC;IACDE,IAAI,EAAE;MACFF,IAAI,EAAE;IACV,CAAC;IACDG,OAAO,EAAE;MACLH,IAAI,EAAE;IACV,CAAC;IACDI,aAAa,EAAE;MACXJ,IAAI,EAAE;IACV,CAAC;IACDK,MAAM,EAAE;MACJL,IAAI,EAAE;IACV;EACJ,CAAC,CAAC;AACN,CAAC;AAACM,OAAA,CAAAV,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_pick","_interopRequireDefault","require","_utils","attributes","name","type","websiteUrl","websitePreviewUrl","favicon","logo","prerendering","social","htmlTags","pages","tenant","locale","theme","getSettingsData","settings","pick","Object","keys","exports","createLegacySettingsEntity","table","createLegacyEntity","createSettingsEntity","createStandardEntity"],"sources":["createSettingsEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport pick from \"lodash/pick\";\nimport { createLegacyEntity, createStandardEntity } from \"~/utils\";\n\nconst attributes: Parameters<typeof createLegacyEntity>[2] = {\n name: {\n type: \"string\"\n },\n websiteUrl: {\n type: \"string\"\n },\n websitePreviewUrl: {\n type: \"string\"\n },\n favicon: {\n type: \"map\"\n },\n logo: {\n type: \"map\"\n },\n prerendering: {\n type: \"map\"\n },\n social: {\n type: \"map\"\n },\n htmlTags: {\n type: \"map\"\n },\n pages: {\n type: \"map\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n theme: {\n type: \"string\"\n }\n};\n\nexport const getSettingsData = (settings: any) => {\n return pick(settings, Object.keys(attributes));\n};\n\nexport const createLegacySettingsEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"PbSettings\", attributes);\n};\n\nexport const createSettingsEntity = (table: Table<string, string, string>) => {\n return createStandardEntity(table, \"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["_pick","_interopRequireDefault","require","_utils","attributes","name","type","websiteUrl","websitePreviewUrl","favicon","logo","prerendering","social","htmlTags","pages","tenant","locale","theme","getSettingsData","settings","pick","Object","keys","exports","createLegacySettingsEntity","table","createLegacyEntity","createSettingsEntity","createStandardEntity"],"sources":["createSettingsEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport pick from \"lodash/pick\";\nimport { createLegacyEntity, createStandardEntity } from \"~/utils\";\n\nconst attributes: Parameters<typeof createLegacyEntity>[2] = {\n name: {\n type: \"string\"\n },\n websiteUrl: {\n type: \"string\"\n },\n websitePreviewUrl: {\n type: \"string\"\n },\n favicon: {\n type: \"map\"\n },\n logo: {\n type: \"map\"\n },\n prerendering: {\n type: \"map\"\n },\n social: {\n type: \"map\"\n },\n htmlTags: {\n type: \"map\"\n },\n pages: {\n type: \"map\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n theme: {\n type: \"string\"\n }\n};\n\nexport const getSettingsData = (settings: any) => {\n return pick(settings, Object.keys(attributes));\n};\n\nexport const createLegacySettingsEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"PbSettings\", attributes);\n};\n\nexport const createSettingsEntity = (table: Table<string, string, string>) => {\n return createStandardEntity(table, \"PB.Settings\");\n};\n"],"mappings":";;;;;;;AACA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,MAAME,UAAoD,GAAG;EACzDC,IAAI,EAAE;IACFC,IAAI,EAAE;EACV,CAAC;EACDC,UAAU,EAAE;IACRD,IAAI,EAAE;EACV,CAAC;EACDE,iBAAiB,EAAE;IACfF,IAAI,EAAE;EACV,CAAC;EACDG,OAAO,EAAE;IACLH,IAAI,EAAE;EACV,CAAC;EACDI,IAAI,EAAE;IACFJ,IAAI,EAAE;EACV,CAAC;EACDK,YAAY,EAAE;IACVL,IAAI,EAAE;EACV,CAAC;EACDM,MAAM,EAAE;IACJN,IAAI,EAAE;EACV,CAAC;EACDO,QAAQ,EAAE;IACNP,IAAI,EAAE;EACV,CAAC;EACDQ,KAAK,EAAE;IACHR,IAAI,EAAE;EACV,CAAC;EACDS,MAAM,EAAE;IACJT,IAAI,EAAE;EACV,CAAC;EACDU,MAAM,EAAE;IACJV,IAAI,EAAE;EACV,CAAC;EACDW,KAAK,EAAE;IACHX,IAAI,EAAE;EACV;AACJ,CAAC;AAEM,MAAMY,eAAe,GAAIC,QAAa,IAAK;EAC9C,OAAO,IAAAC,aAAI,EAACD,QAAQ,EAAEE,MAAM,CAACC,IAAI,CAAClB,UAAU,CAAC,CAAC;AAClD,CAAC;AAACmB,OAAA,CAAAL,eAAA,GAAAA,eAAA;AAEK,MAAMM,0BAA0B,GAAIC,KAAoC,IAAK;EAChF,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,YAAY,EAAErB,UAAU,CAAC;AAC9D,CAAC;AAACmB,OAAA,CAAAC,0BAAA,GAAAA,0BAAA;AAEK,MAAMG,oBAAoB,GAAIF,KAAoC,IAAK;EAC1E,OAAO,IAAAG,2BAAoB,EAACH,KAAK,EAAE,aAAa,CAAC;AACrD,CAAC;AAACF,OAAA,CAAAI,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","createTenantEntity","table","createLegacyEntity","id","type","name","description","status","default","createdOn","savedOn","createdBy","parent","webinyVersion","settings","exports"],"sources":["createTenantEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity } from \"~/utils\";\n\nexport const createTenantEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"TenancyTenant\", {\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n status: {\n type: \"string\",\n default: \"active\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n parent: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n settings: {\n type: \"map\",\n default: {}\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,kBAAkB,GAAIC,KAAoC,IAAK;EACxE,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,eAAe,EAAE;IAC9CE,EAAE,EAAE;MACAC,IAAI,EAAE;IACV,CAAC;IACDC,IAAI,EAAE;MACFD,IAAI,EAAE;IACV,CAAC;IACDE,WAAW,EAAE;MACTF,IAAI,EAAE;IACV,CAAC;IACDG,MAAM,EAAE;MACJH,IAAI,EAAE,QAAQ;MACdI,OAAO,EAAE;IACb,CAAC;IACDC,SAAS,EAAE;MACPL,IAAI,EAAE;IACV,CAAC;IACDM,OAAO,EAAE;MACLN,IAAI,EAAE;IACV,CAAC;IACDO,SAAS,EAAE;MACPP,IAAI,EAAE;IACV,CAAC;IACDQ,MAAM,EAAE;MACJR,IAAI,EAAE;IACV,CAAC;IACDS,aAAa,EAAE;MACXT,IAAI,EAAE;IACV,CAAC;IACDU,QAAQ,EAAE;MACNV,IAAI,EAAE,KAAK;MACXI,OAAO,EAAE,CAAC;IACd;EACJ,CAAC,CAAC;AACN,CAAC;AAACO,OAAA,CAAAf,kBAAA,GAAAA,kBAAA"}
1
+ {"version":3,"names":["_utils","require","createTenantEntity","table","createLegacyEntity","id","type","name","description","status","default","createdOn","savedOn","createdBy","parent","webinyVersion","settings","exports"],"sources":["createTenantEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity } from \"~/utils\";\n\nexport const createTenantEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"TenancyTenant\", {\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n status: {\n type: \"string\",\n default: \"active\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n parent: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n settings: {\n type: \"map\",\n default: {}\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,kBAAkB,GAAIC,KAAoC,IAAK;EACxE,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,eAAe,EAAE;IAC9CE,EAAE,EAAE;MACAC,IAAI,EAAE;IACV,CAAC;IACDC,IAAI,EAAE;MACFD,IAAI,EAAE;IACV,CAAC;IACDE,WAAW,EAAE;MACTF,IAAI,EAAE;IACV,CAAC;IACDG,MAAM,EAAE;MACJH,IAAI,EAAE,QAAQ;MACdI,OAAO,EAAE;IACb,CAAC;IACDC,SAAS,EAAE;MACPL,IAAI,EAAE;IACV,CAAC;IACDM,OAAO,EAAE;MACLN,IAAI,EAAE;IACV,CAAC;IACDO,SAAS,EAAE;MACPP,IAAI,EAAE;IACV,CAAC;IACDQ,MAAM,EAAE;MACJR,IAAI,EAAE;IACV,CAAC;IACDS,aAAa,EAAE;MACXT,IAAI,EAAE;IACV,CAAC;IACDU,QAAQ,EAAE;MACNV,IAAI,EAAE,KAAK;MACXI,OAAO,EAAE,CAAC;IACd;EACJ,CAAC,CAAC;AACN,CAAC;AAACO,OAAA,CAAAf,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_dataMigration","require","_utils","_createTenantEntity","_createSettingsEntity","_createLocaleEntity","_ioc","_dbDynamodb","PageBuilder_5_35_0_002","constructor","table","newSettingsEntity","createSettingsEntity","legacySettingsEntity","createLegacySettingsEntity","tenantEntity","createTenantEntity","localeEntity","createLocaleEntity","getId","getDescription","shouldExecute","logger","defaultLocale","queryOne","entity","partitionKey","options","eq","info","settings","code","newSettings","execute","tenants","queryAll","index","gt","tenant","locales","id","locale","name","put","item","PK","SK","TYPE","data","getSettingsData","exports","makeInjectable","inject","PrimaryDynamoTableSymbol"],"sources":["index.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { DataMigrationContext, PrimaryDynamoTableSymbol } from \"@webiny/data-migration\";\nimport { queryAll, queryOne } from \"~/utils\";\nimport { createTenantEntity } from \"./createTenantEntity\";\nimport {\n createLegacySettingsEntity,\n createSettingsEntity,\n getSettingsData\n} from \"./createSettingsEntity\";\nimport { createLocaleEntity } from \"./createLocaleEntity\";\nimport { inject, makeInjectable } from \"@webiny/ioc\";\nimport { put } from \"@webiny/db-dynamodb\";\n\nexport class PageBuilder_5_35_0_002 {\n private readonly newSettingsEntity: ReturnType<typeof createSettingsEntity>;\n private readonly legacySettingsEntity: ReturnType<typeof createLegacySettingsEntity>;\n private readonly tenantEntity: ReturnType<typeof createTenantEntity>;\n private readonly localeEntity: ReturnType<typeof createLocaleEntity>;\n\n constructor(table: Table<string, string, string>) {\n this.newSettingsEntity = createSettingsEntity(table);\n this.legacySettingsEntity = createLegacySettingsEntity(table);\n this.tenantEntity = createTenantEntity(table);\n this.localeEntity = createLocaleEntity(table);\n }\n\n getId() {\n return \"5.35.0-002\";\n }\n\n getDescription() {\n return \"Move PB Settings attributes to a `data` envelope.\";\n }\n\n async shouldExecute({ logger }: DataMigrationContext): Promise<boolean> {\n const defaultLocale = await queryOne<{ code: string }>({\n entity: this.localeEntity,\n partitionKey: `T#root#I18N#L#D`,\n options: {\n eq: \"default\"\n }\n });\n\n if (!defaultLocale) {\n logger.info(`Default locale not found; system is not yet installed.`);\n return false;\n }\n\n const settings = await queryOne({\n entity: this.legacySettingsEntity,\n partitionKey: `T#root#L#${defaultLocale.code}#PB#SETTINGS`,\n options: {\n eq: \"default\"\n }\n });\n\n if (!settings) {\n logger.info(`Settings not found; system is not yet installed.`);\n return false;\n }\n\n const newSettings = await queryOne({\n entity: this.newSettingsEntity,\n partitionKey: `T#root#L#${defaultLocale.code}#PB#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 locales = await queryAll<{ code: string }>({\n entity: this.localeEntity,\n partitionKey: `T#${tenant.id}#I18N#L`,\n options: {\n gt: \" \"\n }\n });\n\n for (const locale of locales) {\n const settings = await queryOne({\n entity: this.legacySettingsEntity,\n partitionKey: `T#${tenant.id}#L#${locale.code}#PB#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 PB settings for tenant ${tenant.name} (${tenant.id}).`);\n await put({\n entity: this.newSettingsEntity,\n item: {\n PK: `T#${tenant.id}#L#${locale.code}#PB#SETTINGS`,\n SK: \"A\",\n TYPE: \"pb.settings\",\n data: {\n ...getSettingsData(settings),\n tenant: tenant.id\n }\n }\n });\n }\n }\n }\n}\n\nmakeInjectable(PageBuilder_5_35_0_002, [inject(PrimaryDynamoTableSymbol)]);\n"],"mappings":";;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AAKA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAEO,MAAMO,sBAAsB,CAAC;EAMhCC,WAAWA,CAACC,KAAoC,EAAE;IAC9C,IAAI,CAACC,iBAAiB,GAAG,IAAAC,0CAAoB,EAACF,KAAK,CAAC;IACpD,IAAI,CAACG,oBAAoB,GAAG,IAAAC,gDAA0B,EAACJ,KAA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IAAI,EAAE;cACF,GAAG,IAAAC,qCAAe,EAACnB,QAAQ,CAAC;cAC5BQ,MAAM,EAAEA,MAAM,CAACE;YACnB;UACJ;QACJ,CAAC,CAAC;MACN;IACJ;EACJ;AACJ;AAACU,OAAA,CAAA1C,sBAAA,GAAAA,sBAAA;AAED,IAAA2C,mBAAc,EAAC3C,sBAAsB,EAAE,CAAC,IAAA4C,WAAM,EAACC,uCAAwB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"names":["_dataMigration","require","_utils","_createTenantEntity","_createSettingsEntity","_createLocaleEntity","_ioc","_dbDynamodb","PageBuilder_5_35_0_002","constructor","table","newSettingsEntity","createSettingsEntity","legacySettingsEntity","createLegacySettingsEntity","tenantEntity","createTenantEntity","localeEntity","createLocaleEntity","getId","getDescription","shouldExecute","logger","defaultLocale","queryOne","entity","partitionKey","options","eq","info","settings","code","newSettings","execute","tenants","queryAll","index","gt","tenant","locales","id","locale","name","put","item","PK","SK","TYPE","data","getSettingsData","exports","makeInjectable","inject","PrimaryDynamoTableSymbol"],"sources":["index.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { DataMigrationContext, PrimaryDynamoTableSymbol } from \"@webiny/data-migration\";\nimport { queryAll, queryOne } from \"~/utils\";\nimport { createTenantEntity } from \"./createTenantEntity\";\nimport {\n createLegacySettingsEntity,\n createSettingsEntity,\n getSettingsData\n} from \"./createSettingsEntity\";\nimport { createLocaleEntity } from \"./createLocaleEntity\";\nimport { inject, makeInjectable } from \"@webiny/ioc\";\nimport { put } from \"@webiny/db-dynamodb\";\n\nexport class PageBuilder_5_35_0_002 {\n private readonly newSettingsEntity: ReturnType<typeof createSettingsEntity>;\n private readonly legacySettingsEntity: ReturnType<typeof createLegacySettingsEntity>;\n private readonly tenantEntity: ReturnType<typeof createTenantEntity>;\n private readonly localeEntity: ReturnType<typeof createLocaleEntity>;\n\n constructor(table: Table<string, string, string>) {\n this.newSettingsEntity = createSettingsEntity(table);\n this.legacySettingsEntity = createLegacySettingsEntity(table);\n this.tenantEntity = createTenantEntity(table);\n this.localeEntity = createLocaleEntity(table);\n }\n\n getId() {\n return \"5.35.0-002\";\n }\n\n getDescription() {\n return \"Move PB Settings attributes to a `data` envelope.\";\n }\n\n async shouldExecute({ logger }: DataMigrationContext): Promise<boolean> {\n const defaultLocale = await queryOne<{ code: string }>({\n entity: this.localeEntity,\n partitionKey: `T#root#I18N#L#D`,\n options: {\n eq: \"default\"\n }\n });\n\n if (!defaultLocale) {\n logger.info(`Default locale not found; system is not yet installed.`);\n return false;\n }\n\n const settings = await queryOne({\n entity: this.legacySettingsEntity,\n partitionKey: `T#root#L#${defaultLocale.code}#PB#SETTINGS`,\n options: {\n eq: \"default\"\n }\n });\n\n if (!settings) {\n logger.info(`Settings not found; system is not yet installed.`);\n return false;\n }\n\n const newSettings = await queryOne({\n entity: this.newSettingsEntity,\n partitionKey: `T#root#L#${defaultLocale.code}#PB#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 locales = await queryAll<{ code: string }>({\n entity: this.localeEntity,\n partitionKey: `T#${tenant.id}#I18N#L`,\n options: {\n gt: \" \"\n }\n });\n\n for (const locale of locales) {\n const settings = await queryOne({\n entity: this.legacySettingsEntity,\n partitionKey: `T#${tenant.id}#L#${locale.code}#PB#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 PB settings for tenant ${tenant.name} (${tenant.id}).`);\n await put({\n entity: this.newSettingsEntity,\n item: {\n PK: `T#${tenant.id}#L#${locale.code}#PB#SETTINGS`,\n SK: \"A\",\n TYPE: \"pb.settings\",\n data: {\n ...getSettingsData(settings),\n tenant: tenant.id\n }\n }\n });\n }\n }\n }\n}\n\nmakeInjectable(PageBuilder_5_35_0_002, [inject(PrimaryDynamoTableSymbol)]);\n"],"mappings":";;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AAKA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAEO,MAAMO,sBAAsB,CAAC;EAMhCC,WAAWA,CAACC,KAAoC,EAAE;IAC9C,IAAI,CAACC,iBAAiB,GAAG,IAAAC,0CAAoB,EAACF,KAAK,CAAC;IACpD,IAAI,CAACG,oBAAoB,GAAG,IAAAC,gDAA0B,EAACJ,KAAK,CAAC;IAC7D,IAAI,CAACK,YAAY,GAAG,IAAAC,sCAAkB,EAACN,KAAK,CAAC;IAC7C,IAAI,CAACO,YAAY,GAAG,IAAAC,sCAAkB,EAACR,KAAK,CAAC;EACjD;EAEAS,KAAKA,CAAA,EAAG;IACJ,OAAO,YAAY;EACvB;EAEAC,cAAcA,CAAA,EAAG;IACb,OAAO,mDAAmD;EAC9D;EAEA,MAAMC,aAAaA,CAAC;IAAEC;EAA6B,CAAC,EAAoB;IACpE,MAAMC,aAAa,GAAG,MAAM,IAAAC,eAAQ,EAAmB;MACnDC,MAAM,EAAE,IAAI,CAACR,YAAY;MACzBS,YAAY,EAAG,iBAAgB;MAC/BC,OAAO,EAAE;QACLC,EAAE,EAAE;MACR;IACJ,CAAC,CAAC;IAEF,IAAI,CAACL,aAAa,EAAE;MAChBD,MAAM,CAACO,IAAI,CAAE,wDAAuD,CAAC;MACrE,OAAO,KAAK;IAChB;IAE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AC;UAC5BC,MAAM,EAAE,IAAI,CAACZ,oBAAoB;UACjCa,YAAY,EAAG,KAAIY,MAAM,CAACE,EAAG,MAAKC,MAAM,CAACV,IAAK,cAAa;UAC3DJ,OAAO,EAAE;YACLC,EAAE,EAAE;UACR;QACJ,CAAC,CAAC;QAEF,IAAI,CAACE,QAAQ,EAAE;UACX;UACAR,MAAM,CAACO,IAAI,CACN,UAASS,MAAM,CAACI,IAAK,KAAIJ,MAAM,CAACE,EAAG,qDACxC,CAAC;UACD;QACJ;QAEAlB,MAAM,CAACO,IAAI,CAAE,mCAAkCS,MAAM,CAACI,IAAK,KAAIJ,MAAM,CAACE,EAAG,IAAG,CAAC;QAC7E,MAAM,IAAAG,eAAG,EAAC;UACNlB,MAAM,EAAE,IAAI,CAACd,iBAAiB;UAC9BiC,IAAI,EAAE;YACFC,EAAE,EAAG,KAAIP,MAAM,CAACE,EAAG,MAAKC,MAAM,CAACV,IAAK,cAAa;YACjDe,EAAE,EAAE,GAAG;YACPC,IAAI,EAAE,aAAa;YACnBC,IAAI,EAAE;cACF,GAAG,IAAAC,qCAAe,EAACnB,QAAQ,CAAC;cAC5BQ,MAAM,EAAEA,MAAM,CAACE;YACnB;UACJ;QACJ,CAAC,CAAC;MACN;IACJ;EACJ;AACJ;AAACU,OAAA,CAAA1C,sBAAA,GAAAA,sBAAA;AAED,IAAA2C,mBAAc,EAAC3C,sBAAsB,EAAE,CAAC,IAAA4C,WAAM,EAACC,uCAAwB,CAAC,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","createTenantEntity","table","createLegacyEntity","id","type","name","description","status","default","createdOn","savedOn","createdBy","parent","webinyVersion","settings","exports"],"sources":["createTenantEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity } from \"~/utils\";\n\nexport const createTenantEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"TenancyTenant\", {\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n status: {\n type: \"string\",\n default: \"active\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n parent: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n settings: {\n type: \"map\",\n default: {}\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,kBAAkB,GAAIC,KAAoC,IAAK;EACxE,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,eAAe,EAAE;IAC9CE,EAAE,EAAE;MACAC,IAAI,EAAE;IACV,CAAC;IACDC,IAAI,EAAE;MACFD,IAAI,EAAE;IACV,CAAC;IACDE,WAAW,EAAE;MACTF,IAAI,EAAE;IACV,CAAC;IACDG,MAAM,EAAE;MACJH,IAAI,EAAE,QAAQ;MACdI,OAAO,EAAE;IACb,CAAC;IACDC,SAAS,EAAE;MACPL,IAAI,EAAE;IACV,CAAC;IACDM,OAAO,EAAE;MACLN,IAAI,EAAE;IACV,CAAC;IACDO,SAAS,EAAE;MACPP,IAAI,EAAE;IACV,CAAC;IACDQ,MAAM,EAAE;MACJR,IAAI,EAAE;IACV,CAAC;IACDS,aAAa,EAAE;MACXT,IAAI,EAAE;IACV,CAAC;IACDU,QAAQ,EAAE;MACNV,IAAI,EAAE,KAAK;MACXI,OAAO,EAAE,CAAC;IACd;EACJ,CAAC,CAAC;AACN,CAAC;AAACO,OAAA,CAAAf,kBAAA,GAAAA,kBAAA"}
1
+ {"version":3,"names":["_utils","require","createTenantEntity","table","createLegacyEntity","id","type","name","description","status","default","createdOn","savedOn","createdBy","parent","webinyVersion","settings","exports"],"sources":["createTenantEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity } from \"~/utils\";\n\nexport const createTenantEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"TenancyTenant\", {\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n status: {\n type: \"string\",\n default: \"active\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n parent: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n settings: {\n type: \"map\",\n default: {}\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,kBAAkB,GAAIC,KAAoC,IAAK;EACxE,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,eAAe,EAAE;IAC9CE,EAAE,EAAE;MACAC,IAAI,EAAE;IACV,CAAC;IACDC,IAAI,EAAE;MACFD,IAAI,EAAE;IACV,CAAC;IACDE,WAAW,EAAE;MACTF,IAAI,EAAE;IACV,CAAC;IACDG,MAAM,EAAE;MACJH,IAAI,EAAE,QAAQ;MACdI,OAAO,EAAE;IACb,CAAC;IACDC,SAAS,EAAE;MACPL,IAAI,EAAE;IACV,CAAC;IACDM,OAAO,EAAE;MACLN,IAAI,EAAE;IACV,CAAC;IACDO,SAAS,EAAE;MACPP,IAAI,EAAE;IACV,CAAC;IACDQ,MAAM,EAAE;MACJR,IAAI,EAAE;IACV,CAAC;IACDS,aAAa,EAAE;MACXT,IAAI,EAAE;IACV,CAAC;IACDU,QAAQ,EAAE;MACNV,IAAI,EAAE,KAAK;MACXI,OAAO,EAAE,CAAC;IACd;EACJ,CAAC,CAAC;AACN,CAAC;AAACO,OAAA,CAAAf,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_pick","_interopRequireDefault","require","_utils","attributes","id","type","tenant","email","firstName","lastName","avatar","createdBy","createdOn","group","webinyVersion","getUserData","user","pick","Object","keys","exports","createLegacyUserEntity","table","createLegacyEntity","createUserEntity","createStandardEntity"],"sources":["createUserEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport pick from \"lodash/pick\";\nimport { createLegacyEntity, createStandardEntity } from \"~/utils\";\n\nconst attributes: Parameters<typeof createLegacyEntity>[2] = {\n id: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n email: {\n type: \"string\"\n },\n firstName: {\n type: \"string\"\n },\n lastName: {\n type: \"string\"\n },\n avatar: {\n type: \"map\"\n },\n createdBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n group: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n }\n};\n\nexport const getUserData = (user: any) => {\n return pick(user, Object.keys(attributes));\n};\n\nexport const createLegacyUserEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"AdminUsers.User\", attributes);\n};\n\nexport const createUserEntity = (table: Table<string, string, string>) => {\n return createStandardEntity(table, \"AdminUsers.User\", attributes);\n};\n"],"mappings":";;;;;;;AACA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,MAAME,UAAoD,GAAG;EACzDC,EAAE,EAAE;IACAC,IAAI,EAAE;EACV,CAAC;EACDC,MAAM,EAAE;IACJD,IAAI,EAAE;EACV,CAAC;EACDE,KAAK,EAAE;IACHF,IAAI,EAAE;EACV,CAAC;EACDG,SAAS,EAAE;IACPH,IAAI,EAAE;EACV,CAAC;EACDI,QAAQ,EAAE;IACNJ,IAAI,EAAE;EACV,CAAC;EACDK,MAAM,EAAE;IACJL,IAAI,EAAE;EACV,CAAC;EACDM,SAAS,EAAE;IACPN,IAAI,EAAE;EACV,CAAC;EACDO,SAAS,EAAE;IACPP,IAAI,EAAE;EACV,CAAC;EACDQ,KAAK,EAAE;IACHR,IAAI,EAAE;EACV,CAAC;EACDS,aAAa,EAAE;IACXT,IAAI,EAAE;EACV;AACJ,CAAC;AAEM,MAAMU,WAAW,GAAIC,IAAS,IAAK;EACtC,OAAO,IAAAC,aAAI,EAACD,IAAI,EAAEE,MAAM,CAACC,IAAI,CAAChB,UAAU,CAAC,CAAC;AAC9C,CAAC;AAACiB,OAAA,CAAAL,WAAA,GAAAA,WAAA;AAEK,MAAMM,sBAAsB,GAAIC,KAAoC,IAAK;EAC5E,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,iBAAiB,EAAEnB,UAAU,CAAC;AACnE,CAAC;AAACiB,OAAA,CAAAC,sBAAA,GAAAA,sBAAA;AAEK,MAAMG,gBAAgB,GAAIF,KAAoC,IAAK;EACtE,OAAO,IAAAG,2BAAoB,EAACH,KAAK,EAAE,iBAAiB,EAAEnB,UAAU,CAAC;AACrE,CAAC;AAACiB,OAAA,CAAAI,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["_pick","_interopRequireDefault","require","_utils","attributes","id","type","tenant","email","firstName","lastName","avatar","createdBy","createdOn","group","webinyVersion","getUserData","user","pick","Object","keys","exports","createLegacyUserEntity","table","createLegacyEntity","createUserEntity","createStandardEntity"],"sources":["createUserEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport pick from \"lodash/pick\";\nimport { createLegacyEntity, createStandardEntity } from \"~/utils\";\n\nconst attributes: Parameters<typeof createLegacyEntity>[2] = {\n id: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n email: {\n type: \"string\"\n },\n firstName: {\n type: \"string\"\n },\n lastName: {\n type: \"string\"\n },\n avatar: {\n type: \"map\"\n },\n createdBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n group: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n }\n};\n\nexport const getUserData = (user: any) => {\n return pick(user, Object.keys(attributes));\n};\n\nexport const createLegacyUserEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"AdminUsers.User\", attributes);\n};\n\nexport const createUserEntity = (table: Table<string, string, string>) => {\n return createStandardEntity(table, \"AdminUsers.User\", attributes);\n};\n"],"mappings":";;;;;;;AACA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,MAAME,UAAoD,GAAG;EACzDC,EAAE,EAAE;IACAC,IAAI,EAAE;EACV,CAAC;EACDC,MAAM,EAAE;IACJD,IAAI,EAAE;EACV,CAAC;EACDE,KAAK,EAAE;IACHF,IAAI,EAAE;EACV,CAAC;EACDG,SAAS,EAAE;IACPH,IAAI,EAAE;EACV,CAAC;EACDI,QAAQ,EAAE;IACNJ,IAAI,EAAE;EACV,CAAC;EACDK,MAAM,EAAE;IACJL,IAAI,EAAE;EACV,CAAC;EACDM,SAAS,EAAE;IACPN,IAAI,EAAE;EACV,CAAC;EACDO,SAAS,EAAE;IACPP,IAAI,EAAE;EACV,CAAC;EACDQ,KAAK,EAAE;IACHR,IAAI,EAAE;EACV,CAAC;EACDS,aAAa,EAAE;IACXT,IAAI,EAAE;EACV;AACJ,CAAC;AAEM,MAAMU,WAAW,GAAIC,IAAS,IAAK;EACtC,OAAO,IAAAC,aAAI,EAACD,IAAI,EAAEE,MAAM,CAACC,IAAI,CAAChB,UAAU,CAAC,CAAC;AAC9C,CAAC;AAACiB,OAAA,CAAAL,WAAA,GAAAA,WAAA;AAEK,MAAMM,sBAAsB,GAAIC,KAAoC,IAAK;EAC5E,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,iBAAiB,EAAEnB,UAAU,CAAC;AACnE,CAAC;AAACiB,OAAA,CAAAC,sBAAA,GAAAA,sBAAA;AAEK,MAAMG,gBAAgB,GAAIF,KAAoC,IAAK;EACtE,OAAO,IAAAG,2BAAoB,EAACH,KAAK,EAAE,iBAAiB,EAAEnB,UAAU,CAAC;AACrE,CAAC;AAACiB,OAAA,CAAAI,gBAAA,GAAAA,gBAAA","ignoreList":[]}