@webiny/migrations 5.39.7-beta.2
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.
- package/LICENSE +26 -0
- package/README.md +1 -0
- package/ddb-es.d.ts +18 -0
- package/ddb-es.js +67 -0
- package/ddb-es.js.map +1 -0
- package/ddb.d.ts +18 -0
- package/ddb.js +49 -0
- package/ddb.js.map +1 -0
- package/migrations/5.35.0/001/FileSettingsMigration.d.ts +12 -0
- package/migrations/5.35.0/001/FileSettingsMigration.js +93 -0
- package/migrations/5.35.0/001/FileSettingsMigration.js.map +1 -0
- package/migrations/5.35.0/001/ddb/FileDataMigration.d.ts +14 -0
- package/migrations/5.35.0/001/ddb/FileDataMigration.js +156 -0
- package/migrations/5.35.0/001/ddb/FileDataMigration.js.map +1 -0
- package/migrations/5.35.0/001/ddb/index.d.ts +10 -0
- package/migrations/5.35.0/001/ddb/index.js +50 -0
- package/migrations/5.35.0/001/ddb/index.js.map +1 -0
- package/migrations/5.35.0/001/ddb-es/FileDataMigration.d.ts +17 -0
- package/migrations/5.35.0/001/ddb-es/FileDataMigration.js +172 -0
- package/migrations/5.35.0/001/ddb-es/FileDataMigration.js.map +1 -0
- package/migrations/5.35.0/001/ddb-es/index.d.ts +12 -0
- package/migrations/5.35.0/001/ddb-es/index.js +65 -0
- package/migrations/5.35.0/001/ddb-es/index.js.map +1 -0
- package/migrations/5.35.0/001/entities/createFileEntity.d.ts +92 -0
- package/migrations/5.35.0/001/entities/createFileEntity.js +62 -0
- package/migrations/5.35.0/001/entities/createFileEntity.js.map +1 -0
- package/migrations/5.35.0/001/entities/createLocaleEntity.d.ts +42 -0
- package/migrations/5.35.0/001/entities/createLocaleEntity.js +52 -0
- package/migrations/5.35.0/001/entities/createLocaleEntity.js.map +1 -0
- package/migrations/5.35.0/001/entities/createSettingsEntity.d.ts +90 -0
- package/migrations/5.35.0/001/entities/createSettingsEntity.js +37 -0
- package/migrations/5.35.0/001/entities/createSettingsEntity.js.map +1 -0
- package/migrations/5.35.0/001/entities/createTenantEntity.d.ts +42 -0
- package/migrations/5.35.0/001/entities/createTenantEntity.js +69 -0
- package/migrations/5.35.0/001/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.35.0/001/types.d.ts +19 -0
- package/migrations/5.35.0/001/types.js +7 -0
- package/migrations/5.35.0/001/types.js.map +1 -0
- package/migrations/5.35.0/002/createLocaleEntity.d.ts +42 -0
- package/migrations/5.35.0/002/createLocaleEntity.js +32 -0
- package/migrations/5.35.0/002/createLocaleEntity.js.map +1 -0
- package/migrations/5.35.0/002/createSettingsEntity.d.ts +90 -0
- package/migrations/5.35.0/002/createSettingsEntity.js +61 -0
- package/migrations/5.35.0/002/createSettingsEntity.js.map +1 -0
- package/migrations/5.35.0/002/createTenantEntity.d.ts +42 -0
- package/migrations/5.35.0/002/createTenantEntity.js +46 -0
- package/migrations/5.35.0/002/createTenantEntity.js.map +1 -0
- package/migrations/5.35.0/002/index.d.ts +13 -0
- package/migrations/5.35.0/002/index.js +117 -0
- package/migrations/5.35.0/002/index.js.map +1 -0
- package/migrations/5.35.0/003/createTenantEntity.d.ts +42 -0
- package/migrations/5.35.0/003/createTenantEntity.js +46 -0
- package/migrations/5.35.0/003/createTenantEntity.js.map +1 -0
- package/migrations/5.35.0/003/createUserEntity.d.ts +90 -0
- package/migrations/5.35.0/003/createUserEntity.js +55 -0
- package/migrations/5.35.0/003/createUserEntity.js.map +1 -0
- package/migrations/5.35.0/003/index.d.ts +12 -0
- package/migrations/5.35.0/003/index.js +92 -0
- package/migrations/5.35.0/003/index.js.map +1 -0
- package/migrations/5.35.0/004/createTenantEntity.d.ts +90 -0
- package/migrations/5.35.0/004/createTenantEntity.js +57 -0
- package/migrations/5.35.0/004/createTenantEntity.js.map +1 -0
- package/migrations/5.35.0/004/index.d.ts +11 -0
- package/migrations/5.35.0/004/index.js +80 -0
- package/migrations/5.35.0/004/index.js.map +1 -0
- package/migrations/5.35.0/005/createLocaleEntity.d.ts +42 -0
- package/migrations/5.35.0/005/createLocaleEntity.js +32 -0
- package/migrations/5.35.0/005/createLocaleEntity.js.map +1 -0
- package/migrations/5.35.0/005/createModelEntity.d.ts +42 -0
- package/migrations/5.35.0/005/createModelEntity.js +101 -0
- package/migrations/5.35.0/005/createModelEntity.js.map +1 -0
- package/migrations/5.35.0/005/createTenantEntity.d.ts +48 -0
- package/migrations/5.35.0/005/createTenantEntity.js +13 -0
- package/migrations/5.35.0/005/createTenantEntity.js.map +1 -0
- package/migrations/5.35.0/005/index.d.ts +15 -0
- package/migrations/5.35.0/005/index.js +144 -0
- package/migrations/5.35.0/005/index.js.map +1 -0
- package/migrations/5.35.0/005/types.d.ts +42 -0
- package/migrations/5.35.0/005/types.js +7 -0
- package/migrations/5.35.0/005/types.js.map +1 -0
- package/migrations/5.35.0/006/constants.d.ts +3 -0
- package/migrations/5.35.0/006/constants.js +14 -0
- package/migrations/5.35.0/006/constants.js.map +1 -0
- package/migrations/5.35.0/006/ddb/PageDataMigration.d.ts +17 -0
- package/migrations/5.35.0/006/ddb/PageDataMigration.js +249 -0
- package/migrations/5.35.0/006/ddb/PageDataMigration.js.map +1 -0
- package/migrations/5.35.0/006/ddb/index.d.ts +10 -0
- package/migrations/5.35.0/006/ddb/index.js +49 -0
- package/migrations/5.35.0/006/ddb/index.js.map +1 -0
- package/migrations/5.35.0/006/ddb-es/PageDataMigration.d.ts +22 -0
- package/migrations/5.35.0/006/ddb-es/PageDataMigration.js +413 -0
- package/migrations/5.35.0/006/ddb-es/PageDataMigration.js.map +1 -0
- package/migrations/5.35.0/006/ddb-es/index.d.ts +12 -0
- package/migrations/5.35.0/006/ddb-es/index.js +64 -0
- package/migrations/5.35.0/006/ddb-es/index.js.map +1 -0
- package/migrations/5.35.0/006/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.35.0/006/entities/createEntryEntity.js +106 -0
- package/migrations/5.35.0/006/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.35.0/006/entities/createLocaleEntity.d.ts +42 -0
- package/migrations/5.35.0/006/entities/createLocaleEntity.js +32 -0
- package/migrations/5.35.0/006/entities/createLocaleEntity.js.map +1 -0
- package/migrations/5.35.0/006/entities/createPageEntity.d.ts +89 -0
- package/migrations/5.35.0/006/entities/createPageEntity.js +113 -0
- package/migrations/5.35.0/006/entities/createPageEntity.js.map +1 -0
- package/migrations/5.35.0/006/entities/createTenantEntity.d.ts +48 -0
- package/migrations/5.35.0/006/entities/createTenantEntity.js +13 -0
- package/migrations/5.35.0/006/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.35.0/006/types.d.ts +91 -0
- package/migrations/5.35.0/006/types.js +7 -0
- package/migrations/5.35.0/006/types.js.map +1 -0
- package/migrations/5.35.0/006/utils/getCompressedData.d.ts +4 -0
- package/migrations/5.35.0/006/utils/getCompressedData.js +19 -0
- package/migrations/5.35.0/006/utils/getCompressedData.js.map +1 -0
- package/migrations/5.35.0/006/utils/getLexicalContentText.d.ts +1 -0
- package/migrations/5.35.0/006/utils/getLexicalContentText.js +29 -0
- package/migrations/5.35.0/006/utils/getLexicalContentText.js.map +1 -0
- package/migrations/5.35.0/006/utils/getSearchableContent.d.ts +6 -0
- package/migrations/5.35.0/006/utils/getSearchableContent.js +45 -0
- package/migrations/5.35.0/006/utils/getSearchableContent.js.map +1 -0
- package/migrations/5.35.0/006/utils/processors/button.d.ts +1 -0
- package/migrations/5.35.0/006/utils/processors/button.js +17 -0
- package/migrations/5.35.0/006/utils/processors/button.js.map +1 -0
- package/migrations/5.35.0/006/utils/processors/image.d.ts +1 -0
- package/migrations/5.35.0/006/utils/processors/image.js +17 -0
- package/migrations/5.35.0/006/utils/processors/image.js.map +1 -0
- package/migrations/5.35.0/006/utils/processors/images.d.ts +1 -0
- package/migrations/5.35.0/006/utils/processors/images.js +18 -0
- package/migrations/5.35.0/006/utils/processors/images.js.map +1 -0
- package/migrations/5.35.0/006/utils/processors/index.d.ts +1 -0
- package/migrations/5.35.0/006/utils/processors/index.js +14 -0
- package/migrations/5.35.0/006/utils/processors/index.js.map +1 -0
- package/migrations/5.35.0/006/utils/processors/paragraph.d.ts +1 -0
- package/migrations/5.35.0/006/utils/processors/paragraph.js +25 -0
- package/migrations/5.35.0/006/utils/processors/paragraph.js.map +1 -0
- package/migrations/5.36.0/001/constants.d.ts +3 -0
- package/migrations/5.36.0/001/constants.js +14 -0
- package/migrations/5.36.0/001/constants.js.map +1 -0
- package/migrations/5.36.0/001/ddb/FileDataMigration.d.ts +17 -0
- package/migrations/5.36.0/001/ddb/FileDataMigration.js +241 -0
- package/migrations/5.36.0/001/ddb/FileDataMigration.js.map +1 -0
- package/migrations/5.36.0/001/ddb/index.d.ts +10 -0
- package/migrations/5.36.0/001/ddb/index.js +49 -0
- package/migrations/5.36.0/001/ddb/index.js.map +1 -0
- package/migrations/5.36.0/001/ddb-es/FileDataMigration.d.ts +20 -0
- package/migrations/5.36.0/001/ddb-es/FileDataMigration.js +405 -0
- package/migrations/5.36.0/001/ddb-es/FileDataMigration.js.map +1 -0
- package/migrations/5.36.0/001/ddb-es/index.d.ts +12 -0
- package/migrations/5.36.0/001/ddb-es/index.js +64 -0
- package/migrations/5.36.0/001/ddb-es/index.js.map +1 -0
- package/migrations/5.36.0/001/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.36.0/001/entities/createEntryEntity.js +106 -0
- package/migrations/5.36.0/001/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.36.0/001/entities/createFileEntity.d.ts +95 -0
- package/migrations/5.36.0/001/entities/createFileEntity.js +33 -0
- package/migrations/5.36.0/001/entities/createFileEntity.js.map +1 -0
- package/migrations/5.36.0/001/entities/createLocaleEntity.d.ts +42 -0
- package/migrations/5.36.0/001/entities/createLocaleEntity.js +32 -0
- package/migrations/5.36.0/001/entities/createLocaleEntity.js.map +1 -0
- package/migrations/5.36.0/001/entities/createTenantEntity.d.ts +48 -0
- package/migrations/5.36.0/001/entities/createTenantEntity.js +13 -0
- package/migrations/5.36.0/001/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.36.0/001/types.d.ts +67 -0
- package/migrations/5.36.0/001/types.js +7 -0
- package/migrations/5.36.0/001/types.js.map +1 -0
- package/migrations/5.36.0/001/utils/createMimeTag.d.ts +1 -0
- package/migrations/5.36.0/001/utils/createMimeTag.js +10 -0
- package/migrations/5.36.0/001/utils/createMimeTag.js.map +1 -0
- package/migrations/5.36.0/001/utils/getCompressedData.d.ts +4 -0
- package/migrations/5.36.0/001/utils/getCompressedData.js +19 -0
- package/migrations/5.36.0/001/utils/getCompressedData.js.map +1 -0
- package/migrations/5.37.0/001/TenantLinkDataMigration.d.ts +14 -0
- package/migrations/5.37.0/001/TenantLinkDataMigration.js +106 -0
- package/migrations/5.37.0/001/TenantLinkDataMigration.js.map +1 -0
- package/migrations/5.37.0/001/entities/createTenantEntity.d.ts +48 -0
- package/migrations/5.37.0/001/entities/createTenantEntity.js +13 -0
- package/migrations/5.37.0/001/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.37.0/001/entities/createTenantLinkEntity.d.ts +48 -0
- package/migrations/5.37.0/001/entities/createTenantLinkEntity.js +17 -0
- package/migrations/5.37.0/001/entities/createTenantLinkEntity.js.map +1 -0
- package/migrations/5.37.0/001/index.d.ts +10 -0
- package/migrations/5.37.0/001/index.js +49 -0
- package/migrations/5.37.0/001/index.js.map +1 -0
- package/migrations/5.37.0/001/types.d.ts +25 -0
- package/migrations/5.37.0/001/types.js +7 -0
- package/migrations/5.37.0/001/types.js.map +1 -0
- package/migrations/5.37.0/001/utils/isMigratedTenantLink.d.ts +2 -0
- package/migrations/5.37.0/001/utils/isMigratedTenantLink.js +12 -0
- package/migrations/5.37.0/001/utils/isMigratedTenantLink.js.map +1 -0
- package/migrations/5.37.0/002/constants.d.ts +1 -0
- package/migrations/5.37.0/002/constants.js +10 -0
- package/migrations/5.37.0/002/constants.js.map +1 -0
- package/migrations/5.37.0/002/ddb/index.d.ts +22 -0
- package/migrations/5.37.0/002/ddb/index.js +133 -0
- package/migrations/5.37.0/002/ddb/index.js.map +1 -0
- package/migrations/5.37.0/002/ddb-es/index.d.ts +35 -0
- package/migrations/5.37.0/002/ddb-es/index.js +321 -0
- package/migrations/5.37.0/002/ddb-es/index.js.map +1 -0
- package/migrations/5.37.0/002/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.37.0/002/entities/createEntryEntity.js +109 -0
- package/migrations/5.37.0/002/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.37.0/002/entities/createLocaleEntity.d.ts +42 -0
- package/migrations/5.37.0/002/entities/createLocaleEntity.js +32 -0
- package/migrations/5.37.0/002/entities/createLocaleEntity.js.map +1 -0
- package/migrations/5.37.0/002/entities/createTenantEntity.d.ts +48 -0
- package/migrations/5.37.0/002/entities/createTenantEntity.js +13 -0
- package/migrations/5.37.0/002/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.37.0/002/types.d.ts +53 -0
- package/migrations/5.37.0/002/types.js +7 -0
- package/migrations/5.37.0/002/types.js.map +1 -0
- package/migrations/5.37.0/002/utils/getCompressedData.d.ts +4 -0
- package/migrations/5.37.0/002/utils/getCompressedData.js +19 -0
- package/migrations/5.37.0/002/utils/getCompressedData.js.map +1 -0
- package/migrations/5.37.0/002/utils/getDecompressedData.d.ts +1 -0
- package/migrations/5.37.0/002/utils/getDecompressedData.js +31 -0
- package/migrations/5.37.0/002/utils/getDecompressedData.js.map +1 -0
- package/migrations/5.37.0/003/constants.d.ts +3 -0
- package/migrations/5.37.0/003/constants.js +14 -0
- package/migrations/5.37.0/003/constants.js.map +1 -0
- package/migrations/5.37.0/003/ddb/AcoFolderMigration.d.ts +15 -0
- package/migrations/5.37.0/003/ddb/AcoFolderMigration.js +179 -0
- package/migrations/5.37.0/003/ddb/AcoFolderMigration.js.map +1 -0
- package/migrations/5.37.0/003/ddb/index.d.ts +10 -0
- package/migrations/5.37.0/003/ddb/index.js +49 -0
- package/migrations/5.37.0/003/ddb/index.js.map +1 -0
- package/migrations/5.37.0/003/ddb-es/AcoFolderMigration.d.ts +20 -0
- package/migrations/5.37.0/003/ddb-es/AcoFolderMigration.js +313 -0
- package/migrations/5.37.0/003/ddb-es/AcoFolderMigration.js.map +1 -0
- package/migrations/5.37.0/003/ddb-es/index.d.ts +12 -0
- package/migrations/5.37.0/003/ddb-es/index.js +64 -0
- package/migrations/5.37.0/003/ddb-es/index.js.map +1 -0
- package/migrations/5.37.0/003/ddb-es/latestElasticsearchData.d.ts +4 -0
- package/migrations/5.37.0/003/ddb-es/latestElasticsearchData.js +30 -0
- package/migrations/5.37.0/003/ddb-es/latestElasticsearchData.js.map +1 -0
- package/migrations/5.37.0/003/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.37.0/003/entities/createEntryEntity.js +109 -0
- package/migrations/5.37.0/003/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.37.0/003/entities/createLocaleEntity.d.ts +42 -0
- package/migrations/5.37.0/003/entities/createLocaleEntity.js +32 -0
- package/migrations/5.37.0/003/entities/createLocaleEntity.js.map +1 -0
- package/migrations/5.37.0/003/entities/createTenantEntity.d.ts +48 -0
- package/migrations/5.37.0/003/entities/createTenantEntity.js +13 -0
- package/migrations/5.37.0/003/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.37.0/003/types.d.ts +46 -0
- package/migrations/5.37.0/003/types.js +7 -0
- package/migrations/5.37.0/003/types.js.map +1 -0
- package/migrations/5.37.0/003/utils/getCompressedData.d.ts +4 -0
- package/migrations/5.37.0/003/utils/getCompressedData.js +19 -0
- package/migrations/5.37.0/003/utils/getCompressedData.js.map +1 -0
- package/migrations/5.37.0/003/utils/getDecompressedData.d.ts +1 -0
- package/migrations/5.37.0/003/utils/getDecompressedData.js +31 -0
- package/migrations/5.37.0/003/utils/getDecompressedData.js.map +1 -0
- package/migrations/5.37.0/004/constants.d.ts +7 -0
- package/migrations/5.37.0/004/constants.js +22 -0
- package/migrations/5.37.0/004/constants.js.map +1 -0
- package/migrations/5.37.0/004/ddb/PageDataMigration.d.ts +17 -0
- package/migrations/5.37.0/004/ddb/PageDataMigration.js +269 -0
- package/migrations/5.37.0/004/ddb/PageDataMigration.js.map +1 -0
- package/migrations/5.37.0/004/ddb/index.d.ts +10 -0
- package/migrations/5.37.0/004/ddb/index.js +49 -0
- package/migrations/5.37.0/004/ddb/index.js.map +1 -0
- package/migrations/5.37.0/004/ddb-es/PageDataMigration.d.ts +22 -0
- package/migrations/5.37.0/004/ddb-es/PageDataMigration.js +364 -0
- package/migrations/5.37.0/004/ddb-es/PageDataMigration.js.map +1 -0
- package/migrations/5.37.0/004/ddb-es/index.d.ts +12 -0
- package/migrations/5.37.0/004/ddb-es/index.js +64 -0
- package/migrations/5.37.0/004/ddb-es/index.js.map +1 -0
- package/migrations/5.37.0/004/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.37.0/004/entities/createEntryEntity.js +109 -0
- package/migrations/5.37.0/004/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.37.0/004/entities/createLocaleEntity.d.ts +42 -0
- package/migrations/5.37.0/004/entities/createLocaleEntity.js +32 -0
- package/migrations/5.37.0/004/entities/createLocaleEntity.js.map +1 -0
- package/migrations/5.37.0/004/entities/createPageEntity.d.ts +89 -0
- package/migrations/5.37.0/004/entities/createPageEntity.js +113 -0
- package/migrations/5.37.0/004/entities/createPageEntity.js.map +1 -0
- package/migrations/5.37.0/004/entities/createTenantEntity.d.ts +48 -0
- package/migrations/5.37.0/004/entities/createTenantEntity.js +13 -0
- package/migrations/5.37.0/004/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.37.0/004/types.d.ts +149 -0
- package/migrations/5.37.0/004/types.js +7 -0
- package/migrations/5.37.0/004/types.js.map +1 -0
- package/migrations/5.37.0/004/utils/getCompressedData.d.ts +4 -0
- package/migrations/5.37.0/004/utils/getCompressedData.js +19 -0
- package/migrations/5.37.0/004/utils/getCompressedData.js.map +1 -0
- package/migrations/5.37.0/005/constants.d.ts +3 -0
- package/migrations/5.37.0/005/constants.js +14 -0
- package/migrations/5.37.0/005/constants.js.map +1 -0
- package/migrations/5.37.0/005/ddb/index.d.ts +20 -0
- package/migrations/5.37.0/005/ddb/index.js +245 -0
- package/migrations/5.37.0/005/ddb/index.js.map +1 -0
- package/migrations/5.37.0/005/ddb-es/index.d.ts +22 -0
- package/migrations/5.37.0/005/ddb-es/index.js +382 -0
- package/migrations/5.37.0/005/ddb-es/index.js.map +1 -0
- package/migrations/5.37.0/005/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.37.0/005/entities/createEntryEntity.js +109 -0
- package/migrations/5.37.0/005/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.37.0/005/entities/createFileEntity.d.ts +95 -0
- package/migrations/5.37.0/005/entities/createFileEntity.js +33 -0
- package/migrations/5.37.0/005/entities/createFileEntity.js.map +1 -0
- package/migrations/5.37.0/005/entities/createLocaleEntity.d.ts +42 -0
- package/migrations/5.37.0/005/entities/createLocaleEntity.js +32 -0
- package/migrations/5.37.0/005/entities/createLocaleEntity.js.map +1 -0
- package/migrations/5.37.0/005/entities/createTenantEntity.d.ts +48 -0
- package/migrations/5.37.0/005/entities/createTenantEntity.js +13 -0
- package/migrations/5.37.0/005/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.37.0/005/entities/createTenantLinkEntity.d.ts +48 -0
- package/migrations/5.37.0/005/entities/createTenantLinkEntity.js +17 -0
- package/migrations/5.37.0/005/entities/createTenantLinkEntity.js.map +1 -0
- package/migrations/5.37.0/005/types.d.ts +109 -0
- package/migrations/5.37.0/005/types.js +7 -0
- package/migrations/5.37.0/005/types.js.map +1 -0
- package/migrations/5.38.0/001/ddb/index.d.ts +11 -0
- package/migrations/5.38.0/001/ddb/index.js +116 -0
- package/migrations/5.38.0/001/ddb/index.js.map +1 -0
- package/migrations/5.38.0/001/ddb-es/index.d.ts +13 -0
- package/migrations/5.38.0/001/ddb-es/index.js +211 -0
- package/migrations/5.38.0/001/ddb-es/index.js.map +1 -0
- package/migrations/5.38.0/001/entities/createFormEntity.d.ts +42 -0
- package/migrations/5.38.0/001/entities/createFormEntity.js +92 -0
- package/migrations/5.38.0/001/entities/createFormEntity.js.map +1 -0
- package/migrations/5.38.0/001/types.d.ts +11 -0
- package/migrations/5.38.0/001/types.js +7 -0
- package/migrations/5.38.0/001/types.js.map +1 -0
- package/migrations/5.38.0/002/ddb/index.d.ts +22 -0
- package/migrations/5.38.0/002/ddb/index.js +140 -0
- package/migrations/5.38.0/002/ddb/index.js.map +1 -0
- package/migrations/5.38.0/002/ddb-es/index.d.ts +32 -0
- package/migrations/5.38.0/002/ddb-es/index.js +250 -0
- package/migrations/5.38.0/002/ddb-es/index.js.map +1 -0
- package/migrations/5.38.0/002/entities/createFormEntity.d.ts +42 -0
- package/migrations/5.38.0/002/entities/createFormEntity.js +92 -0
- package/migrations/5.38.0/002/entities/createFormEntity.js.map +1 -0
- package/migrations/5.38.0/002/entities/createFormSubmissionDdbEsEntity.d.ts +48 -0
- package/migrations/5.38.0/002/entities/createFormSubmissionDdbEsEntity.js +29 -0
- package/migrations/5.38.0/002/entities/createFormSubmissionDdbEsEntity.js.map +1 -0
- package/migrations/5.38.0/002/entities/createFormSubmissionEntity.d.ts +42 -0
- package/migrations/5.38.0/002/entities/createFormSubmissionEntity.js +56 -0
- package/migrations/5.38.0/002/entities/createFormSubmissionEntity.js.map +1 -0
- package/migrations/5.38.0/002/types.d.ts +23 -0
- package/migrations/5.38.0/002/types.js +7 -0
- package/migrations/5.38.0/002/types.js.map +1 -0
- package/migrations/5.38.0/003/ddb/compressContent.d.ts +4 -0
- package/migrations/5.38.0/003/ddb/compressContent.js +17 -0
- package/migrations/5.38.0/003/ddb/compressContent.js.map +1 -0
- package/migrations/5.38.0/003/ddb/index.d.ts +12 -0
- package/migrations/5.38.0/003/ddb/index.js +143 -0
- package/migrations/5.38.0/003/ddb/index.js.map +1 -0
- package/migrations/5.38.0/003/entities/createPageBlockEntity.d.ts +83 -0
- package/migrations/5.38.0/003/entities/createPageBlockEntity.js +68 -0
- package/migrations/5.38.0/003/entities/createPageBlockEntity.js.map +1 -0
- package/migrations/5.38.0/003/types.d.ts +8 -0
- package/migrations/5.38.0/003/types.js +7 -0
- package/migrations/5.38.0/003/types.js.map +1 -0
- package/migrations/5.39.0/001/ddb/index.d.ts +20 -0
- package/migrations/5.39.0/001/ddb/index.js +136 -0
- package/migrations/5.39.0/001/ddb/index.js.map +1 -0
- package/migrations/5.39.0/001/ddb-es/index.d.ts +30 -0
- package/migrations/5.39.0/001/ddb-es/index.js +266 -0
- package/migrations/5.39.0/001/ddb-es/index.js.map +1 -0
- package/migrations/5.39.0/001/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.39.0/001/entities/createEntryEntity.js +164 -0
- package/migrations/5.39.0/001/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.39.0/001/types.d.ts +136 -0
- package/migrations/5.39.0/001/types.js +7 -0
- package/migrations/5.39.0/001/types.js.map +1 -0
- package/migrations/5.39.0/001/utils/assignNewMetaFields.d.ts +11 -0
- package/migrations/5.39.0/001/utils/assignNewMetaFields.js +44 -0
- package/migrations/5.39.0/001/utils/assignNewMetaFields.js.map +1 -0
- package/migrations/5.39.0/001/utils/ensureAllNonNullableValues.d.ts +8 -0
- package/migrations/5.39.0/001/utils/ensureAllNonNullableValues.js +38 -0
- package/migrations/5.39.0/001/utils/ensureAllNonNullableValues.js.map +1 -0
- package/migrations/5.39.0/001/utils/fixTypeFieldValue.d.ts +3 -0
- package/migrations/5.39.0/001/utils/fixTypeFieldValue.js +33 -0
- package/migrations/5.39.0/001/utils/fixTypeFieldValue.js.map +1 -0
- package/migrations/5.39.0/001/utils/getCompressedData.d.ts +4 -0
- package/migrations/5.39.0/001/utils/getCompressedData.js +19 -0
- package/migrations/5.39.0/001/utils/getCompressedData.js.map +1 -0
- package/migrations/5.39.0/001/utils/getDecompressedData.d.ts +1 -0
- package/migrations/5.39.0/001/utils/getDecompressedData.js +31 -0
- package/migrations/5.39.0/001/utils/getDecompressedData.js.map +1 -0
- package/migrations/5.39.0/001/utils/getFallbackIdentity.d.ts +8 -0
- package/migrations/5.39.0/001/utils/getFallbackIdentity.js +44 -0
- package/migrations/5.39.0/001/utils/getFallbackIdentity.js.map +1 -0
- package/migrations/5.39.0/001/utils/getFirstLastPublishedOn.d.ts +11 -0
- package/migrations/5.39.0/001/utils/getFirstLastPublishedOn.js +40 -0
- package/migrations/5.39.0/001/utils/getFirstLastPublishedOn.js.map +1 -0
- package/migrations/5.39.0/001/utils/getNonNullableFieldsWithMissingValues.d.ts +2 -0
- package/migrations/5.39.0/001/utils/getNonNullableFieldsWithMissingValues.js +22 -0
- package/migrations/5.39.0/001/utils/getNonNullableFieldsWithMissingValues.js.map +1 -0
- package/migrations/5.39.0/001/utils/getOldestRevisionCreatedOn.d.ts +11 -0
- package/migrations/5.39.0/001/utils/getOldestRevisionCreatedOn.js +33 -0
- package/migrations/5.39.0/001/utils/getOldestRevisionCreatedOn.js.map +1 -0
- package/migrations/5.39.0/001/utils/hasAllNonNullableValues.d.ts +2 -0
- package/migrations/5.39.0/001/utils/hasAllNonNullableValues.js +21 -0
- package/migrations/5.39.0/001/utils/hasAllNonNullableValues.js.map +1 -0
- package/migrations/5.39.0/001/utils/hasValidTypeFieldValue.d.ts +4 -0
- package/migrations/5.39.0/001/utils/hasValidTypeFieldValue.js +21 -0
- package/migrations/5.39.0/001/utils/hasValidTypeFieldValue.js.map +1 -0
- package/migrations/5.39.0/001/utils/isMigratedEntry.d.ts +2 -0
- package/migrations/5.39.0/001/utils/isMigratedEntry.js +12 -0
- package/migrations/5.39.0/001/utils/isMigratedEntry.js.map +1 -0
- package/migrations/5.39.0/002/ddb/FileManager_5_39_0_002.d.ts +14 -0
- package/migrations/5.39.0/002/ddb/FileManager_5_39_0_002.js +133 -0
- package/migrations/5.39.0/002/ddb/FileManager_5_39_0_002.js.map +1 -0
- package/migrations/5.39.0/002/ddb/index.d.ts +1 -0
- package/migrations/5.39.0/002/ddb/index.js +18 -0
- package/migrations/5.39.0/002/ddb/index.js.map +1 -0
- package/migrations/5.39.0/002/ddb-es/FileManager_5_39_0_002.d.ts +15 -0
- package/migrations/5.39.0/002/ddb-es/FileManager_5_39_0_002.js +190 -0
- package/migrations/5.39.0/002/ddb-es/FileManager_5_39_0_002.js.map +1 -0
- package/migrations/5.39.0/002/ddb-es/index.d.ts +1 -0
- package/migrations/5.39.0/002/ddb-es/index.js +18 -0
- package/migrations/5.39.0/002/ddb-es/index.js.map +1 -0
- package/migrations/5.39.0/002/utils/FileMetadata.d.ts +12 -0
- package/migrations/5.39.0/002/utils/FileMetadata.js +55 -0
- package/migrations/5.39.0/002/utils/FileMetadata.js.map +1 -0
- package/migrations/5.39.0/002/utils/createFileEntity.d.ts +53 -0
- package/migrations/5.39.0/002/utils/createFileEntity.js +50 -0
- package/migrations/5.39.0/002/utils/createFileEntity.js.map +1 -0
- package/migrations/5.39.0/002/utils/createLocaleEntity.d.ts +42 -0
- package/migrations/5.39.0/002/utils/createLocaleEntity.js +32 -0
- package/migrations/5.39.0/002/utils/createLocaleEntity.js.map +1 -0
- package/migrations/5.39.0/002/utils/createTenantEntity.d.ts +48 -0
- package/migrations/5.39.0/002/utils/createTenantEntity.js +13 -0
- package/migrations/5.39.0/002/utils/createTenantEntity.js.map +1 -0
- package/migrations/5.39.2/001/ddb-es/index.d.ts +30 -0
- package/migrations/5.39.2/001/ddb-es/index.js +276 -0
- package/migrations/5.39.2/001/ddb-es/index.js.map +1 -0
- package/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.d.ts +21 -0
- package/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.js +167 -0
- package/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.js.map +1 -0
- package/migrations/5.39.6/001/ddb-es/SegmentProcessor.d.ts +23 -0
- package/migrations/5.39.6/001/ddb-es/SegmentProcessor.js +31 -0
- package/migrations/5.39.6/001/ddb-es/SegmentProcessor.js.map +1 -0
- package/migrations/5.39.6/001/ddb-es/bin.d.ts +2 -0
- package/migrations/5.39.6/001/ddb-es/bin.js +83 -0
- package/migrations/5.39.6/001/ddb-es/bin.js.map +1 -0
- package/migrations/5.39.6/001/ddb-es/createMetaFieldsDataMigrationDeploymentHook.d.ts +11 -0
- package/migrations/5.39.6/001/ddb-es/createMetaFieldsDataMigrationDeploymentHook.js +83 -0
- package/migrations/5.39.6/001/ddb-es/createMetaFieldsDataMigrationDeploymentHook.js.map +1 -0
- package/migrations/5.39.6/001/ddb-es/index.d.ts +30 -0
- package/migrations/5.39.6/001/ddb-es/index.js +329 -0
- package/migrations/5.39.6/001/ddb-es/index.js.map +1 -0
- package/migrations/5.39.6/001/ddb-es/utils.d.ts +28 -0
- package/migrations/5.39.6/001/ddb-es/utils.js +62 -0
- package/migrations/5.39.6/001/ddb-es/utils.js.map +1 -0
- package/migrations/5.39.6/001/ddb-es/worker.d.ts +1 -0
- package/migrations/5.39.6/001/ddb-es/worker.js +352 -0
- package/migrations/5.39.6/001/ddb-es/worker.js.map +1 -0
- package/package.json +45 -0
- package/utils/createEntity.d.ts +89 -0
- package/utils/createEntity.js +67 -0
- package/utils/createEntity.js.map +1 -0
- package/utils/createLocaleEntity.d.ts +42 -0
- package/utils/createLocaleEntity.js +32 -0
- package/utils/createLocaleEntity.js.map +1 -0
- package/utils/createTenantEntity.d.ts +48 -0
- package/utils/createTenantEntity.js +13 -0
- package/utils/createTenantEntity.js.map +1 -0
- package/utils/dynamoDb.d.ts +3 -0
- package/utils/dynamoDb.js +62 -0
- package/utils/dynamoDb.js.map +1 -0
- package/utils/elasticsearch/disableEsIndexing.d.ts +9 -0
- package/utils/elasticsearch/disableEsIndexing.js +34 -0
- package/utils/elasticsearch/disableEsIndexing.js.map +1 -0
- package/utils/elasticsearch/esCreateIndex.d.ts +9 -0
- package/utils/elasticsearch/esCreateIndex.js +62 -0
- package/utils/elasticsearch/esCreateIndex.js.map +1 -0
- package/utils/elasticsearch/esFindOne.d.ts +8 -0
- package/utils/elasticsearch/esFindOne.js +27 -0
- package/utils/elasticsearch/esFindOne.js.map +1 -0
- package/utils/elasticsearch/esGetIndexExist.d.ts +9 -0
- package/utils/elasticsearch/esGetIndexExist.js +37 -0
- package/utils/elasticsearch/esGetIndexExist.js.map +1 -0
- package/utils/elasticsearch/esGetIndexName.d.ts +7 -0
- package/utils/elasticsearch/esGetIndexName.js +40 -0
- package/utils/elasticsearch/esGetIndexName.js.map +1 -0
- package/utils/elasticsearch/esGetIndexSettings.d.ts +7 -0
- package/utils/elasticsearch/esGetIndexSettings.js +32 -0
- package/utils/elasticsearch/esGetIndexSettings.js.map +1 -0
- package/utils/elasticsearch/esListIndexes.d.ts +6 -0
- package/utils/elasticsearch/esListIndexes.js +23 -0
- package/utils/elasticsearch/esListIndexes.js.map +1 -0
- package/utils/elasticsearch/esPutIndexSettings.d.ts +7 -0
- package/utils/elasticsearch/esPutIndexSettings.js +30 -0
- package/utils/elasticsearch/esPutIndexSettings.js.map +1 -0
- package/utils/elasticsearch/esQueryAll.d.ts +8 -0
- package/utils/elasticsearch/esQueryAll.js +26 -0
- package/utils/elasticsearch/esQueryAll.js.map +1 -0
- package/utils/elasticsearch/esQueryAllWithCallback.d.ts +10 -0
- package/utils/elasticsearch/esQueryAllWithCallback.js +45 -0
- package/utils/elasticsearch/esQueryAllWithCallback.js.map +1 -0
- package/utils/elasticsearch/fetchOriginalEsSettings.d.ts +13 -0
- package/utils/elasticsearch/fetchOriginalEsSettings.js +36 -0
- package/utils/elasticsearch/fetchOriginalEsSettings.js.map +1 -0
- package/utils/elasticsearch/index.d.ts +12 -0
- package/utils/elasticsearch/index.js +139 -0
- package/utils/elasticsearch/index.js.map +1 -0
- package/utils/elasticsearch/plugins/base.d.ts +3 -0
- package/utils/elasticsearch/plugins/base.js +13 -0
- package/utils/elasticsearch/plugins/base.js.map +1 -0
- package/utils/elasticsearch/plugins/index.d.ts +6 -0
- package/utils/elasticsearch/plugins/index.js +14 -0
- package/utils/elasticsearch/plugins/index.js.map +1 -0
- package/utils/elasticsearch/plugins/japanese.d.ts +4 -0
- package/utils/elasticsearch/plugins/japanese.js +14 -0
- package/utils/elasticsearch/plugins/japanese.js.map +1 -0
- package/utils/elasticsearch/restoreOriginalEsSettings.d.ts +15 -0
- package/utils/elasticsearch/restoreOriginalEsSettings.js +44 -0
- package/utils/elasticsearch/restoreOriginalEsSettings.js.map +1 -0
- package/utils/forEachTenantLocale.d.ts +13 -0
- package/utils/forEachTenantLocale.js +55 -0
- package/utils/forEachTenantLocale.js.map +1 -0
- package/utils/index.d.ts +6 -0
- package/utils/index.js +73 -0
- package/utils/index.js.map +1 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.FileManager_5_37_0_005 = void 0;
|
|
8
|
+
var _chunk = _interopRequireDefault(require("lodash/chunk"));
|
|
9
|
+
var _dataMigration = require("@webiny/data-migration");
|
|
10
|
+
var _utils = require("@webiny/utils");
|
|
11
|
+
var _createEntryEntity = require("../entities/createEntryEntity");
|
|
12
|
+
var _createLocaleEntity = require("../entities/createLocaleEntity");
|
|
13
|
+
var _createTenantEntity = require("../entities/createTenantEntity");
|
|
14
|
+
var _utils2 = require("../../../../utils");
|
|
15
|
+
var _ioc = require("@webiny/ioc");
|
|
16
|
+
var _createEntryEntity2 = require("../../../5.36.0/001/entities/createEntryEntity");
|
|
17
|
+
var _getCompressedData = require("../../../5.36.0/001/utils/getCompressedData");
|
|
18
|
+
const isGroupMigrationCompleted = status => {
|
|
19
|
+
return typeof status === "boolean";
|
|
20
|
+
};
|
|
21
|
+
class FileManager_5_37_0_005 {
|
|
22
|
+
constructor(table, esTable, elasticsearchClient) {
|
|
23
|
+
this.elasticsearchClient = elasticsearchClient;
|
|
24
|
+
this.ddbEntryEntity = (0, _createEntryEntity.createDdbEntryEntity)(table);
|
|
25
|
+
this.ddbEsEntryEntity = (0, _createEntryEntity2.createDdbEsEntryEntity)(esTable);
|
|
26
|
+
this.localeEntity = (0, _createLocaleEntity.createLocaleEntity)(table);
|
|
27
|
+
this.tenantEntity = (0, _createTenantEntity.createTenantEntity)(table);
|
|
28
|
+
}
|
|
29
|
+
getId() {
|
|
30
|
+
return "5.37.0-005";
|
|
31
|
+
}
|
|
32
|
+
getDescription() {
|
|
33
|
+
return "Migrate File Manager data to Headless CMS records.";
|
|
34
|
+
}
|
|
35
|
+
async shouldExecute({
|
|
36
|
+
logger
|
|
37
|
+
}) {
|
|
38
|
+
const tenants = await this.listTenants();
|
|
39
|
+
if (tenants.length === 0) {
|
|
40
|
+
logger.info(`No tenants found in the system; skipping migration.`);
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
for (const tenant of tenants) {
|
|
44
|
+
const locales = await this.listLocales({
|
|
45
|
+
tenant
|
|
46
|
+
});
|
|
47
|
+
if (locales.length === 0) {
|
|
48
|
+
logger.info(`No locales found in tenant "${tenant.data.id}".`);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
for (const locale of locales) {
|
|
52
|
+
const indexExists = await (0, _utils2.esGetIndexExist)({
|
|
53
|
+
elasticsearchClient: this.elasticsearchClient,
|
|
54
|
+
tenant: tenant.data.id,
|
|
55
|
+
locale: locale.code,
|
|
56
|
+
type: "file-manager",
|
|
57
|
+
isHeadlessCmsModel: false
|
|
58
|
+
});
|
|
59
|
+
if (!indexExists) {
|
|
60
|
+
logger.info(`No elasticsearch index found for File Manager in tenant "${tenant.data.id}" and locale "${locale.code}".`);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Fetch the latest file record from ES
|
|
65
|
+
const fmIndexName = (0, _utils2.esGetIndexName)({
|
|
66
|
+
tenant: tenant.data.id,
|
|
67
|
+
locale: locale.code,
|
|
68
|
+
type: "file-manager"
|
|
69
|
+
});
|
|
70
|
+
const latestFile = await (0, _utils2.esFindOne)({
|
|
71
|
+
elasticsearchClient: this.elasticsearchClient,
|
|
72
|
+
index: fmIndexName,
|
|
73
|
+
body: {
|
|
74
|
+
query: {
|
|
75
|
+
bool: {
|
|
76
|
+
filter: [{
|
|
77
|
+
term: {
|
|
78
|
+
"tenant.keyword": tenant.data.id
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
term: {
|
|
82
|
+
"locale.keyword": locale.code
|
|
83
|
+
}
|
|
84
|
+
}]
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
sort: [{
|
|
88
|
+
"id.keyword": {
|
|
89
|
+
order: "desc",
|
|
90
|
+
unmapped_type: "keyword"
|
|
91
|
+
}
|
|
92
|
+
}]
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
if (!latestFile) {
|
|
96
|
+
logger.info(`No files found in tenant "${tenant.data.id}" and locale "${locale.code}".`);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const fileCmsRecord = await (0, _utils2.queryOne)({
|
|
100
|
+
entity: this.ddbEntryEntity,
|
|
101
|
+
partitionKey: `T#${tenant.data.id}#L#${locale.code}#CMS#CME#${latestFile.id}`,
|
|
102
|
+
options: {
|
|
103
|
+
eq: "L"
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
if (fileCmsRecord) {
|
|
107
|
+
logger.info(`Files already migrated to CMS content entries in tenant "${tenant.data.id}" and locale "${locale.code}".`);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
async execute({
|
|
116
|
+
logger,
|
|
117
|
+
...context
|
|
118
|
+
}) {
|
|
119
|
+
const tenants = await this.listTenants();
|
|
120
|
+
const migrationStatus = context.checkpoint || {};
|
|
121
|
+
for (const tenant of tenants) {
|
|
122
|
+
const locales = await this.listLocales({
|
|
123
|
+
tenant
|
|
124
|
+
});
|
|
125
|
+
for (const locale of locales) {
|
|
126
|
+
const groupId = `${tenant.data.id}:${locale.code}`;
|
|
127
|
+
const status = migrationStatus[groupId];
|
|
128
|
+
if (isGroupMigrationCompleted(status)) {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const tenantId = tenant.data.id;
|
|
132
|
+
const localeCode = locale.code;
|
|
133
|
+
const searchRecords = await this.listSearchRecords(tenantId, localeCode);
|
|
134
|
+
if (searchRecords.length === 0) {
|
|
135
|
+
migrationStatus[groupId] = true;
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
let batch = 0;
|
|
139
|
+
await (0, _utils2.esQueryAllWithCallback)({
|
|
140
|
+
elasticsearchClient: this.elasticsearchClient,
|
|
141
|
+
index: (0, _utils2.esGetIndexName)({
|
|
142
|
+
tenant: tenant.data.id,
|
|
143
|
+
locale: locale.code,
|
|
144
|
+
type: "file-manager"
|
|
145
|
+
}),
|
|
146
|
+
body: {
|
|
147
|
+
query: {
|
|
148
|
+
bool: {
|
|
149
|
+
filter: [{
|
|
150
|
+
term: {
|
|
151
|
+
"tenant.keyword": tenant.data.id
|
|
152
|
+
}
|
|
153
|
+
}, {
|
|
154
|
+
term: {
|
|
155
|
+
"locale.keyword": locale.code
|
|
156
|
+
}
|
|
157
|
+
}]
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
size: 10000,
|
|
161
|
+
sort: [{
|
|
162
|
+
"id.keyword": {
|
|
163
|
+
order: "asc",
|
|
164
|
+
unmapped_type: "keyword"
|
|
165
|
+
}
|
|
166
|
+
}],
|
|
167
|
+
search_after: status
|
|
168
|
+
},
|
|
169
|
+
callback: async (files, cursor) => {
|
|
170
|
+
batch++;
|
|
171
|
+
logger.info(`Processing batch #${batch} in group ${groupId} (${files.length} files).`);
|
|
172
|
+
const ddbItems = [];
|
|
173
|
+
const ddbEsItems = [];
|
|
174
|
+
for (const file of files) {
|
|
175
|
+
const entry = this.createContentEntryCommonFields(file);
|
|
176
|
+
this.assignLocationFromSearchRecord(entry, searchRecords);
|
|
177
|
+
const fileId = file.id;
|
|
178
|
+
const latestEntry = {
|
|
179
|
+
PK: `T#${tenantId}#L#${localeCode}#CMS#CME#${fileId}`,
|
|
180
|
+
SK: "L",
|
|
181
|
+
TYPE: "cms.entry.l",
|
|
182
|
+
...entry
|
|
183
|
+
};
|
|
184
|
+
const revisionEntry = {
|
|
185
|
+
PK: `T#${tenantId}#L#${localeCode}#CMS#CME#CME#${fileId}`,
|
|
186
|
+
SK: "REV#0001",
|
|
187
|
+
TYPE: "cms.entry",
|
|
188
|
+
...entry
|
|
189
|
+
};
|
|
190
|
+
const latestDdbEs = {
|
|
191
|
+
PK: `T#${tenantId}#L#${localeCode}#CMS#CME#${fileId}`,
|
|
192
|
+
SK: "L",
|
|
193
|
+
data: await (0, _getCompressedData.getCompressedData)({
|
|
194
|
+
latest: true,
|
|
195
|
+
__type: "cms.entry.l",
|
|
196
|
+
...latestEntry,
|
|
197
|
+
rawValues: {
|
|
198
|
+
"object@location": {},
|
|
199
|
+
"object@meta": {}
|
|
200
|
+
}
|
|
201
|
+
}),
|
|
202
|
+
index: (0, _utils2.esGetIndexName)({
|
|
203
|
+
tenant: tenantId,
|
|
204
|
+
locale: localeCode,
|
|
205
|
+
type: "fmfile",
|
|
206
|
+
isHeadlessCmsModel: true
|
|
207
|
+
})
|
|
208
|
+
};
|
|
209
|
+
ddbItems.push(this.ddbEntryEntity.putBatch(latestEntry));
|
|
210
|
+
ddbItems.push(this.ddbEntryEntity.putBatch(revisionEntry));
|
|
211
|
+
ddbEsItems.push(this.ddbEsEntryEntity.putBatch(latestDdbEs));
|
|
212
|
+
}
|
|
213
|
+
const executeDdb = () => {
|
|
214
|
+
return Promise.all((0, _chunk.default)(ddbItems, 200).map(ddbItemsChunk => {
|
|
215
|
+
return (0, _utils2.batchWriteAll)({
|
|
216
|
+
table: this.ddbEntryEntity.table,
|
|
217
|
+
items: ddbItemsChunk
|
|
218
|
+
});
|
|
219
|
+
}));
|
|
220
|
+
};
|
|
221
|
+
const executeDdbEs = () => {
|
|
222
|
+
return Promise.all((0, _chunk.default)(ddbEsItems, 200).map(ddbEsItemsChunk => {
|
|
223
|
+
return (0, _utils2.batchWriteAll)({
|
|
224
|
+
table: this.ddbEsEntryEntity.table,
|
|
225
|
+
items: ddbEsItemsChunk
|
|
226
|
+
});
|
|
227
|
+
}));
|
|
228
|
+
};
|
|
229
|
+
await (0, _utils.executeWithRetry)(executeDdb, {
|
|
230
|
+
onFailedAttempt: error => {
|
|
231
|
+
logger.error(`"batchWriteAll ddb" attempt #${error.attemptNumber} failed.`);
|
|
232
|
+
logger.error(error.message);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
await (0, _utils.executeWithRetry)(executeDdbEs, {
|
|
236
|
+
onFailedAttempt: error => {
|
|
237
|
+
logger.error(`"batchWriteAll ddb + es" attempt #${error.attemptNumber} failed.`);
|
|
238
|
+
logger.error(error.message);
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// Update checkpoint after every batch
|
|
243
|
+
migrationStatus[groupId] = cursor;
|
|
244
|
+
|
|
245
|
+
// Check if we should store checkpoint and exit.
|
|
246
|
+
if (context.runningOutOfTime()) {
|
|
247
|
+
await context.createCheckpointAndExit(migrationStatus);
|
|
248
|
+
} else {
|
|
249
|
+
await context.createCheckpoint(migrationStatus);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
migrationStatus[groupId] = true;
|
|
254
|
+
context.createCheckpoint(migrationStatus);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
async listTenants() {
|
|
259
|
+
return await (0, _utils2.queryAll)({
|
|
260
|
+
entity: this.tenantEntity,
|
|
261
|
+
partitionKey: "TENANTS",
|
|
262
|
+
options: {
|
|
263
|
+
index: "GSI1",
|
|
264
|
+
gte: " "
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
async listSearchRecords(tenant, locale) {
|
|
269
|
+
const esParams = {
|
|
270
|
+
tenant,
|
|
271
|
+
locale,
|
|
272
|
+
type: "acosearchrecord",
|
|
273
|
+
isHeadlessCmsModel: true
|
|
274
|
+
};
|
|
275
|
+
const acoIndex = (0, _utils2.esGetIndexName)(esParams);
|
|
276
|
+
const indexExists = await (0, _utils2.esGetIndexExist)({
|
|
277
|
+
elasticsearchClient: this.elasticsearchClient,
|
|
278
|
+
...esParams
|
|
279
|
+
});
|
|
280
|
+
if (!indexExists) {
|
|
281
|
+
return [];
|
|
282
|
+
}
|
|
283
|
+
const searchRecords = [];
|
|
284
|
+
await (0, _utils2.esQueryAllWithCallback)({
|
|
285
|
+
elasticsearchClient: this.elasticsearchClient,
|
|
286
|
+
index: acoIndex,
|
|
287
|
+
body: {
|
|
288
|
+
query: {
|
|
289
|
+
bool: {
|
|
290
|
+
filter: [{
|
|
291
|
+
term: {
|
|
292
|
+
"tenant.keyword": tenant
|
|
293
|
+
}
|
|
294
|
+
}, {
|
|
295
|
+
term: {
|
|
296
|
+
"locale.keyword": locale
|
|
297
|
+
}
|
|
298
|
+
}]
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
size: 10000,
|
|
302
|
+
sort: [{
|
|
303
|
+
"id.keyword": {
|
|
304
|
+
order: "asc",
|
|
305
|
+
unmapped_type: "keyword"
|
|
306
|
+
}
|
|
307
|
+
}]
|
|
308
|
+
},
|
|
309
|
+
callback: async records => {
|
|
310
|
+
for (const record of records) {
|
|
311
|
+
searchRecords.push(record);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
return searchRecords;
|
|
316
|
+
}
|
|
317
|
+
async listLocales({
|
|
318
|
+
tenant
|
|
319
|
+
}) {
|
|
320
|
+
return await (0, _utils2.queryAll)({
|
|
321
|
+
entity: this.localeEntity,
|
|
322
|
+
partitionKey: `T#${tenant.data.id}#I18N#L`,
|
|
323
|
+
options: {
|
|
324
|
+
gte: " "
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
assignLocationFromSearchRecord(fileEntry, search) {
|
|
329
|
+
const searchRecord = search.find(rec => rec.values["wby-aco-json@data"].id === fileEntry.entryId);
|
|
330
|
+
if (!searchRecord) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
const folderId = searchRecord.values["object@location"]["text@folderId"].toLowerCase();
|
|
334
|
+
fileEntry.location = {
|
|
335
|
+
folderId
|
|
336
|
+
};
|
|
337
|
+
fileEntry.values["object@location"] = {
|
|
338
|
+
"text@folderId": folderId
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
createContentEntryCommonFields(file) {
|
|
342
|
+
return {
|
|
343
|
+
createdBy: file.createdBy,
|
|
344
|
+
createdOn: file.createdOn,
|
|
345
|
+
entryId: file.id,
|
|
346
|
+
id: `${file.id}#0001`,
|
|
347
|
+
locked: false,
|
|
348
|
+
locale: file.locale,
|
|
349
|
+
location: {
|
|
350
|
+
folderId: "root"
|
|
351
|
+
},
|
|
352
|
+
modelId: "fmFile",
|
|
353
|
+
modifiedBy: file.createdBy,
|
|
354
|
+
ownedBy: file.createdBy,
|
|
355
|
+
savedOn: file.createdOn,
|
|
356
|
+
status: "draft",
|
|
357
|
+
tenant: file.tenant,
|
|
358
|
+
version: 1,
|
|
359
|
+
webinyVersion: String(process.env.WEBINY_VERSION),
|
|
360
|
+
values: {
|
|
361
|
+
"number@size": file.size,
|
|
362
|
+
"object@location": {
|
|
363
|
+
"text@folderId": "root"
|
|
364
|
+
},
|
|
365
|
+
"object@meta": {
|
|
366
|
+
"boolean@private": file.meta?.private || false,
|
|
367
|
+
"number@width": file.meta?.width,
|
|
368
|
+
"number@height": file.meta?.height
|
|
369
|
+
},
|
|
370
|
+
"text@aliases": file.aliases,
|
|
371
|
+
"text@key": file.key,
|
|
372
|
+
"text@name": file.name,
|
|
373
|
+
"text@tags": file.tags.filter(tag => !tag.startsWith("mime:")),
|
|
374
|
+
"text@type": file.type
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
exports.FileManager_5_37_0_005 = FileManager_5_37_0_005;
|
|
380
|
+
(0, _ioc.makeInjectable)(FileManager_5_37_0_005, [(0, _ioc.inject)(_dataMigration.PrimaryDynamoTableSymbol), (0, _ioc.inject)(_dataMigration.ElasticsearchDynamoTableSymbol), (0, _ioc.inject)(_dataMigration.ElasticsearchClientSymbol)]);
|
|
381
|
+
|
|
382
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_chunk","_interopRequireDefault","require","_dataMigration","_utils","_createEntryEntity","_createLocaleEntity","_createTenantEntity","_utils2","_ioc","_createEntryEntity2","_getCompressedData","isGroupMigrationCompleted","status","FileManager_5_37_0_005","constructor","table","esTable","elasticsearchClient","ddbEntryEntity","createDdbEntryEntity","ddbEsEntryEntity","createDdbEsEntryEntity","localeEntity","createLocaleEntity","tenantEntity","createTenantEntity","getId","getDescription","shouldExecute","logger","tenants","listTenants","length","info","tenant","locales","listLocales","data","id","locale","indexExists","esGetIndexExist","code","type","isHeadlessCmsModel","fmIndexName","esGetIndexName","latestFile","esFindOne","index","body","query","bool","filter","term","sort","order","unmapped_type","fileCmsRecord","queryOne","entity","partitionKey","options","eq","execute","context","migrationStatus","checkpoint","groupId","tenantId","localeCode","searchRecords","listSearchRecords","batch","esQueryAllWithCallback","size","search_after","callback","files","cursor","ddbItems","ddbEsItems","file","entry","createContentEntryCommonFields","assignLocationFromSearchRecord","fileId","latestEntry","PK","SK","TYPE","revisionEntry","latestDdbEs","getCompressedData","latest","__type","rawValues","push","putBatch","executeDdb","Promise","all","chunk","map","ddbItemsChunk","batchWriteAll","items","executeDdbEs","ddbEsItemsChunk","executeWithRetry","onFailedAttempt","error","attemptNumber","message","runningOutOfTime","createCheckpointAndExit","createCheckpoint","queryAll","gte","esParams","acoIndex","records","record","fileEntry","search","searchRecord","find","rec","values","entryId","folderId","toLowerCase","location","createdBy","createdOn","locked","modelId","modifiedBy","ownedBy","savedOn","version","webinyVersion","String","process","env","WEBINY_VERSION","meta","private","width","height","aliases","key","name","tags","tag","startsWith","exports","makeInjectable","inject","PrimaryDynamoTableSymbol","ElasticsearchDynamoTableSymbol","ElasticsearchClientSymbol"],"sources":["index.ts"],"sourcesContent":["import chunk from \"lodash/chunk\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Client } from \"@elastic/elasticsearch\";\nimport {\n DataMigration,\n DataMigrationContext,\n ElasticsearchClientSymbol,\n ElasticsearchDynamoTableSymbol,\n PrimaryDynamoTableSymbol\n} from \"@webiny/data-migration\";\nimport { PrimitiveValue } from \"@webiny/api-elasticsearch/types\";\nimport { executeWithRetry } from \"@webiny/utils\";\nimport { createDdbEntryEntity } from \"../entities/createEntryEntity\";\nimport { createLocaleEntity } from \"../entities/createLocaleEntity\";\nimport { createTenantEntity } from \"../entities/createTenantEntity\";\nimport {\n batchWriteAll,\n esFindOne,\n esGetIndexExist,\n esGetIndexName,\n esQueryAllWithCallback,\n queryAll,\n queryOne\n} from \"~/utils\";\nimport {\n I18NLocale,\n ListLocalesParams,\n Tenant,\n CmsEntry,\n FileSearchRecordValues,\n FileEntryValues\n} from \"../types\";\nimport { inject, makeInjectable } from \"@webiny/ioc\";\nimport { createDdbEsEntryEntity } from \"~/migrations/5.36.0/001/entities/createEntryEntity\";\nimport { File } from \"~/migrations/5.36.0/001/types\";\nimport { getCompressedData } from \"~/migrations/5.36.0/001/utils/getCompressedData\";\n\nconst isGroupMigrationCompleted = (\n status: PrimitiveValue[] | boolean | undefined\n): status is boolean => {\n return typeof status === \"boolean\";\n};\n\ntype FileDataMigrationCheckpoint = Record<string, string | boolean | undefined>;\n\nexport class FileManager_5_37_0_005 implements DataMigration<FileDataMigrationCheckpoint> {\n private readonly elasticsearchClient: Client;\n private readonly ddbEntryEntity: ReturnType<typeof createDdbEntryEntity>;\n private readonly ddbEsEntryEntity: ReturnType<typeof createDdbEsEntryEntity>;\n private readonly localeEntity: ReturnType<typeof createLocaleEntity>;\n private readonly tenantEntity: ReturnType<typeof createTenantEntity>;\n\n constructor(\n table: Table<string, string, string>,\n esTable: Table<string, string, string>,\n elasticsearchClient: Client\n ) {\n this.elasticsearchClient = elasticsearchClient;\n this.ddbEntryEntity = createDdbEntryEntity(table);\n this.ddbEsEntryEntity = createDdbEsEntryEntity(esTable);\n this.localeEntity = createLocaleEntity(table);\n this.tenantEntity = createTenantEntity(table);\n }\n\n getId() {\n return \"5.37.0-005\";\n }\n\n getDescription() {\n return \"Migrate File Manager data to Headless CMS records.\";\n }\n\n async shouldExecute({ logger }: DataMigrationContext): Promise<boolean> {\n const tenants = await this.listTenants();\n if (tenants.length === 0) {\n logger.info(`No tenants found in the system; skipping migration.`);\n return false;\n }\n\n for (const tenant of tenants) {\n const locales = await this.listLocales({ tenant });\n if (locales.length === 0) {\n logger.info(`No locales found in tenant \"${tenant.data.id}\".`);\n continue;\n }\n\n for (const locale of locales) {\n const indexExists = await esGetIndexExist({\n elasticsearchClient: this.elasticsearchClient,\n tenant: tenant.data.id,\n locale: locale.code,\n type: \"file-manager\",\n isHeadlessCmsModel: false\n });\n\n if (!indexExists) {\n logger.info(\n `No elasticsearch index found for File Manager in tenant \"${tenant.data.id}\" and locale \"${locale.code}\".`\n );\n continue;\n }\n\n // Fetch the latest file record from ES\n const fmIndexName = esGetIndexName({\n tenant: tenant.data.id,\n locale: locale.code,\n type: \"file-manager\"\n });\n\n const latestFile = await esFindOne<File>({\n elasticsearchClient: this.elasticsearchClient,\n index: fmIndexName,\n body: {\n query: {\n bool: {\n filter: [\n { term: { \"tenant.keyword\": tenant.data.id } },\n { term: { \"locale.keyword\": locale.code } }\n ]\n }\n },\n sort: [\n {\n \"id.keyword\": { order: \"desc\", unmapped_type: \"keyword\" }\n }\n ]\n }\n });\n\n if (!latestFile) {\n logger.info(\n `No files found in tenant \"${tenant.data.id}\" and locale \"${locale.code}\".`\n );\n continue;\n }\n\n const fileCmsRecord = await queryOne<{ id: string }>({\n entity: this.ddbEntryEntity,\n partitionKey: `T#${tenant.data.id}#L#${locale.code}#CMS#CME#${latestFile.id}`,\n options: {\n eq: \"L\"\n }\n });\n\n if (fileCmsRecord) {\n logger.info(\n `Files already migrated to CMS content entries in tenant \"${tenant.data.id}\" and locale \"${locale.code}\".`\n );\n continue;\n }\n\n return true;\n }\n }\n return false;\n }\n\n async execute({ logger, ...context }: DataMigrationContext): Promise<void> {\n const tenants = await this.listTenants();\n\n const migrationStatus = context.checkpoint || {};\n\n for (const tenant of tenants) {\n const locales = await this.listLocales({ tenant });\n\n for (const locale of locales) {\n const groupId = `${tenant.data.id}:${locale.code}`;\n const status = migrationStatus[groupId];\n\n if (isGroupMigrationCompleted(status)) {\n continue;\n }\n\n const tenantId = tenant.data.id;\n const localeCode = locale.code;\n\n const searchRecords = await this.listSearchRecords(tenantId, localeCode);\n\n if (searchRecords.length === 0) {\n migrationStatus[groupId] = true;\n continue;\n }\n\n let batch = 0;\n await esQueryAllWithCallback<File>({\n elasticsearchClient: this.elasticsearchClient,\n index: esGetIndexName({\n tenant: tenant.data.id,\n locale: locale.code,\n type: \"file-manager\"\n }),\n body: {\n query: {\n bool: {\n filter: [\n { term: { \"tenant.keyword\": tenant.data.id } },\n { term: { \"locale.keyword\": locale.code } }\n ]\n }\n },\n size: 10000,\n sort: [\n {\n \"id.keyword\": { order: \"asc\", unmapped_type: \"keyword\" }\n }\n ],\n search_after: status\n },\n callback: async (files, cursor) => {\n batch++;\n\n logger.info(\n `Processing batch #${batch} in group ${groupId} (${files.length} files).`\n );\n\n const ddbItems: ReturnType<\n ReturnType<typeof createDdbEntryEntity>[\"putBatch\"]\n >[] = [];\n\n const ddbEsItems: ReturnType<\n ReturnType<typeof createDdbEntryEntity>[\"putBatch\"]\n >[] = [];\n\n for (const file of files) {\n const entry = this.createContentEntryCommonFields(file);\n this.assignLocationFromSearchRecord(entry, searchRecords);\n\n const fileId = file.id;\n\n const latestEntry = {\n PK: `T#${tenantId}#L#${localeCode}#CMS#CME#${fileId}`,\n SK: \"L\",\n TYPE: \"cms.entry.l\",\n ...entry\n };\n\n const revisionEntry = {\n PK: `T#${tenantId}#L#${localeCode}#CMS#CME#CME#${fileId}`,\n SK: \"REV#0001\",\n TYPE: \"cms.entry\",\n ...entry\n };\n\n const latestDdbEs = {\n PK: `T#${tenantId}#L#${localeCode}#CMS#CME#${fileId}`,\n SK: \"L\",\n data: await getCompressedData({\n latest: true,\n __type: \"cms.entry.l\",\n ...latestEntry,\n rawValues: {\n \"object@location\": {},\n \"object@meta\": {}\n }\n }),\n index: esGetIndexName({\n tenant: tenantId,\n locale: localeCode,\n type: \"fmfile\",\n isHeadlessCmsModel: true\n })\n };\n\n ddbItems.push(this.ddbEntryEntity.putBatch(latestEntry));\n ddbItems.push(this.ddbEntryEntity.putBatch(revisionEntry));\n ddbEsItems.push(this.ddbEsEntryEntity.putBatch(latestDdbEs));\n }\n\n const executeDdb = () => {\n return Promise.all(\n chunk(ddbItems, 200).map(ddbItemsChunk => {\n return batchWriteAll({\n table: this.ddbEntryEntity.table,\n items: ddbItemsChunk\n });\n })\n );\n };\n\n const executeDdbEs = () => {\n return Promise.all(\n chunk(ddbEsItems, 200).map(ddbEsItemsChunk => {\n return batchWriteAll({\n table: this.ddbEsEntryEntity.table,\n items: ddbEsItemsChunk\n });\n })\n );\n };\n\n await executeWithRetry(executeDdb, {\n onFailedAttempt: error => {\n logger.error(\n `\"batchWriteAll ddb\" attempt #${error.attemptNumber} failed.`\n );\n logger.error(error.message);\n }\n });\n\n await executeWithRetry(executeDdbEs, {\n onFailedAttempt: error => {\n logger.error(\n `\"batchWriteAll ddb + es\" 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 context.createCheckpoint(migrationStatus);\n }\n }\n }\n\n private async listTenants(): Promise<Tenant[]> {\n return await queryAll<Tenant>({\n entity: this.tenantEntity,\n partitionKey: \"TENANTS\",\n options: {\n index: \"GSI1\",\n gte: \" \"\n }\n });\n }\n\n private async listSearchRecords(tenant: string, locale: string) {\n const esParams = {\n tenant,\n locale,\n type: \"acosearchrecord\",\n isHeadlessCmsModel: true\n };\n\n const acoIndex = esGetIndexName(esParams);\n\n const indexExists = await esGetIndexExist({\n elasticsearchClient: this.elasticsearchClient,\n ...esParams\n });\n\n if (!indexExists) {\n return [];\n }\n\n const searchRecords: CmsEntry<FileSearchRecordValues>[] = [];\n\n await esQueryAllWithCallback<CmsEntry<FileSearchRecordValues>>({\n elasticsearchClient: this.elasticsearchClient,\n index: acoIndex,\n body: {\n query: {\n bool: {\n filter: [\n { term: { \"tenant.keyword\": tenant } },\n { term: { \"locale.keyword\": locale } }\n ]\n }\n },\n size: 10000,\n sort: [\n {\n \"id.keyword\": { order: \"asc\", unmapped_type: \"keyword\" }\n }\n ]\n },\n callback: async records => {\n for (const record of records) {\n searchRecords.push(record);\n }\n }\n });\n\n return searchRecords;\n }\n\n private async listLocales({ tenant }: ListLocalesParams): Promise<I18NLocale[]> {\n return await queryAll<I18NLocale>({\n entity: this.localeEntity,\n partitionKey: `T#${tenant.data.id}#I18N#L`,\n options: {\n gte: \" \"\n }\n });\n }\n\n private assignLocationFromSearchRecord(\n fileEntry: CmsEntry<FileEntryValues>,\n search: CmsEntry<FileSearchRecordValues>[]\n ) {\n const searchRecord = search.find(\n rec => rec.values[\"wby-aco-json@data\"].id === fileEntry.entryId\n );\n if (!searchRecord) {\n return;\n }\n\n const folderId = searchRecord.values[\"object@location\"][\"text@folderId\"].toLowerCase();\n fileEntry.location = {\n folderId\n };\n fileEntry.values[\"object@location\"] = {\n \"text@folderId\": folderId\n };\n }\n\n private createContentEntryCommonFields(file: File): CmsEntry<FileEntryValues> {\n return {\n createdBy: file.createdBy,\n createdOn: file.createdOn,\n entryId: file.id,\n id: `${file.id}#0001`,\n locked: false,\n locale: file.locale,\n location: {\n folderId: \"root\"\n },\n modelId: \"fmFile\",\n modifiedBy: file.createdBy,\n ownedBy: file.createdBy,\n savedOn: file.createdOn,\n status: \"draft\",\n tenant: file.tenant,\n version: 1,\n webinyVersion: String(process.env.WEBINY_VERSION),\n values: {\n \"number@size\": file.size,\n \"object@location\": {\n \"text@folderId\": \"root\"\n },\n \"object@meta\": {\n \"boolean@private\": file.meta?.private || false,\n \"number@width\": file.meta?.width,\n \"number@height\": file.meta?.height\n },\n \"text@aliases\": file.aliases,\n \"text@key\": file.key,\n \"text@name\": file.name,\n \"text@tags\": file.tags.filter(tag => !tag.startsWith(\"mime:\")),\n \"text@type\": file.type\n }\n };\n }\n}\n\nmakeInjectable(FileManager_5_37_0_005, [\n inject(PrimaryDynamoTableSymbol),\n inject(ElasticsearchDynamoTableSymbol),\n inject(ElasticsearchClientSymbol)\n]);\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,cAAA,GAAAD,OAAA;AAQA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAiBA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AAEA,IAAAS,kBAAA,GAAAT,OAAA;AAEA,MAAMU,yBAAyB,GAC3BC,MAA8C,IAC1B;EACpB,OAAO,OAAOA,MAAM,KAAK,SAAS;AACtC,CAAC;AAIM,MAAMC,sBAAsB,CAAuD;EAOtFC,WAAWA,CACPC,KAAoC,EACpCC,OAAsC,EACtCC,mBAA2B,EAC7B;IACE,IAAI,CAACA,mBAAmB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AAO,EAAE,QAAQ;MACjBC,UAAU,EAAEvD,IAAI,CAACmD,SAAS;MAC1BK,OAAO,EAAExD,IAAI,CAACmD,SAAS;MACvBM,OAAO,EAAEzD,IAAI,CAACoD,SAAS;MACvB1H,MAAM,EAAE,OAAO;MACfsB,MAAM,EAAEgD,IAAI,CAAChD,MAAM;MACnB0G,OAAO,EAAE,CAAC;MACVC,aAAa,EAAEC,MAAM,CAACC,OAAO,CAACC,GAAG,CAACC,cAAc,CAAC;MACjDjB,MAAM,EAAE;QACJ,aAAa,EAAE9C,IAAI,CAACP,IAAI;QACxB,iBAAiB,EAAE;UACf,eAAe,EAAE;QACrB,CAAC;QACD,aAAa,EAAE;UACX,iBAAiB,EAAEO,IAAI,CAACgE,IAAI,EAAEC,OAAO,IAAI,KAAK;UAC9C,cAAc,EAAEjE,IAAI,CAACgE,IAAI,EAAEE,KAAK;UAChC,eAAe,EAAElE,IAAI,CAACgE,IAAI,EAAEG;QAChC,CAAC;QACD,cAAc,EAAEnE,IAAI,CAACoE,OAAO;QAC5B,UAAU,EAAEpE,IAAI,CAACqE,GAAG;QACpB,WAAW,EAAErE,IAAI,CAACsE,IAAI;QACtB,WAAW,EAAEtE,IAAI,CAACuE,IAAI,CAACpG,MAAM,CAACqG,GAAG,IAAI,CAACA,GAAG,CAACC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC9D,WAAW,EAAEzE,IAAI,CAACvC;MACtB;IACJ,CAAC;EACL;AACJ;AAACiH,OAAA,CAAA/I,sBAAA,GAAAA,sBAAA;AAED,IAAAgJ,mBAAc,EAAChJ,sBAAsB,EAAE,CACnC,IAAAiJ,WAAM,EAACC,uCAAwB,CAAC,EAChC,IAAAD,WAAM,EAACE,6CAA8B,CAAC,EACtC,IAAAF,WAAM,EAACG,wCAAyB,CAAC,CACpC,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
export declare const createDdbEntryEntity: (table: Table<string, string, string>) => import("dynamodb-toolbox/dist/cjs/classes/Entity/Entity").default<string, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, Table<string, string, string>, true, true, boolean, string, string, string, boolean, {
|
|
3
|
+
PK: {
|
|
4
|
+
partitionKey: true;
|
|
5
|
+
};
|
|
6
|
+
SK: {
|
|
7
|
+
sortKey: true;
|
|
8
|
+
};
|
|
9
|
+
GSI1_PK: {
|
|
10
|
+
type: "string";
|
|
11
|
+
};
|
|
12
|
+
GSI1_SK: {
|
|
13
|
+
type: "string";
|
|
14
|
+
};
|
|
15
|
+
TYPE: {
|
|
16
|
+
type: "string";
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
PK: {
|
|
20
|
+
partitionKey: true;
|
|
21
|
+
};
|
|
22
|
+
SK: {
|
|
23
|
+
sortKey: true;
|
|
24
|
+
};
|
|
25
|
+
GSI1_PK: {
|
|
26
|
+
type: "string";
|
|
27
|
+
};
|
|
28
|
+
GSI1_SK: {
|
|
29
|
+
type: "string";
|
|
30
|
+
};
|
|
31
|
+
TYPE: {
|
|
32
|
+
type: "string";
|
|
33
|
+
};
|
|
34
|
+
}, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParsedAttributes<import("ts-toolbelt/out/Any/Key").Key>, any, {
|
|
35
|
+
[x: string]: any;
|
|
36
|
+
[x: number]: any;
|
|
37
|
+
[x: symbol]: any;
|
|
38
|
+
}, {
|
|
39
|
+
[x: string]: any;
|
|
40
|
+
[x: number]: any;
|
|
41
|
+
[x: symbol]: any;
|
|
42
|
+
}>;
|
|
43
|
+
export declare const createDdbEsEntryEntity: (table: Table<string, string, string>) => import("dynamodb-toolbox/dist/cjs/classes/Entity/Entity").default<string, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, Table<string, string, string>, true, true, boolean, string, string, string, boolean, {
|
|
44
|
+
PK: {
|
|
45
|
+
partitionKey: true;
|
|
46
|
+
};
|
|
47
|
+
SK: {
|
|
48
|
+
sortKey: true;
|
|
49
|
+
};
|
|
50
|
+
GSI1_PK: {
|
|
51
|
+
type: "string";
|
|
52
|
+
};
|
|
53
|
+
GSI1_SK: {
|
|
54
|
+
type: "string";
|
|
55
|
+
};
|
|
56
|
+
TYPE: {
|
|
57
|
+
type: "string";
|
|
58
|
+
};
|
|
59
|
+
data: {
|
|
60
|
+
type: "map";
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
PK: {
|
|
64
|
+
partitionKey: true;
|
|
65
|
+
};
|
|
66
|
+
SK: {
|
|
67
|
+
sortKey: true;
|
|
68
|
+
};
|
|
69
|
+
GSI1_PK: {
|
|
70
|
+
type: "string";
|
|
71
|
+
};
|
|
72
|
+
GSI1_SK: {
|
|
73
|
+
type: "string";
|
|
74
|
+
};
|
|
75
|
+
TYPE: {
|
|
76
|
+
type: "string";
|
|
77
|
+
};
|
|
78
|
+
data: {
|
|
79
|
+
type: "map";
|
|
80
|
+
};
|
|
81
|
+
}, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParsedAttributes<import("ts-toolbelt/out/Any/Key").Key>, any, {
|
|
82
|
+
[x: string]: any;
|
|
83
|
+
[x: number]: any;
|
|
84
|
+
[x: symbol]: any;
|
|
85
|
+
}, {
|
|
86
|
+
[x: string]: any;
|
|
87
|
+
[x: number]: any;
|
|
88
|
+
[x: symbol]: any;
|
|
89
|
+
}>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createDdbEsEntryEntity = exports.createDdbEntryEntity = void 0;
|
|
7
|
+
var _utils = require("../../../../utils");
|
|
8
|
+
const ddbAttributes = {
|
|
9
|
+
PK: {
|
|
10
|
+
type: "string",
|
|
11
|
+
partitionKey: true
|
|
12
|
+
},
|
|
13
|
+
SK: {
|
|
14
|
+
type: "string",
|
|
15
|
+
sortKey: true
|
|
16
|
+
},
|
|
17
|
+
GSI1_PK: {
|
|
18
|
+
type: "string"
|
|
19
|
+
},
|
|
20
|
+
GSI1_SK: {
|
|
21
|
+
type: "string"
|
|
22
|
+
},
|
|
23
|
+
TYPE: {
|
|
24
|
+
type: "string"
|
|
25
|
+
},
|
|
26
|
+
__type: {
|
|
27
|
+
type: "string"
|
|
28
|
+
},
|
|
29
|
+
webinyVersion: {
|
|
30
|
+
type: "string"
|
|
31
|
+
},
|
|
32
|
+
tenant: {
|
|
33
|
+
type: "string"
|
|
34
|
+
},
|
|
35
|
+
entryId: {
|
|
36
|
+
type: "string"
|
|
37
|
+
},
|
|
38
|
+
id: {
|
|
39
|
+
type: "string"
|
|
40
|
+
},
|
|
41
|
+
createdBy: {
|
|
42
|
+
type: "map"
|
|
43
|
+
},
|
|
44
|
+
ownedBy: {
|
|
45
|
+
type: "map"
|
|
46
|
+
},
|
|
47
|
+
location: {
|
|
48
|
+
type: "map"
|
|
49
|
+
},
|
|
50
|
+
modifiedBy: {
|
|
51
|
+
type: "map"
|
|
52
|
+
},
|
|
53
|
+
createdOn: {
|
|
54
|
+
type: "string"
|
|
55
|
+
},
|
|
56
|
+
savedOn: {
|
|
57
|
+
type: "string"
|
|
58
|
+
},
|
|
59
|
+
modelId: {
|
|
60
|
+
type: "string"
|
|
61
|
+
},
|
|
62
|
+
locale: {
|
|
63
|
+
type: "string"
|
|
64
|
+
},
|
|
65
|
+
publishedOn: {
|
|
66
|
+
type: "string"
|
|
67
|
+
},
|
|
68
|
+
version: {
|
|
69
|
+
type: "number"
|
|
70
|
+
},
|
|
71
|
+
locked: {
|
|
72
|
+
type: "boolean"
|
|
73
|
+
},
|
|
74
|
+
status: {
|
|
75
|
+
type: "string"
|
|
76
|
+
},
|
|
77
|
+
values: {
|
|
78
|
+
type: "map"
|
|
79
|
+
},
|
|
80
|
+
meta: {
|
|
81
|
+
type: "map"
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const ddbEsAttributes = {
|
|
85
|
+
PK: {
|
|
86
|
+
type: "string",
|
|
87
|
+
partitionKey: true
|
|
88
|
+
},
|
|
89
|
+
SK: {
|
|
90
|
+
type: "string",
|
|
91
|
+
sortKey: true
|
|
92
|
+
},
|
|
93
|
+
index: {
|
|
94
|
+
type: "string"
|
|
95
|
+
},
|
|
96
|
+
data: {
|
|
97
|
+
type: "map"
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const createDdbEntryEntity = table => {
|
|
101
|
+
return (0, _utils.createLegacyEntity)(table, "CmsEntries", ddbAttributes);
|
|
102
|
+
};
|
|
103
|
+
exports.createDdbEntryEntity = createDdbEntryEntity;
|
|
104
|
+
const createDdbEsEntryEntity = table => {
|
|
105
|
+
return (0, _utils.createStandardEntity)(table, "CmsEntriesElasticsearch", ddbEsAttributes);
|
|
106
|
+
};
|
|
107
|
+
exports.createDdbEsEntryEntity = createDdbEsEntryEntity;
|
|
108
|
+
|
|
109
|
+
//# sourceMappingURL=createEntryEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_utils","require","ddbAttributes","PK","type","partitionKey","SK","sortKey","GSI1_PK","GSI1_SK","TYPE","__type","webinyVersion","tenant","entryId","id","createdBy","ownedBy","location","modifiedBy","createdOn","savedOn","modelId","locale","publishedOn","version","locked","status","values","meta","ddbEsAttributes","index","data","createDdbEntryEntity","table","createLegacyEntity","exports","createDdbEsEntryEntity","createStandardEntity"],"sources":["createEntryEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity, createStandardEntity } from \"~/utils\";\n\nconst ddbAttributes: Parameters<typeof createLegacyEntity>[2] = {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n GSI1_PK: {\n type: \"string\"\n },\n GSI1_SK: {\n type: \"string\"\n },\n TYPE: {\n type: \"string\"\n },\n __type: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n entryId: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n ownedBy: {\n type: \"map\"\n },\n location: {\n type: \"map\"\n },\n modifiedBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n modelId: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n publishedOn: {\n type: \"string\"\n },\n version: {\n type: \"number\"\n },\n locked: {\n type: \"boolean\"\n },\n status: {\n type: \"string\"\n },\n values: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n }\n};\n\nconst ddbEsAttributes: Parameters<typeof createStandardEntity>[2] = {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n index: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n }\n};\n\nexport const createDdbEntryEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"CmsEntries\", ddbAttributes);\n};\n\nexport const createDdbEsEntryEntity = (table: Table<string, string, string>) => {\n return createStandardEntity(table, \"CmsEntriesElasticsearch\", ddbEsAttributes);\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA,MAAMC,aAAuD,GAAG;EAC5DC,EAAE,EAAE;IACAC,IAAI,EAAE,QAAQ;IACdC,YAAY,EAAE;EAClB,CAAC;EACDC,EAAE,EAAE;IACAF,IAAI,EAAE,QAAQ;IACdG,OAAO,EAAE;EACb,CAAC;EACDC,OAAO,EAAE;IACLJ,IAAI,EAAE;EACV,CAAC;EACDK,OAAO,EAAE;IACLL,IAAI,EAAE;EACV,CAAC;EACDM,IAAI,EAAE;IACFN,IAAI,EAAE;EACV,CAAC;EACDO,MAAM,EAAE;IACJP,IAAI,EAAE;EACV,CAAC;EACDQ,aAAa,EAAE;IACXR,IAAI,EAAE;E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