@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,321 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CmsEntriesRootFolder_5_37_0_002 = void 0;
|
|
7
|
+
var _dataMigration = require("@webiny/data-migration");
|
|
8
|
+
var _createEntryEntity = require("../entities/createEntryEntity");
|
|
9
|
+
var _createLocaleEntity = require("../entities/createLocaleEntity");
|
|
10
|
+
var _createTenantEntity = require("../entities/createTenantEntity");
|
|
11
|
+
var _dbDynamodb = require("@webiny/db-dynamodb");
|
|
12
|
+
var _utils = require("../../../../utils");
|
|
13
|
+
var _utils2 = require("@webiny/utils");
|
|
14
|
+
var _getDecompressedData = require("../utils/getDecompressedData");
|
|
15
|
+
var _getCompressedData = require("../utils/getCompressedData");
|
|
16
|
+
var _ioc = require("@webiny/ioc");
|
|
17
|
+
class CmsEntriesRootFolder_5_37_0_002 {
|
|
18
|
+
constructor(table, esTable, elasticsearchClient) {
|
|
19
|
+
this.elasticsearchClient = elasticsearchClient;
|
|
20
|
+
this.ddbEntryEntity = (0, _createEntryEntity.createDdbEntryEntity)(table);
|
|
21
|
+
this.ddbEsEntryEntity = (0, _createEntryEntity.createDdbEsEntryEntity)(esTable);
|
|
22
|
+
this.localeEntity = (0, _createLocaleEntity.createLocaleEntity)(table);
|
|
23
|
+
this.tenantEntity = (0, _createTenantEntity.createTenantEntity)(table);
|
|
24
|
+
}
|
|
25
|
+
getId() {
|
|
26
|
+
return "5.37.0-002";
|
|
27
|
+
}
|
|
28
|
+
getDescription() {
|
|
29
|
+
return "Add default folderId to all CMS records.";
|
|
30
|
+
}
|
|
31
|
+
async shouldExecute({
|
|
32
|
+
logger
|
|
33
|
+
}) {
|
|
34
|
+
/**
|
|
35
|
+
* We will load a few CMS entryes
|
|
36
|
+
*/
|
|
37
|
+
const result = await (0, _dbDynamodb.scan)({
|
|
38
|
+
entity: this.ddbEsEntryEntity,
|
|
39
|
+
options: {
|
|
40
|
+
filters: [{
|
|
41
|
+
attr: "PK",
|
|
42
|
+
contains: "#CMS#CME#"
|
|
43
|
+
}],
|
|
44
|
+
limit: 100
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
if (result.items.length === 0) {
|
|
48
|
+
logger.info(`No CMS entries found in the system; skipping migration.`);
|
|
49
|
+
return false;
|
|
50
|
+
} else if (result.error) {
|
|
51
|
+
logger.error(result.error);
|
|
52
|
+
throw new Error(result.error);
|
|
53
|
+
}
|
|
54
|
+
for (const item of result.items) {
|
|
55
|
+
const data = await (0, _getDecompressedData.getDecompressedData)(item.data);
|
|
56
|
+
if (!data) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* If no location.folderId was set, we need to push the upgrade.
|
|
61
|
+
*/
|
|
62
|
+
if (!data.location?.folderId) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
logger.info(`CMS entries already upgraded. skipping...`);
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
async execute({
|
|
70
|
+
logger,
|
|
71
|
+
...context
|
|
72
|
+
}) {
|
|
73
|
+
const migrationStatus = context.checkpoint || {};
|
|
74
|
+
if (migrationStatus.lastEvaluatedKey === true) {
|
|
75
|
+
await this.restoreOriginalElasticsearchSettings({
|
|
76
|
+
migrationStatus,
|
|
77
|
+
logger
|
|
78
|
+
});
|
|
79
|
+
logger.info(`Migration completed, no need to start again.`);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
let usingKey = "";
|
|
83
|
+
if (migrationStatus?.lastEvaluatedKey) {
|
|
84
|
+
usingKey = JSON.stringify(migrationStatus.lastEvaluatedKey);
|
|
85
|
+
}
|
|
86
|
+
logger.debug(`Scanning DynamoDB Elasticsearch table... ${usingKey}`);
|
|
87
|
+
await (0, _utils.ddbScanWithCallback)({
|
|
88
|
+
entity: this.ddbEntryEntity,
|
|
89
|
+
options: {
|
|
90
|
+
filters: [{
|
|
91
|
+
attr: "TYPE",
|
|
92
|
+
beginsWith: "cms.entry"
|
|
93
|
+
}],
|
|
94
|
+
startKey: migrationStatus.lastEvaluatedKey || undefined,
|
|
95
|
+
limit: 500
|
|
96
|
+
}
|
|
97
|
+
}, async result => {
|
|
98
|
+
logger.debug(`Processing ${result.items.length} items...`);
|
|
99
|
+
const ddbItems = [];
|
|
100
|
+
const ddbEsItems = [];
|
|
101
|
+
const ddbEsGetItems = {};
|
|
102
|
+
/**
|
|
103
|
+
* Update the DynamoDB part of the records.
|
|
104
|
+
*/
|
|
105
|
+
for (const item of result.items) {
|
|
106
|
+
const index = (0, _utils.esGetIndexName)({
|
|
107
|
+
tenant: item.tenant,
|
|
108
|
+
locale: item.locale,
|
|
109
|
+
type: item.modelId,
|
|
110
|
+
isHeadlessCmsModel: true
|
|
111
|
+
});
|
|
112
|
+
// Check for the elasticsearch index settings
|
|
113
|
+
if (!migrationStatus.indexes || migrationStatus.indexes[index] === undefined) {
|
|
114
|
+
// We need to fetch the index settings first
|
|
115
|
+
const settings = await this.fetchOriginalElasticsearchSettings({
|
|
116
|
+
index,
|
|
117
|
+
logger
|
|
118
|
+
});
|
|
119
|
+
// ... add it to the checkpoint...
|
|
120
|
+
migrationStatus.indexes = {
|
|
121
|
+
...migrationStatus.indexes,
|
|
122
|
+
[index]: settings
|
|
123
|
+
};
|
|
124
|
+
// and then set not to index
|
|
125
|
+
await this.disableElasticsearchIndexing({
|
|
126
|
+
index,
|
|
127
|
+
logger
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
//
|
|
131
|
+
ddbItems.push(this.ddbEntryEntity.putBatch({
|
|
132
|
+
...item,
|
|
133
|
+
location: {
|
|
134
|
+
...item.location,
|
|
135
|
+
folderId: item.location?.folderId || "root"
|
|
136
|
+
}
|
|
137
|
+
}));
|
|
138
|
+
/**
|
|
139
|
+
* Prepare the loading of DynamoDB Elasticsearch part of the records.
|
|
140
|
+
*/
|
|
141
|
+
if (ddbEsGetItems[`${item.entryId}:L`]) {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
ddbEsGetItems[`${item.entryId}:L`] = this.ddbEsEntryEntity.getBatch({
|
|
145
|
+
PK: item.PK,
|
|
146
|
+
SK: "L"
|
|
147
|
+
});
|
|
148
|
+
if (item.status === "published" || !!item.locked) {
|
|
149
|
+
ddbEsGetItems[`${item.entryId}:P`] = this.ddbEsEntryEntity.getBatch({
|
|
150
|
+
PK: item.PK,
|
|
151
|
+
SK: "P"
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Get all the records from DynamoDB Elasticsearch.
|
|
157
|
+
*/
|
|
158
|
+
const esRecords = await (0, _dbDynamodb.batchReadAll)({
|
|
159
|
+
table: this.ddbEsEntryEntity.table,
|
|
160
|
+
items: Object.values(ddbEsGetItems)
|
|
161
|
+
});
|
|
162
|
+
for (const esRecord of esRecords) {
|
|
163
|
+
const decompressedData = await (0, _getDecompressedData.getDecompressedData)(esRecord.data);
|
|
164
|
+
if (!decompressedData) {
|
|
165
|
+
logger.trace(`Skipping record "${esRecord.PK}" as it is not a valid CMS entry...`);
|
|
166
|
+
continue;
|
|
167
|
+
} else if (!context.forceExecute && decompressedData.location?.folderId) {
|
|
168
|
+
logger.trace(`Skipping record "${decompressedData.entryId}" as it already has folderId defined...`);
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
const compressedData = await (0, _getCompressedData.getCompressedData)({
|
|
172
|
+
...decompressedData,
|
|
173
|
+
location: {
|
|
174
|
+
...decompressedData.location,
|
|
175
|
+
folderId: "root"
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
const modified = new Date().toISOString();
|
|
179
|
+
ddbEsItems.push(this.ddbEsEntryEntity.putBatch({
|
|
180
|
+
...esRecord,
|
|
181
|
+
data: compressedData,
|
|
182
|
+
modified
|
|
183
|
+
}));
|
|
184
|
+
}
|
|
185
|
+
const execute = () => {
|
|
186
|
+
return (0, _dbDynamodb.batchWriteAll)({
|
|
187
|
+
table: this.ddbEntryEntity.table,
|
|
188
|
+
items: ddbItems
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
const executeDdbEs = () => {
|
|
192
|
+
return (0, _dbDynamodb.batchWriteAll)({
|
|
193
|
+
table: this.ddbEsEntryEntity.table,
|
|
194
|
+
items: ddbEsItems
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
logger.trace("Storing the DynamoDB records...");
|
|
198
|
+
await (0, _utils2.executeWithRetry)(execute, {
|
|
199
|
+
onFailedAttempt: error => {
|
|
200
|
+
logger.error(`"batchWriteAll" attempt #${error.attemptNumber} failed: ${error.message}`);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
logger.trace("...stored.");
|
|
204
|
+
logger.trace("Storing the DynamoDB Elasticsearch records...");
|
|
205
|
+
await (0, _utils2.executeWithRetry)(executeDdbEs, {
|
|
206
|
+
onFailedAttempt: error => {
|
|
207
|
+
logger.error(`"batchWriteAll ddb + es" attempt #${error.attemptNumber} failed: ${error.message}`);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
logger.trace("...stored.");
|
|
211
|
+
|
|
212
|
+
// Update checkpoint after every batch
|
|
213
|
+
migrationStatus.lastEvaluatedKey = result.lastEvaluatedKey?.PK ? result.lastEvaluatedKey : true;
|
|
214
|
+
|
|
215
|
+
// Check if we should store checkpoint and exit.
|
|
216
|
+
if (context.runningOutOfTime()) {
|
|
217
|
+
await context.createCheckpointAndExit(migrationStatus);
|
|
218
|
+
} else {
|
|
219
|
+
await context.createCheckpoint(migrationStatus);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
/**
|
|
223
|
+
* This is the end of the migration.
|
|
224
|
+
*/
|
|
225
|
+
await this.restoreOriginalElasticsearchSettings({
|
|
226
|
+
migrationStatus,
|
|
227
|
+
logger
|
|
228
|
+
});
|
|
229
|
+
migrationStatus.lastEvaluatedKey = true;
|
|
230
|
+
migrationStatus.indexes = {};
|
|
231
|
+
context.createCheckpoint(migrationStatus);
|
|
232
|
+
}
|
|
233
|
+
async fetchOriginalElasticsearchSettings(params) {
|
|
234
|
+
const {
|
|
235
|
+
index,
|
|
236
|
+
logger
|
|
237
|
+
} = params;
|
|
238
|
+
try {
|
|
239
|
+
const settings = await (0, _utils.esGetIndexSettings)({
|
|
240
|
+
elasticsearchClient: this.elasticsearchClient,
|
|
241
|
+
index,
|
|
242
|
+
fields: ["number_of_replicas", "refresh_interval"]
|
|
243
|
+
});
|
|
244
|
+
return {
|
|
245
|
+
number_of_replicas: settings.number_of_replicas || 1,
|
|
246
|
+
refresh_interval: settings.refresh_interval || "1s"
|
|
247
|
+
};
|
|
248
|
+
} catch (ex) {
|
|
249
|
+
logger.error(`Failed to fetch original Elasticsearch settings for index "${index}".`);
|
|
250
|
+
logger.error({
|
|
251
|
+
...ex,
|
|
252
|
+
message: ex.message,
|
|
253
|
+
code: ex.code,
|
|
254
|
+
data: ex.data
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
259
|
+
async restoreOriginalElasticsearchSettings(params) {
|
|
260
|
+
const {
|
|
261
|
+
migrationStatus,
|
|
262
|
+
logger
|
|
263
|
+
} = params;
|
|
264
|
+
const indexes = migrationStatus.indexes;
|
|
265
|
+
if (!indexes || typeof indexes !== "object") {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
for (const index in indexes) {
|
|
269
|
+
const settings = indexes[index];
|
|
270
|
+
if (!settings || typeof settings !== "object") {
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
try {
|
|
274
|
+
await (0, _utils.esPutIndexSettings)({
|
|
275
|
+
elasticsearchClient: this.elasticsearchClient,
|
|
276
|
+
index,
|
|
277
|
+
settings: {
|
|
278
|
+
number_of_replicas: settings.number_of_replicas || 1,
|
|
279
|
+
refresh_interval: settings.refresh_interval || `1s`
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
} catch (ex) {
|
|
283
|
+
logger.error(`Failed to restore original settings for index "${index}". Please do it manually.`);
|
|
284
|
+
logger.error({
|
|
285
|
+
...ex,
|
|
286
|
+
message: ex.message,
|
|
287
|
+
code: ex.code,
|
|
288
|
+
data: ex.data
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
async disableElasticsearchIndexing(params) {
|
|
294
|
+
const {
|
|
295
|
+
index,
|
|
296
|
+
logger
|
|
297
|
+
} = params;
|
|
298
|
+
try {
|
|
299
|
+
await (0, _utils.esPutIndexSettings)({
|
|
300
|
+
elasticsearchClient: this.elasticsearchClient,
|
|
301
|
+
index,
|
|
302
|
+
settings: {
|
|
303
|
+
number_of_replicas: 0,
|
|
304
|
+
refresh_interval: -1
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
} catch (ex) {
|
|
308
|
+
logger.error(`Failed to disable indexing for index "${index}".`);
|
|
309
|
+
logger.error({
|
|
310
|
+
...ex,
|
|
311
|
+
message: ex.message,
|
|
312
|
+
code: ex.code,
|
|
313
|
+
data: ex.data
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
exports.CmsEntriesRootFolder_5_37_0_002 = CmsEntriesRootFolder_5_37_0_002;
|
|
319
|
+
(0, _ioc.makeInjectable)(CmsEntriesRootFolder_5_37_0_002, [(0, _ioc.inject)(_dataMigration.PrimaryDynamoTableSymbol), (0, _ioc.inject)(_dataMigration.ElasticsearchDynamoTableSymbol), (0, _ioc.inject)(_dataMigration.ElasticsearchClientSymbol)]);
|
|
320
|
+
|
|
321
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_dataMigration","require","_createEntryEntity","_createLocaleEntity","_createTenantEntity","_dbDynamodb","_utils","_utils2","_getDecompressedData","_getCompressedData","_ioc","CmsEntriesRootFolder_5_37_0_002","constructor","table","esTable","elasticsearchClient","ddbEntryEntity","createDdbEntryEntity","ddbEsEntryEntity","createDdbEsEntryEntity","localeEntity","createLocaleEntity","tenantEntity","createTenantEntity","getId","getDescription","shouldExecute","logger","result","scan","entity","options","filters","attr","contains","limit","items","length","info","error","Error","item","data","getDecompressedData","location","folderId","execute","context","migrationStatus","checkpoint","lastEvaluatedKey","restoreOriginalElasticsearchSettings","usingKey","JSON","stringify","debug","ddbScanWithCallback","beginsWith","startKey","undefined","ddbItems","ddbEsItems","ddbEsGetItems","index","esGetIndexName","tenant","locale","type","modelId","isHeadlessCmsModel","indexes","settings","fetchOriginalElasticsearchSettings","disableElasticsearchIndexing","push","putBatch","entryId","getBatch","PK","SK","status","locked","esRecords","batchReadAll","Object","values","esRecord","decompressedData","trace","forceExecute","compressedData","getCompressedData","modified","Date","toISOString","batchWriteAll","executeDdbEs","executeWithRetry","onFailedAttempt","attemptNumber","message","runningOutOfTime","createCheckpointAndExit","createCheckpoint","params","esGetIndexSettings","fields","number_of_replicas","refresh_interval","ex","code","esPutIndexSettings","exports","makeInjectable","inject","PrimaryDynamoTableSymbol","ElasticsearchDynamoTableSymbol","ElasticsearchClientSymbol"],"sources":["index.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport {\n DataMigration,\n DataMigrationContext,\n ElasticsearchClientSymbol,\n ElasticsearchDynamoTableSymbol,\n Logger,\n PrimaryDynamoTableSymbol\n} from \"@webiny/data-migration\";\nimport { createDdbEntryEntity, createDdbEsEntryEntity } from \"../entities/createEntryEntity\";\nimport { createLocaleEntity } from \"../entities/createLocaleEntity\";\nimport { createTenantEntity } from \"../entities/createTenantEntity\";\nimport {\n batchReadAll,\n BatchReadItem,\n batchWriteAll,\n BatchWriteItem,\n scan\n} from \"@webiny/db-dynamodb\";\nimport { CmsEntry } from \"../types\";\nimport { Client } from \"@elastic/elasticsearch\";\nimport {\n ddbScanWithCallback,\n esGetIndexName,\n esGetIndexSettings,\n esPutIndexSettings\n} from \"~/utils\";\nimport { executeWithRetry } from \"@webiny/utils\";\nimport { getDecompressedData } from \"~/migrations/5.37.0/002/utils/getDecompressedData\";\nimport { getCompressedData } from \"~/migrations/5.37.0/002/utils/getCompressedData\";\nimport { inject, makeInjectable } from \"@webiny/ioc\";\n\ninterface LastEvaluatedKey {\n PK: string;\n SK: string;\n GSI1_PK: string;\n GSI1_SK: string;\n}\n\ninterface IndexSettings {\n number_of_replicas: number;\n refresh_interval: `${number}s`;\n}\n\ninterface CmsEntriesRootFolderDataMigrationCheckpoint {\n lastEvaluatedKey?: LastEvaluatedKey | boolean;\n indexes: {\n [index: string]: IndexSettings | null;\n };\n}\n\ninterface FetchOriginalElasticsearchSettingsParams {\n index: string;\n logger: Logger;\n}\n\ninterface RestoreOriginalElasticsearchSettingsParams {\n migrationStatus: CmsEntriesRootFolderDataMigrationCheckpoint;\n logger: Logger;\n}\n\ninterface DisableElasticsearchIndexingParams {\n index: string;\n logger: Logger;\n}\n\ninterface DynamoDbElasticsearchRecord {\n PK: string;\n SK: string;\n data: string;\n}\n\nexport class CmsEntriesRootFolder_5_37_0_002\n implements DataMigration<CmsEntriesRootFolderDataMigrationCheckpoint>\n{\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 public 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-002\";\n }\n\n getDescription() {\n return \"Add default folderId to all CMS records.\";\n }\n\n async shouldExecute({ logger }: DataMigrationContext): Promise<boolean> {\n /**\n * We will load a few CMS entryes\n */\n const result = await scan<DynamoDbElasticsearchRecord>({\n entity: this.ddbEsEntryEntity,\n options: {\n filters: [\n {\n attr: \"PK\",\n contains: \"#CMS#CME#\"\n }\n ],\n limit: 100\n }\n });\n\n if (result.items.length === 0) {\n logger.info(`No CMS entries found in the system; skipping migration.`);\n return false;\n } else if (result.error) {\n logger.error(result.error);\n throw new Error(result.error);\n }\n\n for (const item of result.items) {\n const data = await getDecompressedData<CmsEntry>(item.data);\n if (!data) {\n continue;\n }\n /**\n * If no location.folderId was set, we need to push the upgrade.\n */\n if (!data.location?.folderId) {\n return true;\n }\n }\n logger.info(`CMS entries already upgraded. skipping...`);\n return false;\n }\n\n async execute({\n logger,\n ...context\n }: DataMigrationContext<CmsEntriesRootFolderDataMigrationCheckpoint>): Promise<void> {\n const migrationStatus =\n context.checkpoint || ({} as CmsEntriesRootFolderDataMigrationCheckpoint);\n\n if (migrationStatus.lastEvaluatedKey === true) {\n await this.restoreOriginalElasticsearchSettings({\n migrationStatus,\n logger\n });\n logger.info(`Migration completed, no need to start again.`);\n return;\n }\n let usingKey = \"\";\n if (migrationStatus?.lastEvaluatedKey) {\n usingKey = JSON.stringify(migrationStatus.lastEvaluatedKey);\n }\n logger.debug(`Scanning DynamoDB Elasticsearch table... ${usingKey}`);\n await ddbScanWithCallback<CmsEntry>(\n {\n entity: this.ddbEntryEntity,\n options: {\n filters: [\n {\n attr: \"TYPE\",\n beginsWith: \"cms.entry\"\n }\n ],\n startKey: migrationStatus.lastEvaluatedKey || undefined,\n limit: 500\n }\n },\n async result => {\n logger.debug(`Processing ${result.items.length} items...`);\n const ddbItems: BatchWriteItem[] = [];\n const ddbEsItems: BatchWriteItem[] = [];\n\n const ddbEsGetItems: Record<string, BatchReadItem> = {};\n /**\n * Update the DynamoDB part of the records.\n */\n for (const item of result.items) {\n const index = esGetIndexName({\n tenant: item.tenant,\n locale: item.locale,\n type: item.modelId,\n isHeadlessCmsModel: true\n });\n // Check for the elasticsearch index settings\n if (!migrationStatus.indexes || migrationStatus.indexes[index] === undefined) {\n // We need to fetch the index settings first\n const settings = await this.fetchOriginalElasticsearchSettings({\n index,\n logger\n });\n // ... add it to the checkpoint...\n migrationStatus.indexes = {\n ...migrationStatus.indexes,\n [index]: settings\n };\n // and then set not to index\n await this.disableElasticsearchIndexing({\n index,\n logger\n });\n }\n //\n ddbItems.push(\n this.ddbEntryEntity.putBatch({\n ...item,\n location: {\n ...item.location,\n folderId: item.location?.folderId || \"root\"\n }\n })\n );\n /**\n * Prepare the loading of DynamoDB Elasticsearch part of the records.\n */\n if (ddbEsGetItems[`${item.entryId}:L`]) {\n continue;\n }\n ddbEsGetItems[`${item.entryId}:L`] = this.ddbEsEntryEntity.getBatch({\n PK: item.PK,\n SK: \"L\"\n });\n if (item.status === \"published\" || !!item.locked) {\n ddbEsGetItems[`${item.entryId}:P`] = this.ddbEsEntryEntity.getBatch({\n PK: item.PK,\n SK: \"P\"\n });\n }\n }\n /**\n * Get all the records from DynamoDB Elasticsearch.\n */\n const esRecords = await batchReadAll<DynamoDbElasticsearchRecord>({\n table: this.ddbEsEntryEntity.table,\n items: Object.values(ddbEsGetItems)\n });\n for (const esRecord of esRecords) {\n const decompressedData = await getDecompressedData<CmsEntry>(esRecord.data);\n if (!decompressedData) {\n logger.trace(\n `Skipping record \"${esRecord.PK}\" as it is not a valid CMS entry...`\n );\n continue;\n } else if (!context.forceExecute && decompressedData.location?.folderId) {\n logger.trace(\n `Skipping record \"${decompressedData.entryId}\" as it already has folderId defined...`\n );\n continue;\n }\n const compressedData = await getCompressedData({\n ...decompressedData,\n location: {\n ...decompressedData.location,\n folderId: \"root\"\n }\n });\n const modified = new Date().toISOString();\n ddbEsItems.push(\n this.ddbEsEntryEntity.putBatch({\n ...esRecord,\n data: compressedData,\n modified\n })\n );\n }\n\n const execute = () => {\n return batchWriteAll({\n table: this.ddbEntryEntity.table,\n items: ddbItems\n });\n };\n\n const executeDdbEs = () => {\n return batchWriteAll({\n table: this.ddbEsEntryEntity.table,\n items: ddbEsItems\n });\n };\n\n logger.trace(\"Storing the DynamoDB records...\");\n await executeWithRetry(execute, {\n onFailedAttempt: error => {\n logger.error(\n `\"batchWriteAll\" attempt #${error.attemptNumber} failed: ${error.message}`\n );\n }\n });\n logger.trace(\"...stored.\");\n\n logger.trace(\"Storing the DynamoDB Elasticsearch records...\");\n await executeWithRetry(executeDdbEs, {\n onFailedAttempt: error => {\n logger.error(\n `\"batchWriteAll ddb + es\" attempt #${error.attemptNumber} failed: ${error.message}`\n );\n }\n });\n logger.trace(\"...stored.\");\n\n // Update checkpoint after every batch\n migrationStatus.lastEvaluatedKey = result.lastEvaluatedKey?.PK\n ? (result.lastEvaluatedKey as unknown as LastEvaluatedKey)\n : true;\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 * This is the end of the migration.\n */\n await this.restoreOriginalElasticsearchSettings({\n migrationStatus,\n logger\n });\n migrationStatus.lastEvaluatedKey = true;\n migrationStatus.indexes = {};\n context.createCheckpoint(migrationStatus);\n }\n\n private async fetchOriginalElasticsearchSettings(\n params: FetchOriginalElasticsearchSettingsParams\n ): Promise<IndexSettings | null> {\n const { index, logger } = params;\n try {\n const settings = await esGetIndexSettings({\n elasticsearchClient: this.elasticsearchClient,\n index,\n fields: [\"number_of_replicas\", \"refresh_interval\"]\n });\n return {\n number_of_replicas: settings.number_of_replicas || 1,\n refresh_interval: settings.refresh_interval || \"1s\"\n };\n } catch (ex) {\n logger.error(`Failed to fetch original Elasticsearch settings for index \"${index}\".`);\n logger.error({\n ...ex,\n message: ex.message,\n code: ex.code,\n data: ex.data\n });\n }\n return null;\n }\n\n private async restoreOriginalElasticsearchSettings(\n params: RestoreOriginalElasticsearchSettingsParams\n ): Promise<void> {\n const { migrationStatus, logger } = params;\n const indexes = migrationStatus.indexes;\n if (!indexes || typeof indexes !== \"object\") {\n return;\n }\n for (const index in indexes) {\n const settings = indexes[index];\n if (!settings || typeof settings !== \"object\") {\n continue;\n }\n try {\n await esPutIndexSettings({\n elasticsearchClient: this.elasticsearchClient,\n index,\n settings: {\n number_of_replicas: settings.number_of_replicas || 1,\n refresh_interval: settings.refresh_interval || `1s`\n }\n });\n } catch (ex) {\n logger.error(\n `Failed to restore original settings for index \"${index}\". Please do it manually.`\n );\n logger.error({\n ...ex,\n message: ex.message,\n code: ex.code,\n data: ex.data\n });\n }\n }\n }\n\n private async disableElasticsearchIndexing(\n params: DisableElasticsearchIndexingParams\n ): Promise<void> {\n const { index, logger } = params;\n\n try {\n await esPutIndexSettings({\n elasticsearchClient: this.elasticsearchClient,\n index,\n settings: {\n number_of_replicas: 0,\n refresh_interval: -1\n }\n });\n } catch (ex) {\n logger.error(`Failed to disable indexing for index \"${index}\".`);\n logger.error({\n ...ex,\n message: ex.message,\n code: ex.code,\n data: ex.data\n });\n }\n }\n}\n\nmakeInjectable(CmsEntriesRootFolder_5_37_0_002, [\n inject(PrimaryDynamoTableSymbol),\n inject(ElasticsearchDynamoTableSymbol),\n inject(ElasticsearchClientSymbol)\n]);\n"],"mappings":";;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AAQA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AAC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AAC;QACrBhG,mBAAmB,EAAE,IAAI,CAACA,mBAAmB;QAC7CgD,KAAK;QACLQ,QAAQ,EAAE;UACNoC,kBAAkB,EAAE,CAAC;UACrBC,gBAAgB,EAAE,CAAC;QACvB;MACJ,CAAC,CAAC;IACN,CAAC,CAAC,OAAOC,EAAE,EAAE;MACTlF,MAAM,CAACY,KAAK,CAAE,yCAAwCwB,KAAM,IAAG,CAAC;MAChEpC,MAAM,CAACY,KAAK,CAAC;QACT,GAAGsE,EAAE;QACLT,OAAO,EAAES,EAAE,CAACT,OAAO;QACnBU,IAAI,EAAED,EAAE,CAACC,IAAI;QACbpE,IAAI,EAAEmE,EAAE,CAACnE;MACb,CAAC,CAAC;IACN;EACJ;AACJ;AAACsE,OAAA,CAAArG,+BAAA,GAAAA,+BAAA;AAED,IAAAsG,mBAAc,EAACtG,+BAA+B,EAAE,CAC5C,IAAAuG,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
|
+
modifiedBy: {
|
|
48
|
+
type: "map"
|
|
49
|
+
},
|
|
50
|
+
createdOn: {
|
|
51
|
+
type: "string"
|
|
52
|
+
},
|
|
53
|
+
savedOn: {
|
|
54
|
+
type: "string"
|
|
55
|
+
},
|
|
56
|
+
modelId: {
|
|
57
|
+
type: "string"
|
|
58
|
+
},
|
|
59
|
+
locale: {
|
|
60
|
+
type: "string"
|
|
61
|
+
},
|
|
62
|
+
publishedOn: {
|
|
63
|
+
type: "string"
|
|
64
|
+
},
|
|
65
|
+
version: {
|
|
66
|
+
type: "number"
|
|
67
|
+
},
|
|
68
|
+
locked: {
|
|
69
|
+
type: "boolean"
|
|
70
|
+
},
|
|
71
|
+
status: {
|
|
72
|
+
type: "string"
|
|
73
|
+
},
|
|
74
|
+
values: {
|
|
75
|
+
type: "map"
|
|
76
|
+
},
|
|
77
|
+
meta: {
|
|
78
|
+
type: "map"
|
|
79
|
+
},
|
|
80
|
+
location: {
|
|
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","modifiedBy","createdOn","savedOn","modelId","locale","publishedOn","version","locked","status","values","meta","location","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 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 location: {\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;EACV,CAAC;EACDS,MAAM,EAAE;IACJT,IAAI,EAAE;EACV,CAAC;EACDU,OAAO,EAAE;IACLV,IAAI,EAAE;EACV,CAAC;EACDW,EAAE,EAAE;IACAX,IAAI,EAAE;EACV,CAAC;EACDY,SAAS,EAAE;IACPZ,IAAI,EAAE;EACV,CAAC;EACDa,OAAO,EAAE;IACLb,IAAI,EAAE;EACV,CAAC;EACDc,UAAU,EAAE;IACRd,IAAI,EAAE;EACV,CAAC;EACDe,SAAS,EAAE;IACPf,IAAI,EAAE;EACV,CAAC;EACDgB,OAAO,EAAE;IACLhB,IAAI,EAAE;EACV,CAAC;EACDiB,OAAO,EAAE;IACLjB,IAAI,EAAE;EACV,CAAC;EACDkB,MAAM,EAAE;IACJlB,IAAI,EAAE;EACV,CAAC;EACDmB,WAAW,EAAE;IACTnB,IAAI,EAAE;EACV,CAAC;EACDoB,OAAO,EAAE;IACLpB,IAAI,EAAE;EACV,CAAC;EACDqB,MAAM,EAAE;IACJrB,IAAI,EAAE;EACV,CAAC;EACDsB,MAAM,EAAE;IACJtB,IAAI,EAAE;EACV,CAAC;EACDuB,MAAM,EAAE;IACJvB,IAAI,EAAE;EACV,CAAC;EACDwB,IAAI,EAAE;IACFxB,IAAI,EAAE;EACV,CAAC;EACDyB,QAAQ,EAAE;IACNzB,IAAI,EAAE;EACV;AACJ,CAAC;AAED,MAAM0B,eAA2D,GAAG;EAChE3B,EAAE,EAAE;IACAC,IAAI,EAAE,QAAQ;IACdC,YAAY,EAAE;EAClB,CAAC;EACDC,EAAE,EAAE;IACAF,IAAI,EAAE,QAAQ;IACdG,OAAO,EAAE;EACb,CAAC;EACDwB,KAAK,EAAE;IACH3B,IAAI,EAAE;EACV,CAAC;EACD4B,IAAI,EAAE;IACF5B,IAAI,EAAE;EACV;AACJ,CAAC;AAEM,MAAM6B,oBAAoB,GAAIC,KAAoC,IAAK;EAC1E,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,YAAY,EAAEhC,aAAa,CAAC;AACjE,CAAC;AAACkC,OAAA,CAAAH,oBAAA,GAAAA,oBAAA;AAEK,MAAMI,sBAAsB,GAAIH,KAAoC,IAAK;EAC5E,OAAO,IAAAI,2BAAoB,EAACJ,KAAK,EAAE,yBAAyB,EAAEJ,eAAe,CAAC;AAClF,CAAC;AAACM,OAAA,CAAAC,sBAAA,GAAAA,sBAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
export declare const createLocaleEntity: (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
|
+
}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createLocaleEntity = void 0;
|
|
7
|
+
var _utils = require("../../../../utils");
|
|
8
|
+
const createLocaleEntity = table => {
|
|
9
|
+
return (0, _utils.createLegacyEntity)(table, "I18NLocale", {
|
|
10
|
+
createdOn: {
|
|
11
|
+
type: "string"
|
|
12
|
+
},
|
|
13
|
+
createdBy: {
|
|
14
|
+
type: "map"
|
|
15
|
+
},
|
|
16
|
+
code: {
|
|
17
|
+
type: "string"
|
|
18
|
+
},
|
|
19
|
+
default: {
|
|
20
|
+
type: "boolean"
|
|
21
|
+
},
|
|
22
|
+
webinyVersion: {
|
|
23
|
+
type: "string"
|
|
24
|
+
},
|
|
25
|
+
tenant: {
|
|
26
|
+
type: "string"
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
exports.createLocaleEntity = createLocaleEntity;
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=createLocaleEntity.js.map
|
|
@@ -0,0 +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"}
|