@webiny/migrations 5.41.4 → 5.42.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/migrations/5.41.0/001/index.js.map +1 -1
- package/package.json +18 -26
- package/utils/elasticsearch/disableEsIndexing.js.map +1 -1
- package/utils/elasticsearch/esGetIndexExist.js.map +1 -1
- package/utils/elasticsearch/esGetIndexName.js.map +1 -1
- package/utils/elasticsearch/fetchOriginalEsSettings.js.map +1 -1
- package/utils/elasticsearch/restoreOriginalEsSettings.js.map +1 -1
- package/utils/forEachTenantLocale.js.map +1 -1
- package/migrations/5.35.0/001/FileSettingsMigration.d.ts +0 -12
- package/migrations/5.35.0/001/FileSettingsMigration.js +0 -93
- package/migrations/5.35.0/001/FileSettingsMigration.js.map +0 -1
- package/migrations/5.35.0/001/ddb/FileDataMigration.d.ts +0 -14
- package/migrations/5.35.0/001/ddb/FileDataMigration.js +0 -156
- package/migrations/5.35.0/001/ddb/FileDataMigration.js.map +0 -1
- package/migrations/5.35.0/001/ddb/index.d.ts +0 -10
- package/migrations/5.35.0/001/ddb/index.js +0 -50
- package/migrations/5.35.0/001/ddb/index.js.map +0 -1
- package/migrations/5.35.0/001/ddb-es/FileDataMigration.d.ts +0 -17
- package/migrations/5.35.0/001/ddb-es/FileDataMigration.js +0 -175
- package/migrations/5.35.0/001/ddb-es/FileDataMigration.js.map +0 -1
- package/migrations/5.35.0/001/ddb-es/index.d.ts +0 -12
- package/migrations/5.35.0/001/ddb-es/index.js +0 -65
- package/migrations/5.35.0/001/ddb-es/index.js.map +0 -1
- package/migrations/5.35.0/001/entities/createFileEntity.d.ts +0 -92
- package/migrations/5.35.0/001/entities/createFileEntity.js +0 -61
- package/migrations/5.35.0/001/entities/createFileEntity.js.map +0 -1
- package/migrations/5.35.0/001/entities/createLocaleEntity.d.ts +0 -42
- package/migrations/5.35.0/001/entities/createLocaleEntity.js +0 -52
- package/migrations/5.35.0/001/entities/createLocaleEntity.js.map +0 -1
- package/migrations/5.35.0/001/entities/createSettingsEntity.d.ts +0 -90
- package/migrations/5.35.0/001/entities/createSettingsEntity.js +0 -37
- package/migrations/5.35.0/001/entities/createSettingsEntity.js.map +0 -1
- package/migrations/5.35.0/001/entities/createTenantEntity.d.ts +0 -42
- package/migrations/5.35.0/001/entities/createTenantEntity.js +0 -69
- package/migrations/5.35.0/001/entities/createTenantEntity.js.map +0 -1
- package/migrations/5.35.0/001/types.d.ts +0 -19
- package/migrations/5.35.0/001/types.js +0 -7
- package/migrations/5.35.0/001/types.js.map +0 -1
- package/migrations/5.35.0/002/createLocaleEntity.d.ts +0 -42
- package/migrations/5.35.0/002/createLocaleEntity.js +0 -32
- package/migrations/5.35.0/002/createLocaleEntity.js.map +0 -1
- package/migrations/5.35.0/002/createSettingsEntity.d.ts +0 -90
- package/migrations/5.35.0/002/createSettingsEntity.js +0 -61
- package/migrations/5.35.0/002/createSettingsEntity.js.map +0 -1
- package/migrations/5.35.0/002/createTenantEntity.d.ts +0 -42
- package/migrations/5.35.0/002/createTenantEntity.js +0 -46
- package/migrations/5.35.0/002/createTenantEntity.js.map +0 -1
- package/migrations/5.35.0/002/index.d.ts +0 -13
- package/migrations/5.35.0/002/index.js +0 -117
- package/migrations/5.35.0/002/index.js.map +0 -1
- package/migrations/5.35.0/003/createTenantEntity.d.ts +0 -42
- package/migrations/5.35.0/003/createTenantEntity.js +0 -46
- package/migrations/5.35.0/003/createTenantEntity.js.map +0 -1
- package/migrations/5.35.0/003/createUserEntity.d.ts +0 -90
- package/migrations/5.35.0/003/createUserEntity.js +0 -55
- package/migrations/5.35.0/003/createUserEntity.js.map +0 -1
- package/migrations/5.35.0/003/index.d.ts +0 -12
- package/migrations/5.35.0/003/index.js +0 -95
- package/migrations/5.35.0/003/index.js.map +0 -1
- package/migrations/5.35.0/004/createTenantEntity.d.ts +0 -90
- package/migrations/5.35.0/004/createTenantEntity.js +0 -57
- package/migrations/5.35.0/004/createTenantEntity.js.map +0 -1
- package/migrations/5.35.0/004/index.d.ts +0 -11
- package/migrations/5.35.0/004/index.js +0 -80
- package/migrations/5.35.0/004/index.js.map +0 -1
- package/migrations/5.35.0/005/createLocaleEntity.d.ts +0 -42
- package/migrations/5.35.0/005/createLocaleEntity.js +0 -32
- package/migrations/5.35.0/005/createLocaleEntity.js.map +0 -1
- package/migrations/5.35.0/005/createModelEntity.d.ts +0 -42
- package/migrations/5.35.0/005/createModelEntity.js +0 -101
- package/migrations/5.35.0/005/createModelEntity.js.map +0 -1
- package/migrations/5.35.0/005/createTenantEntity.d.ts +0 -48
- package/migrations/5.35.0/005/createTenantEntity.js +0 -13
- package/migrations/5.35.0/005/createTenantEntity.js.map +0 -1
- package/migrations/5.35.0/005/index.d.ts +0 -15
- package/migrations/5.35.0/005/index.js +0 -145
- package/migrations/5.35.0/005/index.js.map +0 -1
- package/migrations/5.35.0/005/types.d.ts +0 -42
- package/migrations/5.35.0/005/types.js +0 -7
- package/migrations/5.35.0/005/types.js.map +0 -1
- package/migrations/5.35.0/006/constants.d.ts +0 -3
- package/migrations/5.35.0/006/constants.js +0 -11
- package/migrations/5.35.0/006/constants.js.map +0 -1
- package/migrations/5.35.0/006/ddb/PageDataMigration.d.ts +0 -17
- package/migrations/5.35.0/006/ddb/PageDataMigration.js +0 -249
- package/migrations/5.35.0/006/ddb/PageDataMigration.js.map +0 -1
- package/migrations/5.35.0/006/ddb/index.d.ts +0 -10
- package/migrations/5.35.0/006/ddb/index.js +0 -49
- package/migrations/5.35.0/006/ddb/index.js.map +0 -1
- package/migrations/5.35.0/006/ddb-es/PageDataMigration.d.ts +0 -22
- package/migrations/5.35.0/006/ddb-es/PageDataMigration.js +0 -413
- package/migrations/5.35.0/006/ddb-es/PageDataMigration.js.map +0 -1
- package/migrations/5.35.0/006/ddb-es/index.d.ts +0 -12
- package/migrations/5.35.0/006/ddb-es/index.js +0 -64
- package/migrations/5.35.0/006/ddb-es/index.js.map +0 -1
- package/migrations/5.35.0/006/entities/createEntryEntity.d.ts +0 -89
- package/migrations/5.35.0/006/entities/createEntryEntity.js +0 -106
- package/migrations/5.35.0/006/entities/createEntryEntity.js.map +0 -1
- package/migrations/5.35.0/006/entities/createLocaleEntity.d.ts +0 -42
- package/migrations/5.35.0/006/entities/createLocaleEntity.js +0 -32
- package/migrations/5.35.0/006/entities/createLocaleEntity.js.map +0 -1
- package/migrations/5.35.0/006/entities/createPageEntity.d.ts +0 -89
- package/migrations/5.35.0/006/entities/createPageEntity.js +0 -113
- package/migrations/5.35.0/006/entities/createPageEntity.js.map +0 -1
- package/migrations/5.35.0/006/entities/createTenantEntity.d.ts +0 -48
- package/migrations/5.35.0/006/entities/createTenantEntity.js +0 -13
- package/migrations/5.35.0/006/entities/createTenantEntity.js.map +0 -1
- package/migrations/5.35.0/006/types.d.ts +0 -91
- package/migrations/5.35.0/006/types.js +0 -7
- package/migrations/5.35.0/006/types.js.map +0 -1
- package/migrations/5.35.0/006/utils/getCompressedData.d.ts +0 -4
- package/migrations/5.35.0/006/utils/getCompressedData.js +0 -19
- package/migrations/5.35.0/006/utils/getCompressedData.js.map +0 -1
- package/migrations/5.35.0/006/utils/getLexicalContentText.d.ts +0 -1
- package/migrations/5.35.0/006/utils/getLexicalContentText.js +0 -29
- package/migrations/5.35.0/006/utils/getLexicalContentText.js.map +0 -1
- package/migrations/5.35.0/006/utils/getSearchableContent.d.ts +0 -6
- package/migrations/5.35.0/006/utils/getSearchableContent.js +0 -45
- package/migrations/5.35.0/006/utils/getSearchableContent.js.map +0 -1
- package/migrations/5.35.0/006/utils/processors/button.d.ts +0 -1
- package/migrations/5.35.0/006/utils/processors/button.js +0 -17
- package/migrations/5.35.0/006/utils/processors/button.js.map +0 -1
- package/migrations/5.35.0/006/utils/processors/image.d.ts +0 -1
- package/migrations/5.35.0/006/utils/processors/image.js +0 -17
- package/migrations/5.35.0/006/utils/processors/image.js.map +0 -1
- package/migrations/5.35.0/006/utils/processors/images.d.ts +0 -1
- package/migrations/5.35.0/006/utils/processors/images.js +0 -18
- package/migrations/5.35.0/006/utils/processors/images.js.map +0 -1
- package/migrations/5.35.0/006/utils/processors/index.d.ts +0 -1
- package/migrations/5.35.0/006/utils/processors/index.js +0 -13
- package/migrations/5.35.0/006/utils/processors/index.js.map +0 -1
- package/migrations/5.35.0/006/utils/processors/paragraph.d.ts +0 -1
- package/migrations/5.35.0/006/utils/processors/paragraph.js +0 -25
- package/migrations/5.35.0/006/utils/processors/paragraph.js.map +0 -1
- package/migrations/5.36.0/001/constants.d.ts +0 -3
- package/migrations/5.36.0/001/constants.js +0 -11
- package/migrations/5.36.0/001/constants.js.map +0 -1
- package/migrations/5.36.0/001/ddb/FileDataMigration.d.ts +0 -17
- package/migrations/5.36.0/001/ddb/FileDataMigration.js +0 -241
- package/migrations/5.36.0/001/ddb/FileDataMigration.js.map +0 -1
- package/migrations/5.36.0/001/ddb/index.d.ts +0 -10
- package/migrations/5.36.0/001/ddb/index.js +0 -49
- package/migrations/5.36.0/001/ddb/index.js.map +0 -1
- package/migrations/5.36.0/001/ddb-es/FileDataMigration.d.ts +0 -20
- package/migrations/5.36.0/001/ddb-es/FileDataMigration.js +0 -405
- package/migrations/5.36.0/001/ddb-es/FileDataMigration.js.map +0 -1
- package/migrations/5.36.0/001/ddb-es/index.d.ts +0 -12
- package/migrations/5.36.0/001/ddb-es/index.js +0 -64
- package/migrations/5.36.0/001/ddb-es/index.js.map +0 -1
- package/migrations/5.36.0/001/entities/createEntryEntity.d.ts +0 -89
- package/migrations/5.36.0/001/entities/createEntryEntity.js +0 -106
- package/migrations/5.36.0/001/entities/createEntryEntity.js.map +0 -1
- package/migrations/5.36.0/001/entities/createFileEntity.d.ts +0 -95
- package/migrations/5.36.0/001/entities/createFileEntity.js +0 -33
- package/migrations/5.36.0/001/entities/createFileEntity.js.map +0 -1
- package/migrations/5.36.0/001/entities/createLocaleEntity.d.ts +0 -42
- package/migrations/5.36.0/001/entities/createLocaleEntity.js +0 -32
- package/migrations/5.36.0/001/entities/createLocaleEntity.js.map +0 -1
- package/migrations/5.36.0/001/entities/createTenantEntity.d.ts +0 -48
- package/migrations/5.36.0/001/entities/createTenantEntity.js +0 -13
- package/migrations/5.36.0/001/entities/createTenantEntity.js.map +0 -1
- package/migrations/5.36.0/001/types.d.ts +0 -67
- package/migrations/5.36.0/001/types.js +0 -7
- package/migrations/5.36.0/001/types.js.map +0 -1
- package/migrations/5.36.0/001/utils/createMimeTag.d.ts +0 -1
- package/migrations/5.36.0/001/utils/createMimeTag.js +0 -10
- package/migrations/5.36.0/001/utils/createMimeTag.js.map +0 -1
- package/migrations/5.36.0/001/utils/getCompressedData.d.ts +0 -4
- package/migrations/5.36.0/001/utils/getCompressedData.js +0 -19
- package/migrations/5.36.0/001/utils/getCompressedData.js.map +0 -1
- package/migrations/5.37.0/001/TenantLinkDataMigration.d.ts +0 -14
- package/migrations/5.37.0/001/TenantLinkDataMigration.js +0 -106
- package/migrations/5.37.0/001/TenantLinkDataMigration.js.map +0 -1
- package/migrations/5.37.0/001/entities/createTenantEntity.d.ts +0 -48
- package/migrations/5.37.0/001/entities/createTenantEntity.js +0 -13
- package/migrations/5.37.0/001/entities/createTenantEntity.js.map +0 -1
- package/migrations/5.37.0/001/entities/createTenantLinkEntity.d.ts +0 -48
- package/migrations/5.37.0/001/entities/createTenantLinkEntity.js +0 -17
- package/migrations/5.37.0/001/entities/createTenantLinkEntity.js.map +0 -1
- package/migrations/5.37.0/001/index.d.ts +0 -10
- package/migrations/5.37.0/001/index.js +0 -49
- package/migrations/5.37.0/001/index.js.map +0 -1
- package/migrations/5.37.0/001/types.d.ts +0 -25
- package/migrations/5.37.0/001/types.js +0 -7
- package/migrations/5.37.0/001/types.js.map +0 -1
- package/migrations/5.37.0/001/utils/isMigratedTenantLink.d.ts +0 -2
- package/migrations/5.37.0/001/utils/isMigratedTenantLink.js +0 -12
- package/migrations/5.37.0/001/utils/isMigratedTenantLink.js.map +0 -1
- package/migrations/5.37.0/002/constants.d.ts +0 -1
- package/migrations/5.37.0/002/constants.js +0 -9
- package/migrations/5.37.0/002/constants.js.map +0 -1
- package/migrations/5.37.0/002/ddb/index.d.ts +0 -22
- package/migrations/5.37.0/002/ddb/index.js +0 -133
- package/migrations/5.37.0/002/ddb/index.js.map +0 -1
- package/migrations/5.37.0/002/ddb-es/index.d.ts +0 -35
- package/migrations/5.37.0/002/ddb-es/index.js +0 -321
- package/migrations/5.37.0/002/ddb-es/index.js.map +0 -1
- package/migrations/5.37.0/002/entities/createEntryEntity.d.ts +0 -89
- package/migrations/5.37.0/002/entities/createEntryEntity.js +0 -109
- package/migrations/5.37.0/002/entities/createEntryEntity.js.map +0 -1
- package/migrations/5.37.0/002/entities/createLocaleEntity.d.ts +0 -42
- package/migrations/5.37.0/002/entities/createLocaleEntity.js +0 -32
- package/migrations/5.37.0/002/entities/createLocaleEntity.js.map +0 -1
- package/migrations/5.37.0/002/entities/createTenantEntity.d.ts +0 -48
- package/migrations/5.37.0/002/entities/createTenantEntity.js +0 -13
- package/migrations/5.37.0/002/entities/createTenantEntity.js.map +0 -1
- package/migrations/5.37.0/002/types.d.ts +0 -53
- package/migrations/5.37.0/002/types.js +0 -7
- package/migrations/5.37.0/002/types.js.map +0 -1
- package/migrations/5.37.0/002/utils/getCompressedData.d.ts +0 -4
- package/migrations/5.37.0/002/utils/getCompressedData.js +0 -19
- package/migrations/5.37.0/002/utils/getCompressedData.js.map +0 -1
- package/migrations/5.37.0/002/utils/getDecompressedData.d.ts +0 -1
- package/migrations/5.37.0/002/utils/getDecompressedData.js +0 -31
- package/migrations/5.37.0/002/utils/getDecompressedData.js.map +0 -1
- package/migrations/5.37.0/003/constants.d.ts +0 -3
- package/migrations/5.37.0/003/constants.js +0 -11
- package/migrations/5.37.0/003/constants.js.map +0 -1
- package/migrations/5.37.0/003/ddb/AcoFolderMigration.d.ts +0 -15
- package/migrations/5.37.0/003/ddb/AcoFolderMigration.js +0 -179
- package/migrations/5.37.0/003/ddb/AcoFolderMigration.js.map +0 -1
- package/migrations/5.37.0/003/ddb/index.d.ts +0 -10
- package/migrations/5.37.0/003/ddb/index.js +0 -49
- package/migrations/5.37.0/003/ddb/index.js.map +0 -1
- package/migrations/5.37.0/003/ddb-es/AcoFolderMigration.d.ts +0 -20
- package/migrations/5.37.0/003/ddb-es/AcoFolderMigration.js +0 -313
- package/migrations/5.37.0/003/ddb-es/AcoFolderMigration.js.map +0 -1
- package/migrations/5.37.0/003/ddb-es/index.d.ts +0 -12
- package/migrations/5.37.0/003/ddb-es/index.js +0 -64
- package/migrations/5.37.0/003/ddb-es/index.js.map +0 -1
- package/migrations/5.37.0/003/ddb-es/latestElasticsearchData.d.ts +0 -4
- package/migrations/5.37.0/003/ddb-es/latestElasticsearchData.js +0 -30
- package/migrations/5.37.0/003/ddb-es/latestElasticsearchData.js.map +0 -1
- package/migrations/5.37.0/003/entities/createEntryEntity.d.ts +0 -89
- package/migrations/5.37.0/003/entities/createEntryEntity.js +0 -109
- package/migrations/5.37.0/003/entities/createEntryEntity.js.map +0 -1
- package/migrations/5.37.0/003/entities/createLocaleEntity.d.ts +0 -42
- package/migrations/5.37.0/003/entities/createLocaleEntity.js +0 -32
- package/migrations/5.37.0/003/entities/createLocaleEntity.js.map +0 -1
- package/migrations/5.37.0/003/entities/createTenantEntity.d.ts +0 -48
- package/migrations/5.37.0/003/entities/createTenantEntity.js +0 -13
- package/migrations/5.37.0/003/entities/createTenantEntity.js.map +0 -1
- package/migrations/5.37.0/003/types.d.ts +0 -46
- package/migrations/5.37.0/003/types.js +0 -7
- package/migrations/5.37.0/003/types.js.map +0 -1
- package/migrations/5.37.0/003/utils/getCompressedData.d.ts +0 -4
- package/migrations/5.37.0/003/utils/getCompressedData.js +0 -19
- package/migrations/5.37.0/003/utils/getCompressedData.js.map +0 -1
- package/migrations/5.37.0/003/utils/getDecompressedData.d.ts +0 -1
- package/migrations/5.37.0/003/utils/getDecompressedData.js +0 -31
- package/migrations/5.37.0/003/utils/getDecompressedData.js.map +0 -1
- package/migrations/5.37.0/004/constants.d.ts +0 -7
- package/migrations/5.37.0/004/constants.js +0 -15
- package/migrations/5.37.0/004/constants.js.map +0 -1
- package/migrations/5.37.0/004/ddb/PageDataMigration.d.ts +0 -17
- package/migrations/5.37.0/004/ddb/PageDataMigration.js +0 -269
- package/migrations/5.37.0/004/ddb/PageDataMigration.js.map +0 -1
- package/migrations/5.37.0/004/ddb/index.d.ts +0 -10
- package/migrations/5.37.0/004/ddb/index.js +0 -49
- package/migrations/5.37.0/004/ddb/index.js.map +0 -1
- package/migrations/5.37.0/004/ddb-es/PageDataMigration.d.ts +0 -22
- package/migrations/5.37.0/004/ddb-es/PageDataMigration.js +0 -364
- package/migrations/5.37.0/004/ddb-es/PageDataMigration.js.map +0 -1
- package/migrations/5.37.0/004/ddb-es/index.d.ts +0 -12
- package/migrations/5.37.0/004/ddb-es/index.js +0 -64
- package/migrations/5.37.0/004/ddb-es/index.js.map +0 -1
- package/migrations/5.37.0/004/entities/createEntryEntity.d.ts +0 -89
- package/migrations/5.37.0/004/entities/createEntryEntity.js +0 -109
- package/migrations/5.37.0/004/entities/createEntryEntity.js.map +0 -1
- package/migrations/5.37.0/004/entities/createLocaleEntity.d.ts +0 -42
- package/migrations/5.37.0/004/entities/createLocaleEntity.js +0 -32
- package/migrations/5.37.0/004/entities/createLocaleEntity.js.map +0 -1
- package/migrations/5.37.0/004/entities/createPageEntity.d.ts +0 -89
- package/migrations/5.37.0/004/entities/createPageEntity.js +0 -113
- package/migrations/5.37.0/004/entities/createPageEntity.js.map +0 -1
- package/migrations/5.37.0/004/entities/createTenantEntity.d.ts +0 -48
- package/migrations/5.37.0/004/entities/createTenantEntity.js +0 -13
- package/migrations/5.37.0/004/entities/createTenantEntity.js.map +0 -1
- package/migrations/5.37.0/004/types.d.ts +0 -149
- package/migrations/5.37.0/004/types.js +0 -7
- package/migrations/5.37.0/004/types.js.map +0 -1
- package/migrations/5.37.0/004/utils/getCompressedData.d.ts +0 -4
- package/migrations/5.37.0/004/utils/getCompressedData.js +0 -19
- package/migrations/5.37.0/004/utils/getCompressedData.js.map +0 -1
- package/migrations/5.37.0/005/constants.d.ts +0 -3
- package/migrations/5.37.0/005/constants.js +0 -11
- package/migrations/5.37.0/005/constants.js.map +0 -1
- package/migrations/5.37.0/005/ddb/index.d.ts +0 -20
- package/migrations/5.37.0/005/ddb/index.js +0 -245
- package/migrations/5.37.0/005/ddb/index.js.map +0 -1
- package/migrations/5.37.0/005/ddb-es/index.d.ts +0 -22
- package/migrations/5.37.0/005/ddb-es/index.js +0 -382
- package/migrations/5.37.0/005/ddb-es/index.js.map +0 -1
- package/migrations/5.37.0/005/entities/createEntryEntity.d.ts +0 -89
- package/migrations/5.37.0/005/entities/createEntryEntity.js +0 -109
- package/migrations/5.37.0/005/entities/createEntryEntity.js.map +0 -1
- package/migrations/5.37.0/005/entities/createFileEntity.d.ts +0 -95
- package/migrations/5.37.0/005/entities/createFileEntity.js +0 -33
- package/migrations/5.37.0/005/entities/createFileEntity.js.map +0 -1
- package/migrations/5.37.0/005/entities/createLocaleEntity.d.ts +0 -42
- package/migrations/5.37.0/005/entities/createLocaleEntity.js +0 -32
- package/migrations/5.37.0/005/entities/createLocaleEntity.js.map +0 -1
- package/migrations/5.37.0/005/entities/createTenantEntity.d.ts +0 -48
- package/migrations/5.37.0/005/entities/createTenantEntity.js +0 -13
- package/migrations/5.37.0/005/entities/createTenantEntity.js.map +0 -1
- package/migrations/5.37.0/005/entities/createTenantLinkEntity.d.ts +0 -48
- package/migrations/5.37.0/005/entities/createTenantLinkEntity.js +0 -17
- package/migrations/5.37.0/005/entities/createTenantLinkEntity.js.map +0 -1
- package/migrations/5.37.0/005/types.d.ts +0 -109
- package/migrations/5.37.0/005/types.js +0 -7
- package/migrations/5.37.0/005/types.js.map +0 -1
- package/migrations/5.38.0/001/ddb/index.d.ts +0 -11
- package/migrations/5.38.0/001/ddb/index.js +0 -116
- package/migrations/5.38.0/001/ddb/index.js.map +0 -1
- package/migrations/5.38.0/001/ddb-es/index.d.ts +0 -13
- package/migrations/5.38.0/001/ddb-es/index.js +0 -211
- package/migrations/5.38.0/001/ddb-es/index.js.map +0 -1
- package/migrations/5.38.0/001/entities/createFormEntity.d.ts +0 -42
- package/migrations/5.38.0/001/entities/createFormEntity.js +0 -92
- package/migrations/5.38.0/001/entities/createFormEntity.js.map +0 -1
- package/migrations/5.38.0/001/types.d.ts +0 -11
- package/migrations/5.38.0/001/types.js +0 -7
- package/migrations/5.38.0/001/types.js.map +0 -1
- package/migrations/5.38.0/002/ddb/index.d.ts +0 -22
- package/migrations/5.38.0/002/ddb/index.js +0 -140
- package/migrations/5.38.0/002/ddb/index.js.map +0 -1
- package/migrations/5.38.0/002/ddb-es/index.d.ts +0 -31
- package/migrations/5.38.0/002/ddb-es/index.js +0 -250
- package/migrations/5.38.0/002/ddb-es/index.js.map +0 -1
- package/migrations/5.38.0/002/entities/createFormEntity.d.ts +0 -42
- package/migrations/5.38.0/002/entities/createFormEntity.js +0 -92
- package/migrations/5.38.0/002/entities/createFormEntity.js.map +0 -1
- package/migrations/5.38.0/002/entities/createFormSubmissionDdbEsEntity.d.ts +0 -48
- package/migrations/5.38.0/002/entities/createFormSubmissionDdbEsEntity.js +0 -29
- package/migrations/5.38.0/002/entities/createFormSubmissionDdbEsEntity.js.map +0 -1
- package/migrations/5.38.0/002/entities/createFormSubmissionEntity.d.ts +0 -42
- package/migrations/5.38.0/002/entities/createFormSubmissionEntity.js +0 -56
- package/migrations/5.38.0/002/entities/createFormSubmissionEntity.js.map +0 -1
- package/migrations/5.38.0/002/types.d.ts +0 -23
- package/migrations/5.38.0/002/types.js +0 -7
- package/migrations/5.38.0/002/types.js.map +0 -1
- package/migrations/5.38.0/003/ddb/compressContent.d.ts +0 -4
- package/migrations/5.38.0/003/ddb/compressContent.js +0 -17
- package/migrations/5.38.0/003/ddb/compressContent.js.map +0 -1
- package/migrations/5.38.0/003/ddb/index.d.ts +0 -12
- package/migrations/5.38.0/003/ddb/index.js +0 -143
- package/migrations/5.38.0/003/ddb/index.js.map +0 -1
- package/migrations/5.38.0/003/entities/createPageBlockEntity.d.ts +0 -83
- package/migrations/5.38.0/003/entities/createPageBlockEntity.js +0 -68
- package/migrations/5.38.0/003/entities/createPageBlockEntity.js.map +0 -1
- package/migrations/5.38.0/003/types.d.ts +0 -8
- package/migrations/5.38.0/003/types.js +0 -7
- package/migrations/5.38.0/003/types.js.map +0 -1
- package/migrations/5.39.0/001/ddb/index.d.ts +0 -20
- package/migrations/5.39.0/001/ddb/index.js +0 -136
- package/migrations/5.39.0/001/ddb/index.js.map +0 -1
- package/migrations/5.39.0/001/ddb-es/index.d.ts +0 -29
- package/migrations/5.39.0/001/ddb-es/index.js +0 -266
- package/migrations/5.39.0/001/ddb-es/index.js.map +0 -1
- package/migrations/5.39.0/001/entities/createEntryEntity.d.ts +0 -89
- package/migrations/5.39.0/001/entities/createEntryEntity.js +0 -188
- package/migrations/5.39.0/001/entities/createEntryEntity.js.map +0 -1
- package/migrations/5.39.0/001/types.d.ts +0 -136
- package/migrations/5.39.0/001/types.js +0 -7
- package/migrations/5.39.0/001/types.js.map +0 -1
- package/migrations/5.39.0/001/utils/assignNewMetaFields.d.ts +0 -11
- package/migrations/5.39.0/001/utils/assignNewMetaFields.js +0 -44
- package/migrations/5.39.0/001/utils/assignNewMetaFields.js.map +0 -1
- package/migrations/5.39.0/001/utils/ensureAllNonNullableValues.d.ts +0 -8
- package/migrations/5.39.0/001/utils/ensureAllNonNullableValues.js +0 -38
- package/migrations/5.39.0/001/utils/ensureAllNonNullableValues.js.map +0 -1
- package/migrations/5.39.0/001/utils/fixTypeFieldValue.d.ts +0 -3
- package/migrations/5.39.0/001/utils/fixTypeFieldValue.js +0 -33
- package/migrations/5.39.0/001/utils/fixTypeFieldValue.js.map +0 -1
- package/migrations/5.39.0/001/utils/getCompressedData.d.ts +0 -4
- package/migrations/5.39.0/001/utils/getCompressedData.js +0 -19
- package/migrations/5.39.0/001/utils/getCompressedData.js.map +0 -1
- package/migrations/5.39.0/001/utils/getDecompressedData.d.ts +0 -1
- package/migrations/5.39.0/001/utils/getDecompressedData.js +0 -31
- package/migrations/5.39.0/001/utils/getDecompressedData.js.map +0 -1
- package/migrations/5.39.0/001/utils/getFallbackIdentity.d.ts +0 -10
- package/migrations/5.39.0/001/utils/getFallbackIdentity.js +0 -49
- package/migrations/5.39.0/001/utils/getFallbackIdentity.js.map +0 -1
- package/migrations/5.39.0/001/utils/getFirstLastPublishedOn.d.ts +0 -13
- package/migrations/5.39.0/001/utils/getFirstLastPublishedOn.js +0 -44
- package/migrations/5.39.0/001/utils/getFirstLastPublishedOn.js.map +0 -1
- package/migrations/5.39.0/001/utils/getNonNullableFieldsWithMissingValues.d.ts +0 -2
- package/migrations/5.39.0/001/utils/getNonNullableFieldsWithMissingValues.js +0 -22
- package/migrations/5.39.0/001/utils/getNonNullableFieldsWithMissingValues.js.map +0 -1
- package/migrations/5.39.0/001/utils/getOldestRevisionCreatedOn.d.ts +0 -13
- package/migrations/5.39.0/001/utils/getOldestRevisionCreatedOn.js +0 -37
- package/migrations/5.39.0/001/utils/getOldestRevisionCreatedOn.js.map +0 -1
- package/migrations/5.39.0/001/utils/hasAllNonNullableValues.d.ts +0 -2
- package/migrations/5.39.0/001/utils/hasAllNonNullableValues.js +0 -21
- package/migrations/5.39.0/001/utils/hasAllNonNullableValues.js.map +0 -1
- package/migrations/5.39.0/001/utils/hasValidTypeFieldValue.d.ts +0 -4
- package/migrations/5.39.0/001/utils/hasValidTypeFieldValue.js +0 -21
- package/migrations/5.39.0/001/utils/hasValidTypeFieldValue.js.map +0 -1
- package/migrations/5.39.0/001/utils/isMigratedEntry.d.ts +0 -2
- package/migrations/5.39.0/001/utils/isMigratedEntry.js +0 -12
- package/migrations/5.39.0/001/utils/isMigratedEntry.js.map +0 -1
- package/migrations/5.39.0/002/ddb/FileManager_5_39_0_002.d.ts +0 -14
- package/migrations/5.39.0/002/ddb/FileManager_5_39_0_002.js +0 -133
- package/migrations/5.39.0/002/ddb/FileManager_5_39_0_002.js.map +0 -1
- package/migrations/5.39.0/002/ddb/index.d.ts +0 -1
- package/migrations/5.39.0/002/ddb/index.js +0 -18
- package/migrations/5.39.0/002/ddb/index.js.map +0 -1
- package/migrations/5.39.0/002/ddb-es/FileManager_5_39_0_002.d.ts +0 -15
- package/migrations/5.39.0/002/ddb-es/FileManager_5_39_0_002.js +0 -190
- package/migrations/5.39.0/002/ddb-es/FileManager_5_39_0_002.js.map +0 -1
- package/migrations/5.39.0/002/ddb-es/index.d.ts +0 -1
- package/migrations/5.39.0/002/ddb-es/index.js +0 -18
- package/migrations/5.39.0/002/ddb-es/index.js.map +0 -1
- package/migrations/5.39.0/002/utils/FileMetadata.d.ts +0 -12
- package/migrations/5.39.0/002/utils/FileMetadata.js +0 -55
- package/migrations/5.39.0/002/utils/FileMetadata.js.map +0 -1
- package/migrations/5.39.0/002/utils/createFileEntity.d.ts +0 -53
- package/migrations/5.39.0/002/utils/createFileEntity.js +0 -50
- package/migrations/5.39.0/002/utils/createFileEntity.js.map +0 -1
- package/migrations/5.39.0/002/utils/createLocaleEntity.d.ts +0 -42
- package/migrations/5.39.0/002/utils/createLocaleEntity.js +0 -32
- package/migrations/5.39.0/002/utils/createLocaleEntity.js.map +0 -1
- package/migrations/5.39.0/002/utils/createTenantEntity.d.ts +0 -48
- package/migrations/5.39.0/002/utils/createTenantEntity.js +0 -13
- package/migrations/5.39.0/002/utils/createTenantEntity.js.map +0 -1
- package/migrations/5.39.2/001/ddb-es/index.d.ts +0 -29
- package/migrations/5.39.2/001/ddb-es/index.js +0 -276
- package/migrations/5.39.2/001/ddb-es/index.js.map +0 -1
- package/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.d.ts +0 -21
- package/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.js +0 -172
- package/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.js.map +0 -1
- package/migrations/5.39.6/001/ddb-es/SegmentProcessor.d.ts +0 -23
- package/migrations/5.39.6/001/ddb-es/SegmentProcessor.js +0 -31
- package/migrations/5.39.6/001/ddb-es/SegmentProcessor.js.map +0 -1
- package/migrations/5.39.6/001/ddb-es/bin.d.ts +0 -2
- package/migrations/5.39.6/001/ddb-es/bin.js +0 -83
- package/migrations/5.39.6/001/ddb-es/bin.js.map +0 -1
- package/migrations/5.39.6/001/ddb-es/createMetaFieldsDataMigrationDeploymentHook.d.ts +0 -11
- package/migrations/5.39.6/001/ddb-es/createMetaFieldsDataMigrationDeploymentHook.js +0 -83
- package/migrations/5.39.6/001/ddb-es/createMetaFieldsDataMigrationDeploymentHook.js.map +0 -1
- package/migrations/5.39.6/001/ddb-es/index.d.ts +0 -29
- package/migrations/5.39.6/001/ddb-es/index.js +0 -329
- package/migrations/5.39.6/001/ddb-es/index.js.map +0 -1
- package/migrations/5.39.6/001/ddb-es/utils.d.ts +0 -28
- package/migrations/5.39.6/001/ddb-es/utils.js +0 -60
- package/migrations/5.39.6/001/ddb-es/utils.js.map +0 -1
- package/migrations/5.39.6/001/ddb-es/worker.d.ts +0 -1
- package/migrations/5.39.6/001/ddb-es/worker.js +0 -465
- package/migrations/5.39.6/001/ddb-es/worker.js.map +0 -1
- package/migrations/5.40.0/001/ddb/compression.d.ts +0 -15
- package/migrations/5.40.0/001/ddb/compression.js +0 -42
- package/migrations/5.40.0/001/ddb/compression.js.map +0 -1
- package/migrations/5.40.0/001/ddb/createBlockEntity.d.ts +0 -42
- package/migrations/5.40.0/001/ddb/createBlockEntity.js +0 -54
- package/migrations/5.40.0/001/ddb/createBlockEntity.js.map +0 -1
- package/migrations/5.40.0/001/ddb/index.d.ts +0 -13
- package/migrations/5.40.0/001/ddb/index.js +0 -158
- package/migrations/5.40.0/001/ddb/index.js.map +0 -1
- package/migrations/5.40.0/001/ddb/types.d.ts +0 -20
- package/migrations/5.40.0/001/ddb/types.js +0 -7
- package/migrations/5.40.0/001/ddb/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_dataMigration","require","_utils","_createTenantEntity","_createUserEntity","_ioc","_utils2","_dbDynamodb","AdminUsers_5_41_0_001","constructor","table","newUserEntity","createUserEntity","tenantEntity","createTenantEntity","getId","getDescription","shouldExecute","logger","user","queryOne","entity","partitionKey","options","index","gt","info","Array","isArray","data","groups","execute","tenants","queryAll","tenant","users","id","length","newUsersEntityBatch","createEntityWriteBatch","put","filter","map","group","Boolean","teams","team","executeWithRetry","exports","makeInjectable","inject","PrimaryDynamoTableSymbol"],"sources":["index.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { DataMigrationContext, PrimaryDynamoTableSymbol } from \"@webiny/data-migration\";\nimport { queryAll, queryOne } from \"~/utils\";\nimport { createTenantEntity } from \"./createTenantEntity\";\nimport { createUserEntity } from \"./createUserEntity\";\nimport { inject, makeInjectable } from \"@webiny/ioc\";\nimport { executeWithRetry } from \"@webiny/utils\";\nimport { createEntityWriteBatch } from \"@webiny/db-dynamodb\";\n\nexport class AdminUsers_5_41_0_001 {\n private readonly newUserEntity: ReturnType<typeof createUserEntity>;\n private readonly tenantEntity: ReturnType<typeof createTenantEntity>;\n\n constructor(table: Table<string, string, string>) {\n this.newUserEntity = createUserEntity(table);\n this.tenantEntity = createTenantEntity(table);\n }\n\n getId() {\n return \"5.41.0-001\";\n }\n\n getDescription() {\n return \"Introduce 'groups' and 'teams` properties (old 'group' and 'team' are no longer in use)\";\n }\n\n async shouldExecute({ logger }: DataMigrationContext): Promise<boolean> {\n const user = await queryOne<{ data: any }>({\n entity: this.newUserEntity,\n partitionKey: `T#root#ADMIN_USERS`,\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n if (!user) {\n logger.info(`No users were found; skipping migration.`);\n return false;\n }\n\n if (Array.isArray(user.data.groups)) {\n logger.info(`User records seems to be in order; skipping migration.`);\n return false;\n }\n\n return true;\n }\n\n async execute({ logger }: DataMigrationContext): Promise<void> {\n const tenants = await queryAll<{ data: { id: string; name: string } }>({\n entity: this.tenantEntity,\n partitionKey: \"TENANTS\",\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n for (const tenant of tenants) {\n const users = await queryAll<{ id: string; email: string; data?: any }>({\n entity: this.newUserEntity,\n partitionKey: `T#${tenant.data.id}#ADMIN_USERS`,\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n if (users.length === 0) {\n logger.info(`No users found on tenant \"${tenant.data.id}\".`);\n continue;\n }\n\n const newUsersEntityBatch = createEntityWriteBatch({\n entity: this.newUserEntity,\n put: users\n .filter(user => !Array.isArray(user.data.groups))\n .map(user => {\n return {\n ...user,\n data: {\n ...user.data,\n groups: [user.data.group].filter(Boolean),\n teams: [user.data.team].filter(Boolean)\n }\n };\n })\n });\n\n await executeWithRetry(async () => {\n return await newUsersEntityBatch.execute();\n });\n }\n }\n}\n\nmakeInjectable(AdminUsers_5_41_0_001, [inject(PrimaryDynamoTableSymbol)]);\n"],"mappings":";;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAEO,MAAMO,qBAAqB,CAAC;EAI/BC,WAAWA,CAACC,KAAoC,EAAE;IAC9C,IAAI,CAACC,aAAa,GAAG,IAAAC,kCAAgB,EAACF,KAAK,CAAC;IAC5C,IAAI,CAACG,YAAY,GAAG,IAAAC,sCAAkB,EAACJ,KAAK,CAAC;EACjD;EAEAK,KAAKA,CAAA,EAAG;IACJ,OAAO,YAAY;EACvB;EAEAC,cAAcA,CAAA,EAAG;IACb,OAAO,yFAAyF;EACpG;EAEA,MAAMC,aAAaA,CAAC;IAAEC;EAA6B,CAAC,EAAoB;IACpE,MAAMC,IAAI,GAAG,MAAM,IAAAC,eAAQ,EAAgB;MACvCC,MAAM,EAAE,IAAI,CAACV,aAAa;MAC1BW,YAAY,
|
|
1
|
+
{"version":3,"names":["_dataMigration","require","_utils","_createTenantEntity","_createUserEntity","_ioc","_utils2","_dbDynamodb","AdminUsers_5_41_0_001","constructor","table","newUserEntity","createUserEntity","tenantEntity","createTenantEntity","getId","getDescription","shouldExecute","logger","user","queryOne","entity","partitionKey","options","index","gt","info","Array","isArray","data","groups","execute","tenants","queryAll","tenant","users","id","length","newUsersEntityBatch","createEntityWriteBatch","put","filter","map","group","Boolean","teams","team","executeWithRetry","exports","makeInjectable","inject","PrimaryDynamoTableSymbol"],"sources":["index.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { DataMigrationContext, PrimaryDynamoTableSymbol } from \"@webiny/data-migration\";\nimport { queryAll, queryOne } from \"~/utils\";\nimport { createTenantEntity } from \"./createTenantEntity\";\nimport { createUserEntity } from \"./createUserEntity\";\nimport { inject, makeInjectable } from \"@webiny/ioc\";\nimport { executeWithRetry } from \"@webiny/utils\";\nimport { createEntityWriteBatch } from \"@webiny/db-dynamodb\";\n\nexport class AdminUsers_5_41_0_001 {\n private readonly newUserEntity: ReturnType<typeof createUserEntity>;\n private readonly tenantEntity: ReturnType<typeof createTenantEntity>;\n\n constructor(table: Table<string, string, string>) {\n this.newUserEntity = createUserEntity(table);\n this.tenantEntity = createTenantEntity(table);\n }\n\n getId() {\n return \"5.41.0-001\";\n }\n\n getDescription() {\n return \"Introduce 'groups' and 'teams` properties (old 'group' and 'team' are no longer in use)\";\n }\n\n async shouldExecute({ logger }: DataMigrationContext): Promise<boolean> {\n const user = await queryOne<{ data: any }>({\n entity: this.newUserEntity,\n partitionKey: `T#root#ADMIN_USERS`,\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n if (!user) {\n logger.info(`No users were found; skipping migration.`);\n return false;\n }\n\n if (Array.isArray(user.data.groups)) {\n logger.info(`User records seems to be in order; skipping migration.`);\n return false;\n }\n\n return true;\n }\n\n async execute({ logger }: DataMigrationContext): Promise<void> {\n const tenants = await queryAll<{ data: { id: string; name: string } }>({\n entity: this.tenantEntity,\n partitionKey: \"TENANTS\",\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n for (const tenant of tenants) {\n const users = await queryAll<{ id: string; email: string; data?: any }>({\n entity: this.newUserEntity,\n partitionKey: `T#${tenant.data.id}#ADMIN_USERS`,\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n if (users.length === 0) {\n logger.info(`No users found on tenant \"${tenant.data.id}\".`);\n continue;\n }\n\n const newUsersEntityBatch = createEntityWriteBatch({\n entity: this.newUserEntity,\n put: users\n .filter(user => !Array.isArray(user.data.groups))\n .map(user => {\n return {\n ...user,\n data: {\n ...user.data,\n groups: [user.data.group].filter(Boolean),\n teams: [user.data.team].filter(Boolean)\n }\n };\n })\n });\n\n await executeWithRetry(async () => {\n return await newUsersEntityBatch.execute();\n });\n }\n }\n}\n\nmakeInjectable(AdminUsers_5_41_0_001, [inject(PrimaryDynamoTableSymbol)]);\n"],"mappings":"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","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,45 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/migrations",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.42.0-beta.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "yarn webiny run build",
|
|
6
6
|
"watch": "yarn webiny run watch"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@elastic/elasticsearch": "7.12.0",
|
|
10
|
-
"@webiny/api-elasticsearch": "5.
|
|
11
|
-
"@webiny/aws-sdk": "5.
|
|
12
|
-
"@webiny/
|
|
13
|
-
"@webiny/
|
|
14
|
-
"@webiny/
|
|
15
|
-
"@webiny/
|
|
16
|
-
"@webiny/
|
|
17
|
-
"@webiny/
|
|
18
|
-
"
|
|
19
|
-
"execa": "5.1.1",
|
|
20
|
-
"fast-glob": "3.2.12",
|
|
21
|
-
"jsonpack": "1.1.5",
|
|
22
|
-
"lodash": "4.17.21",
|
|
23
|
-
"pino-pretty": "9.4.0",
|
|
24
|
-
"pluralize": "8.0.0",
|
|
25
|
-
"yargs": "17.6.2"
|
|
10
|
+
"@webiny/api-elasticsearch": "5.42.0-beta.0",
|
|
11
|
+
"@webiny/aws-sdk": "5.42.0-beta.0",
|
|
12
|
+
"@webiny/data-migration": "5.42.0-beta.0",
|
|
13
|
+
"@webiny/db-dynamodb": "5.42.0-beta.0",
|
|
14
|
+
"@webiny/error": "5.42.0-beta.0",
|
|
15
|
+
"@webiny/ioc": "5.42.0-beta.0",
|
|
16
|
+
"@webiny/logger": "5.42.0-beta.0",
|
|
17
|
+
"@webiny/utils": "5.42.0-beta.0",
|
|
18
|
+
"lodash": "4.17.21"
|
|
26
19
|
},
|
|
27
20
|
"publishConfig": {
|
|
28
21
|
"access": "public",
|
|
29
22
|
"directory": "dist"
|
|
30
23
|
},
|
|
31
24
|
"devDependencies": {
|
|
32
|
-
"@
|
|
33
|
-
"@webiny/api-headless-cms": "5.
|
|
34
|
-
"@webiny/
|
|
35
|
-
"@webiny/
|
|
36
|
-
"@webiny/
|
|
37
|
-
"@webiny/
|
|
38
|
-
"
|
|
39
|
-
"elastic-ts": "0.8.0",
|
|
25
|
+
"@webiny/api-headless-cms": "5.42.0-beta.0",
|
|
26
|
+
"@webiny/api-headless-cms-ddb-es": "5.42.0-beta.0",
|
|
27
|
+
"@webiny/cli": "5.42.0-beta.0",
|
|
28
|
+
"@webiny/handler-aws": "5.42.0-beta.0",
|
|
29
|
+
"@webiny/plugins": "5.42.0-beta.0",
|
|
30
|
+
"@webiny/project-utils": "5.42.0-beta.0",
|
|
31
|
+
"elastic-ts": "0.12.0",
|
|
40
32
|
"jest-dynalite": "3.6.1",
|
|
41
33
|
"ttypescript": "1.5.15",
|
|
42
34
|
"typescript": "4.9.5"
|
|
43
35
|
},
|
|
44
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "ebf90f62ed3f28114ffdb012b7e5f80988af53d3"
|
|
45
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_","require","disableElasticsearchIndexing","params","index","logger","esPutIndexSettings","elasticsearchClient","settings","refresh_interval","ex","error","message","code","data","exports"],"sources":["disableEsIndexing.ts"],"sourcesContent":["import { esPutIndexSettings } from \"~/utils\";\nimport { Logger } from \"@webiny/data-migration\";\nimport { Client } from \"@elastic/elasticsearch\";\n\ninterface DisableElasticsearchIndexingParams {\n index: string;\n logger: Logger;\n elasticsearchClient: Client;\n}\n\nexport const disableElasticsearchIndexing = async (\n params: DisableElasticsearchIndexingParams\n): Promise<void> => {\n const { index, logger } = params;\n\n try {\n await esPutIndexSettings({\n elasticsearchClient: params.elasticsearchClient,\n index,\n settings: {\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"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,OAAA;AAUO,MAAMC,4BAA4B,GAAG,MACxCC,MAA0C,IAC1B;EAChB,MAAM;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAEhC,IAAI;IACA,MAAM,IAAAG,oBAAkB,EAAC;MACrBC,mBAAmB,EAAEJ,MAAM,CAACI,mBAAmB;MAC/CH,KAAK;MACLI,QAAQ,EAAE;QACNC,gBAAgB,EAAE,CAAC;MACvB;IACJ,CAAC,CAAC;EACN,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTL,MAAM,CAACM,KAAK,
|
|
1
|
+
{"version":3,"names":["_","require","disableElasticsearchIndexing","params","index","logger","esPutIndexSettings","elasticsearchClient","settings","refresh_interval","ex","error","message","code","data","exports"],"sources":["disableEsIndexing.ts"],"sourcesContent":["import { esPutIndexSettings } from \"~/utils\";\nimport { Logger } from \"@webiny/data-migration\";\nimport { Client } from \"@elastic/elasticsearch\";\n\ninterface DisableElasticsearchIndexingParams {\n index: string;\n logger: Logger;\n elasticsearchClient: Client;\n}\n\nexport const disableElasticsearchIndexing = async (\n params: DisableElasticsearchIndexingParams\n): Promise<void> => {\n const { index, logger } = params;\n\n try {\n await esPutIndexSettings({\n elasticsearchClient: params.elasticsearchClient,\n index,\n settings: {\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"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,OAAA;AAUO,MAAMC,4BAA4B,GAAG,MACxCC,MAA0C,IAC1B;EAChB,MAAM;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAEhC,IAAI;IACA,MAAM,IAAAG,oBAAkB,EAAC;MACrBC,mBAAmB,EAAEJ,MAAM,CAACI,mBAAmB;MAC/CH,KAAK;MACLI,QAAQ,EAAE;QACNC,gBAAgB,EAAE,CAAC;MACvB;IACJ,CAAC,CAAC;EACN,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTL,MAAM,CAACM,KAAK,CAAC,yCAAyCP,KAAK,IAAI,CAAC;IAChEC,MAAM,CAACM,KAAK,CAAC;MACT,GAAGD,EAAE;MACLE,OAAO,EAAEF,EAAE,CAACE,OAAO;MACnBC,IAAI,EAAEH,EAAE,CAACG,IAAI;MACbC,IAAI,EAAEJ,EAAE,CAACI;IACb,CAAC,CAAC;EACN;AACJ,CAAC;AAACC,OAAA,CAAAb,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_","require","esGetIndexExist","params","elasticsearchClient","tenant","locale","type","isHeadlessCmsModel","index","esGetIndexName","response","indices","exists","body","ex","console","warn","message","exports"],"sources":["esGetIndexExist.ts"],"sourcesContent":["import { Client } from \"@elastic/elasticsearch\";\nimport { esGetIndexName } from \"~/utils\";\n\nexport interface GetIndexExistParams {\n elasticsearchClient: Client;\n tenant: string;\n locale: string;\n type: string;\n isHeadlessCmsModel?: boolean;\n}\n\nexport const esGetIndexExist = async (params: GetIndexExistParams) => {\n const { elasticsearchClient, tenant, locale, type, isHeadlessCmsModel } = params;\n\n try {\n const index = esGetIndexName({ tenant, locale, type, isHeadlessCmsModel });\n\n const response = await elasticsearchClient.indices.exists({\n index\n });\n\n if (response.body) {\n return true;\n }\n\n return false;\n } catch (ex) {\n console.warn(`Could not find Elasticsearch index:`, ex.message);\n return false;\n }\n};\n"],"mappings":";;;;;;AACA,IAAAA,CAAA,GAAAC,OAAA;AAUO,MAAMC,eAAe,GAAG,MAAOC,MAA2B,IAAK;EAClE,MAAM;IAAEC,mBAAmB;IAAEC,MAAM;IAAEC,MAAM;IAAEC,IAAI;IAAEC;EAAmB,CAAC,GAAGL,MAAM;EAEhF,IAAI;IACA,MAAMM,KAAK,GAAG,IAAAC,gBAAc,EAAC;MAAEL,MAAM;MAAEC,MAAM;MAAEC,IAAI;MAAEC;IAAmB,CAAC,CAAC;IAE1E,MAAMG,QAAQ,GAAG,MAAMP,mBAAmB,CAACQ,OAAO,CAACC,MAAM,CAAC;MACtDJ;IACJ,CAAC,CAAC;IAEF,IAAIE,QAAQ,CAACG,IAAI,EAAE;MACf,OAAO,IAAI;IACf;IAEA,OAAO,KAAK;EAChB,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTC,OAAO,CAACC,IAAI,
|
|
1
|
+
{"version":3,"names":["_","require","esGetIndexExist","params","elasticsearchClient","tenant","locale","type","isHeadlessCmsModel","index","esGetIndexName","response","indices","exists","body","ex","console","warn","message","exports"],"sources":["esGetIndexExist.ts"],"sourcesContent":["import { Client } from \"@elastic/elasticsearch\";\nimport { esGetIndexName } from \"~/utils\";\n\nexport interface GetIndexExistParams {\n elasticsearchClient: Client;\n tenant: string;\n locale: string;\n type: string;\n isHeadlessCmsModel?: boolean;\n}\n\nexport const esGetIndexExist = async (params: GetIndexExistParams) => {\n const { elasticsearchClient, tenant, locale, type, isHeadlessCmsModel } = params;\n\n try {\n const index = esGetIndexName({ tenant, locale, type, isHeadlessCmsModel });\n\n const response = await elasticsearchClient.indices.exists({\n index\n });\n\n if (response.body) {\n return true;\n }\n\n return false;\n } catch (ex) {\n console.warn(`Could not find Elasticsearch index:`, ex.message);\n return false;\n }\n};\n"],"mappings":";;;;;;AACA,IAAAA,CAAA,GAAAC,OAAA;AAUO,MAAMC,eAAe,GAAG,MAAOC,MAA2B,IAAK;EAClE,MAAM;IAAEC,mBAAmB;IAAEC,MAAM;IAAEC,MAAM;IAAEC,IAAI;IAAEC;EAAmB,CAAC,GAAGL,MAAM;EAEhF,IAAI;IACA,MAAMM,KAAK,GAAG,IAAAC,gBAAc,EAAC;MAAEL,MAAM;MAAEC,MAAM;MAAEC,IAAI;MAAEC;IAAmB,CAAC,CAAC;IAE1E,MAAMG,QAAQ,GAAG,MAAMP,mBAAmB,CAACQ,OAAO,CAACC,MAAM,CAAC;MACtDJ;IACJ,CAAC,CAAC;IAEF,IAAIE,QAAQ,CAACG,IAAI,EAAE;MACf,OAAO,IAAI;IACf;IAEA,OAAO,KAAK;EAChB,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTC,OAAO,CAACC,IAAI,CAAC,qCAAqC,EAAEF,EAAE,CAACG,OAAO,CAAC;IAC/D,OAAO,KAAK;EAChB;AACJ,CAAC;AAACC,OAAA,CAAAjB,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_error","_interopRequireDefault","require","_apiElasticsearch","esGetIndexName","params","tenant","locale","type","isHeadlessCmsModel","WebinyError","sharedIndex","isSharedElasticsearchIndex","tenantId","localeCode","process","env","WEBINY_ELASTICSEARCH_INDEX_LOCALE","index","filter","Boolean","join","toLowerCase","prefix","getElasticsearchIndexPrefix","exports"],"sources":["esGetIndexName.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { getElasticsearchIndexPrefix, isSharedElasticsearchIndex } from \"@webiny/api-elasticsearch\";\n\nexport interface EsGetIndexNameParams {\n tenant: string;\n locale: string;\n type: string;\n isHeadlessCmsModel?: boolean;\n}\n\nexport const esGetIndexName = (params: EsGetIndexNameParams) => {\n const { tenant, locale, type, isHeadlessCmsModel } = params;\n\n if (!type) {\n throw new WebinyError(\n `Missing \"type\" parameter when trying to create Elasticsearch index name.`,\n \"INDEX_TYPE_ERROR\"\n );\n }\n\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n }\n\n const sharedIndex = isSharedElasticsearchIndex();\n\n const tenantId = sharedIndex ? \"root\" : tenant;\n let localeCode: string | null = null;\n if (isHeadlessCmsModel || process.env.WEBINY_ELASTICSEARCH_INDEX_LOCALE === \"true\") {\n if (!locale) {\n throw new WebinyError(\n `Missing \"locale\" parameter when trying to create Elasticsearch index name.`,\n \"LOCALE_ERROR\"\n );\n }\n localeCode = locale;\n }\n\n const index = [tenantId, isHeadlessCmsModel && \"headless-cms\", localeCode, type]\n .filter(Boolean)\n .join(\"-\")\n .toLowerCase();\n\n const prefix = getElasticsearchIndexPrefix();\n if (!prefix) {\n return index;\n }\n return prefix + index;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AASO,MAAME,cAAc,GAAIC,MAA4B,IAAK;EAC5D,MAAM;IAAEC,MAAM;IAAEC,MAAM;IAAEC,IAAI;IAAEC;EAAmB,CAAC,GAAGJ,MAAM;EAE3D,IAAI,CAACG,IAAI,EAAE;IACP,MAAM,IAAIE,cAAW,
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","_apiElasticsearch","esGetIndexName","params","tenant","locale","type","isHeadlessCmsModel","WebinyError","sharedIndex","isSharedElasticsearchIndex","tenantId","localeCode","process","env","WEBINY_ELASTICSEARCH_INDEX_LOCALE","index","filter","Boolean","join","toLowerCase","prefix","getElasticsearchIndexPrefix","exports"],"sources":["esGetIndexName.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { getElasticsearchIndexPrefix, isSharedElasticsearchIndex } from \"@webiny/api-elasticsearch\";\n\nexport interface EsGetIndexNameParams {\n tenant: string;\n locale: string;\n type: string;\n isHeadlessCmsModel?: boolean;\n}\n\nexport const esGetIndexName = (params: EsGetIndexNameParams) => {\n const { tenant, locale, type, isHeadlessCmsModel } = params;\n\n if (!type) {\n throw new WebinyError(\n `Missing \"type\" parameter when trying to create Elasticsearch index name.`,\n \"INDEX_TYPE_ERROR\"\n );\n }\n\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n }\n\n const sharedIndex = isSharedElasticsearchIndex();\n\n const tenantId = sharedIndex ? \"root\" : tenant;\n let localeCode: string | null = null;\n if (isHeadlessCmsModel || process.env.WEBINY_ELASTICSEARCH_INDEX_LOCALE === \"true\") {\n if (!locale) {\n throw new WebinyError(\n `Missing \"locale\" parameter when trying to create Elasticsearch index name.`,\n \"LOCALE_ERROR\"\n );\n }\n localeCode = locale;\n }\n\n const index = [tenantId, isHeadlessCmsModel && \"headless-cms\", localeCode, type]\n .filter(Boolean)\n .join(\"-\")\n .toLowerCase();\n\n const prefix = getElasticsearchIndexPrefix();\n if (!prefix) {\n return index;\n }\n return prefix + index;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AASO,MAAME,cAAc,GAAIC,MAA4B,IAAK;EAC5D,MAAM;IAAEC,MAAM;IAAEC,MAAM;IAAEC,IAAI;IAAEC;EAAmB,CAAC,GAAGJ,MAAM;EAE3D,IAAI,CAACG,IAAI,EAAE;IACP,MAAM,IAAIE,cAAW,CACjB,0EAA0E,EAC1E,kBACJ,CAAC;EACL;EAEA,IAAI,CAACJ,MAAM,EAAE;IACT,MAAM,IAAII,cAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;EACL;EAEA,MAAMC,WAAW,GAAG,IAAAC,4CAA0B,EAAC,CAAC;EAEhD,MAAMC,QAAQ,GAAGF,WAAW,GAAG,MAAM,GAAGL,MAAM;EAC9C,IAAIQ,UAAyB,GAAG,IAAI;EACpC,IAAIL,kBAAkB,IAAIM,OAAO,CAACC,GAAG,CAACC,iCAAiC,KAAK,MAAM,EAAE;IAChF,IAAI,CAACV,MAAM,EAAE;MACT,MAAM,IAAIG,cAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL;IACAI,UAAU,GAAGP,MAAM;EACvB;EAEA,MAAMW,KAAK,GAAG,CAACL,QAAQ,EAAEJ,kBAAkB,IAAI,cAAc,EAAEK,UAAU,EAAEN,IAAI,CAAC,CAC3EW,MAAM,CAACC,OAAO,CAAC,CACfC,IAAI,CAAC,GAAG,CAAC,CACTC,WAAW,CAAC,CAAC;EAElB,MAAMC,MAAM,GAAG,IAAAC,6CAA2B,EAAC,CAAC;EAC5C,IAAI,CAACD,MAAM,EAAE;IACT,OAAOL,KAAK;EAChB;EACA,OAAOK,MAAM,GAAGL,KAAK;AACzB,CAAC;AAACO,OAAA,CAAArB,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_","require","fetchOriginalElasticsearchSettings","params","index","logger","settings","esGetIndexSettings","elasticsearchClient","fields","refresh_interval","ex","error","message","code","data","exports"],"sources":["fetchOriginalEsSettings.ts"],"sourcesContent":["import { esGetIndexSettings } from \"~/utils\";\nimport { Logger } from \"@webiny/data-migration\";\nimport { Client } from \"@elastic/elasticsearch\";\n\ninterface FetchOriginalElasticsearchSettingsParams {\n elasticsearchClient: Client;\n index: string;\n logger: Logger;\n}\n\ninterface IndexSettings {\n refresh_interval: `${number}s`;\n}\n\nexport const fetchOriginalElasticsearchSettings = async (\n params: FetchOriginalElasticsearchSettingsParams\n): Promise<IndexSettings | null> => {\n const { index, logger } = params;\n try {\n const settings = await esGetIndexSettings({\n elasticsearchClient: params.elasticsearchClient,\n index,\n fields: [\"refresh_interval\"]\n });\n return {\n refresh_interval: settings.refresh_interval || \"1s\"\n };\n } catch (ex) {\n logger.error(`Failed to fetch original Elasticsearch settings for index \"${index}\".`);\n logger.error({\n ...ex,\n message: ex.message,\n code: ex.code,\n data: ex.data\n });\n }\n\n return null;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,OAAA;AAcO,MAAMC,kCAAkC,GAAG,MAC9CC,MAAgD,IAChB;EAChC,MAAM;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAChC,IAAI;IACA,MAAMG,QAAQ,GAAG,MAAM,IAAAC,oBAAkB,EAAC;MACtCC,mBAAmB,EAAEL,MAAM,CAACK,mBAAmB;MAC/CJ,KAAK;MACLK,MAAM,EAAE,CAAC,kBAAkB;IAC/B,CAAC,CAAC;IACF,OAAO;MACHC,gBAAgB,EAAEJ,QAAQ,CAACI,gBAAgB,IAAI;IACnD,CAAC;EACL,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTN,MAAM,CAACO,KAAK,
|
|
1
|
+
{"version":3,"names":["_","require","fetchOriginalElasticsearchSettings","params","index","logger","settings","esGetIndexSettings","elasticsearchClient","fields","refresh_interval","ex","error","message","code","data","exports"],"sources":["fetchOriginalEsSettings.ts"],"sourcesContent":["import { esGetIndexSettings } from \"~/utils\";\nimport { Logger } from \"@webiny/data-migration\";\nimport { Client } from \"@elastic/elasticsearch\";\n\ninterface FetchOriginalElasticsearchSettingsParams {\n elasticsearchClient: Client;\n index: string;\n logger: Logger;\n}\n\ninterface IndexSettings {\n refresh_interval: `${number}s`;\n}\n\nexport const fetchOriginalElasticsearchSettings = async (\n params: FetchOriginalElasticsearchSettingsParams\n): Promise<IndexSettings | null> => {\n const { index, logger } = params;\n try {\n const settings = await esGetIndexSettings({\n elasticsearchClient: params.elasticsearchClient,\n index,\n fields: [\"refresh_interval\"]\n });\n return {\n refresh_interval: settings.refresh_interval || \"1s\"\n };\n } catch (ex) {\n logger.error(`Failed to fetch original Elasticsearch settings for index \"${index}\".`);\n logger.error({\n ...ex,\n message: ex.message,\n code: ex.code,\n data: ex.data\n });\n }\n\n return null;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,OAAA;AAcO,MAAMC,kCAAkC,GAAG,MAC9CC,MAAgD,IAChB;EAChC,MAAM;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAChC,IAAI;IACA,MAAMG,QAAQ,GAAG,MAAM,IAAAC,oBAAkB,EAAC;MACtCC,mBAAmB,EAAEL,MAAM,CAACK,mBAAmB;MAC/CJ,KAAK;MACLK,MAAM,EAAE,CAAC,kBAAkB;IAC/B,CAAC,CAAC;IACF,OAAO;MACHC,gBAAgB,EAAEJ,QAAQ,CAACI,gBAAgB,IAAI;IACnD,CAAC;EACL,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTN,MAAM,CAACO,KAAK,CAAC,8DAA8DR,KAAK,IAAI,CAAC;IACrFC,MAAM,CAACO,KAAK,CAAC;MACT,GAAGD,EAAE;MACLE,OAAO,EAAEF,EAAE,CAACE,OAAO;MACnBC,IAAI,EAAEH,EAAE,CAACG,IAAI;MACbC,IAAI,EAAEJ,EAAE,CAACI;IACb,CAAC,CAAC;EACN;EAEA,OAAO,IAAI;AACf,CAAC;AAACC,OAAA,CAAAd,kCAAA,GAAAA,kCAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_","require","restoreOriginalElasticsearchSettings","params","indexSettings","logger","indexes","index","settings","refreshInterval","refresh_interval","esPutIndexSettings","elasticsearchClient","ex","error","message","code","data","exports"],"sources":["restoreOriginalEsSettings.ts"],"sourcesContent":["import { esPutIndexSettings } from \"~/utils\";\nimport { Logger } from \"@webiny/data-migration\";\nimport { Client } from \"@elastic/elasticsearch\";\n\ninterface IndexSettings {\n refresh_interval: `${number}s` | \"-1\";\n}\n\ninterface RestoreOriginalElasticsearchSettingsParams {\n indexSettings: {\n [index: string]: IndexSettings | null;\n };\n logger: Logger;\n elasticsearchClient: Client;\n}\n\nexport const restoreOriginalElasticsearchSettings = async (\n params: RestoreOriginalElasticsearchSettingsParams\n): Promise<void> => {\n const { indexSettings, logger } = params;\n\n const indexes = indexSettings;\n if (!indexes || typeof indexes !== \"object\") {\n return;\n }\n\n for (const index in indexes) {\n const settings = indexes[index];\n if (!settings || typeof settings !== \"object\") {\n continue;\n }\n\n // We must ensure that the refresh interval is not set to a negative value. Why?\n // We've had a case where a migration run has been manually stopped, and the index settings\n // were never restored. Once a second run was started and this restore function\n // was called, the refresh interval was set to `-1s`, which effectively disabled indexing.\n let refreshInterval = settings.refresh_interval || `1s`;\n if (refreshInterval === \"-1\") {\n refreshInterval = \"1s\";\n }\n\n try {\n await esPutIndexSettings({\n elasticsearchClient: params.elasticsearchClient,\n index,\n settings: {\n refresh_interval: refreshInterval\n }\n });\n } catch (ex) {\n logger.error(\n `Failed to restore original settings for index \"${index}\". Please do it manually.`\n );\n logger.error({\n ...ex,\n message: ex.message,\n code: ex.code,\n data: ex.data\n });\n }\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,OAAA;AAgBO,MAAMC,oCAAoC,GAAG,MAChDC,MAAkD,IAClC;EAChB,MAAM;IAAEC,aAAa;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAExC,MAAMG,OAAO,GAAGF,aAAa;EAC7B,IAAI,CAACE,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IACzC;EACJ;EAEA,KAAK,MAAMC,KAAK,IAAID,OAAO,EAAE;IACzB,MAAME,QAAQ,GAAGF,OAAO,CAACC,KAAK,CAAC;IAC/B,IAAI,CAACC,QAAQ,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAE;MAC3C;IACJ;;IAEA;IACA;IACA;IACA;IACA,IAAIC,eAAe,GAAGD,QAAQ,CAACE,gBAAgB,
|
|
1
|
+
{"version":3,"names":["_","require","restoreOriginalElasticsearchSettings","params","indexSettings","logger","indexes","index","settings","refreshInterval","refresh_interval","esPutIndexSettings","elasticsearchClient","ex","error","message","code","data","exports"],"sources":["restoreOriginalEsSettings.ts"],"sourcesContent":["import { esPutIndexSettings } from \"~/utils\";\nimport { Logger } from \"@webiny/data-migration\";\nimport { Client } from \"@elastic/elasticsearch\";\n\ninterface IndexSettings {\n refresh_interval: `${number}s` | \"-1\";\n}\n\ninterface RestoreOriginalElasticsearchSettingsParams {\n indexSettings: {\n [index: string]: IndexSettings | null;\n };\n logger: Logger;\n elasticsearchClient: Client;\n}\n\nexport const restoreOriginalElasticsearchSettings = async (\n params: RestoreOriginalElasticsearchSettingsParams\n): Promise<void> => {\n const { indexSettings, logger } = params;\n\n const indexes = indexSettings;\n if (!indexes || typeof indexes !== \"object\") {\n return;\n }\n\n for (const index in indexes) {\n const settings = indexes[index];\n if (!settings || typeof settings !== \"object\") {\n continue;\n }\n\n // We must ensure that the refresh interval is not set to a negative value. Why?\n // We've had a case where a migration run has been manually stopped, and the index settings\n // were never restored. Once a second run was started and this restore function\n // was called, the refresh interval was set to `-1s`, which effectively disabled indexing.\n let refreshInterval = settings.refresh_interval || `1s`;\n if (refreshInterval === \"-1\") {\n refreshInterval = \"1s\";\n }\n\n try {\n await esPutIndexSettings({\n elasticsearchClient: params.elasticsearchClient,\n index,\n settings: {\n refresh_interval: refreshInterval\n }\n });\n } catch (ex) {\n logger.error(\n `Failed to restore original settings for index \"${index}\". Please do it manually.`\n );\n logger.error({\n ...ex,\n message: ex.message,\n code: ex.code,\n data: ex.data\n });\n }\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,OAAA;AAgBO,MAAMC,oCAAoC,GAAG,MAChDC,MAAkD,IAClC;EAChB,MAAM;IAAEC,aAAa;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAExC,MAAMG,OAAO,GAAGF,aAAa;EAC7B,IAAI,CAACE,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IACzC;EACJ;EAEA,KAAK,MAAMC,KAAK,IAAID,OAAO,EAAE;IACzB,MAAME,QAAQ,GAAGF,OAAO,CAACC,KAAK,CAAC;IAC/B,IAAI,CAACC,QAAQ,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAE;MAC3C;IACJ;;IAEA;IACA;IACA;IACA;IACA,IAAIC,eAAe,GAAGD,QAAQ,CAACE,gBAAgB,IAAI,IAAI;IACvD,IAAID,eAAe,KAAK,IAAI,EAAE;MAC1BA,eAAe,GAAG,IAAI;IAC1B;IAEA,IAAI;MACA,MAAM,IAAAE,oBAAkB,EAAC;QACrBC,mBAAmB,EAAET,MAAM,CAACS,mBAAmB;QAC/CL,KAAK;QACLC,QAAQ,EAAE;UACNE,gBAAgB,EAAED;QACtB;MACJ,CAAC,CAAC;IACN,CAAC,CAAC,OAAOI,EAAE,EAAE;MACTR,MAAM,CAACS,KAAK,CACR,kDAAkDP,KAAK,2BAC3D,CAAC;MACDF,MAAM,CAACS,KAAK,CAAC;QACT,GAAGD,EAAE;QACLE,OAAO,EAAEF,EAAE,CAACE,OAAO;QACnBC,IAAI,EAAEH,EAAE,CAACG,IAAI;QACbC,IAAI,EAAEJ,EAAE,CAACI;MACb,CAAC,CAAC;IACN;EACJ;AACJ,CAAC;AAACC,OAAA,CAAAhB,oCAAA,GAAAA,oCAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_","require","forEachTenantLocale","table","logger","callback","tenantEntity","createTenantEntity","tenants","queryAll","entity","partitionKey","options","index","gte","length","info","localeEntity","createLocaleEntity","tenant","locales","data","id","locale","result","tenantId","localeCode","code","exports"],"sources":["forEachTenantLocale.ts"],"sourcesContent":["import { createLocaleEntity, createTenantEntity, queryAll } from \"~/utils\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Logger } from \"@webiny/logger\";\n\nexport interface Tenant {\n data: {\n id: string;\n name: string;\n };\n}\n\nexport interface I18NLocale {\n code: string;\n}\n\ntype ForEachTenantLocaleCallback = (params: {\n tenantId: string;\n localeCode: string;\n}) => boolean | Promise<boolean>;\n\ninterface ForEachTenantLocaleParams {\n table: Table<string, string, string>;\n logger: Logger;\n callback: ForEachTenantLocaleCallback;\n}\n\nexport const forEachTenantLocale = async ({\n table,\n logger,\n callback\n}: ForEachTenantLocaleParams) => {\n const tenantEntity = createTenantEntity(table);\n const tenants = await queryAll<Tenant>({\n entity: tenantEntity,\n partitionKey: \"TENANTS\",\n options: {\n index: \"GSI1\",\n gte: \" \"\n }\n });\n\n if (tenants.length === 0) {\n logger.info(`No tenants found in the system.`);\n return;\n }\n\n const localeEntity = createLocaleEntity(table);\n\n for (const tenant of tenants) {\n const locales = await queryAll<I18NLocale>({\n entity: localeEntity,\n partitionKey: `T#${tenant.data.id}#I18N#L`,\n options: {\n gte: \" \"\n }\n });\n\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 result = await callback({ tenantId: tenant.data.id, localeCode: locale.code });\n // For now, we only check if the return value is `false`. If so, we stop\n // iterating over the locales and tenants completely. If needed, we could\n // add more control over the iteration process.\n if (result === false) {\n return;\n }\n }\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,OAAA;AA0BO,MAAMC,mBAAmB,GAAG,MAAAA,CAAO;EACtCC,KAAK;EACLC,MAAM;EACNC;AACuB,CAAC,KAAK;EAC7B,MAAMC,YAAY,GAAG,IAAAC,oBAAkB,EAACJ,KAAK,CAAC;EAC9C,MAAMK,OAAO,GAAG,MAAM,IAAAC,UAAQ,EAAS;IACnCC,MAAM,EAAEJ,YAAY;IACpBK,YAAY,EAAE,SAAS;IACvBC,OAAO,EAAE;MACLC,KAAK,EAAE,MAAM;MACbC,GAAG,EAAE;IACT;EACJ,CAAC,CAAC;EAEF,IAAIN,OAAO,CAACO,MAAM,KAAK,CAAC,EAAE;IACtBX,MAAM,CAACY,IAAI,
|
|
1
|
+
{"version":3,"names":["_","require","forEachTenantLocale","table","logger","callback","tenantEntity","createTenantEntity","tenants","queryAll","entity","partitionKey","options","index","gte","length","info","localeEntity","createLocaleEntity","tenant","locales","data","id","locale","result","tenantId","localeCode","code","exports"],"sources":["forEachTenantLocale.ts"],"sourcesContent":["import { createLocaleEntity, createTenantEntity, queryAll } from \"~/utils\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Logger } from \"@webiny/logger\";\n\nexport interface Tenant {\n data: {\n id: string;\n name: string;\n };\n}\n\nexport interface I18NLocale {\n code: string;\n}\n\ntype ForEachTenantLocaleCallback = (params: {\n tenantId: string;\n localeCode: string;\n}) => boolean | Promise<boolean>;\n\ninterface ForEachTenantLocaleParams {\n table: Table<string, string, string>;\n logger: Logger;\n callback: ForEachTenantLocaleCallback;\n}\n\nexport const forEachTenantLocale = async ({\n table,\n logger,\n callback\n}: ForEachTenantLocaleParams) => {\n const tenantEntity = createTenantEntity(table);\n const tenants = await queryAll<Tenant>({\n entity: tenantEntity,\n partitionKey: \"TENANTS\",\n options: {\n index: \"GSI1\",\n gte: \" \"\n }\n });\n\n if (tenants.length === 0) {\n logger.info(`No tenants found in the system.`);\n return;\n }\n\n const localeEntity = createLocaleEntity(table);\n\n for (const tenant of tenants) {\n const locales = await queryAll<I18NLocale>({\n entity: localeEntity,\n partitionKey: `T#${tenant.data.id}#I18N#L`,\n options: {\n gte: \" \"\n }\n });\n\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 result = await callback({ tenantId: tenant.data.id, localeCode: locale.code });\n // For now, we only check if the return value is `false`. If so, we stop\n // iterating over the locales and tenants completely. If needed, we could\n // add more control over the iteration process.\n if (result === false) {\n return;\n }\n }\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,OAAA;AA0BO,MAAMC,mBAAmB,GAAG,MAAAA,CAAO;EACtCC,KAAK;EACLC,MAAM;EACNC;AACuB,CAAC,KAAK;EAC7B,MAAMC,YAAY,GAAG,IAAAC,oBAAkB,EAACJ,KAAK,CAAC;EAC9C,MAAMK,OAAO,GAAG,MAAM,IAAAC,UAAQ,EAAS;IACnCC,MAAM,EAAEJ,YAAY;IACpBK,YAAY,EAAE,SAAS;IACvBC,OAAO,EAAE;MACLC,KAAK,EAAE,MAAM;MACbC,GAAG,EAAE;IACT;EACJ,CAAC,CAAC;EAEF,IAAIN,OAAO,CAACO,MAAM,KAAK,CAAC,EAAE;IACtBX,MAAM,CAACY,IAAI,CAAC,iCAAiC,CAAC;IAC9C;EACJ;EAEA,MAAMC,YAAY,GAAG,IAAAC,oBAAkB,EAACf,KAAK,CAAC;EAE9C,KAAK,MAAMgB,MAAM,IAAIX,OAAO,EAAE;IAC1B,MAAMY,OAAO,GAAG,MAAM,IAAAX,UAAQ,EAAa;MACvCC,MAAM,EAAEO,YAAY;MACpBN,YAAY,EAAE,KAAKQ,MAAM,CAACE,IAAI,CAACC,EAAE,SAAS;MAC1CV,OAAO,EAAE;QACLE,GAAG,EAAE;MACT;IACJ,CAAC,CAAC;IAEF,IAAIM,OAAO,CAACL,MAAM,KAAK,CAAC,EAAE;MACtBX,MAAM,CAACY,IAAI,CAAC,+BAA+BG,MAAM,CAACE,IAAI,CAACC,EAAE,IAAI,CAAC;MAC9D;IACJ;IAEA,KAAK,MAAMC,MAAM,IAAIH,OAAO,EAAE;MAC1B,MAAMI,MAAM,GAAG,MAAMnB,QAAQ,CAAC;QAAEoB,QAAQ,EAAEN,MAAM,CAACE,IAAI,CAACC,EAAE;QAAEI,UAAU,EAAEH,MAAM,CAACI;MAAK,CAAC,CAAC;MACpF;MACA;MACA;MACA,IAAIH,MAAM,KAAK,KAAK,EAAE;QAClB;MACJ;IACJ;EACJ;AACJ,CAAC;AAACI,OAAA,CAAA1B,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
-
import { DataMigrationContext } from "@webiny/data-migration";
|
|
3
|
-
export declare class FileManager_5_35_0_001_FileManagerSettings {
|
|
4
|
-
private readonly newSettingsEntity;
|
|
5
|
-
private readonly legacySettingsEntity;
|
|
6
|
-
private readonly tenantEntity;
|
|
7
|
-
constructor(table: Table<string, string, string>);
|
|
8
|
-
getId(): string;
|
|
9
|
-
getDescription(): string;
|
|
10
|
-
shouldExecute({ logger }: DataMigrationContext): Promise<boolean>;
|
|
11
|
-
execute({ logger }: DataMigrationContext): Promise<void>;
|
|
12
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.FileManager_5_35_0_001_FileManagerSettings = void 0;
|
|
7
|
-
var _utils = require("../../../utils");
|
|
8
|
-
var _createTenantEntity = require("./entities/createTenantEntity");
|
|
9
|
-
var _createSettingsEntity = require("./entities/createSettingsEntity");
|
|
10
|
-
var _dbDynamodb = require("@webiny/db-dynamodb");
|
|
11
|
-
class FileManager_5_35_0_001_FileManagerSettings {
|
|
12
|
-
constructor(table) {
|
|
13
|
-
this.newSettingsEntity = (0, _utils.createStandardEntity)(table, "FM.Settings");
|
|
14
|
-
this.legacySettingsEntity = (0, _createSettingsEntity.createLegacySettingsEntity)(table);
|
|
15
|
-
this.tenantEntity = (0, _createTenantEntity.createTenantEntity)(table);
|
|
16
|
-
}
|
|
17
|
-
getId() {
|
|
18
|
-
return "FM Settings";
|
|
19
|
-
}
|
|
20
|
-
getDescription() {
|
|
21
|
-
return "";
|
|
22
|
-
}
|
|
23
|
-
async shouldExecute({
|
|
24
|
-
logger
|
|
25
|
-
}) {
|
|
26
|
-
const settings = await (0, _utils.queryOne)({
|
|
27
|
-
entity: this.legacySettingsEntity,
|
|
28
|
-
partitionKey: `T#root#FM#SETTINGS`,
|
|
29
|
-
options: {
|
|
30
|
-
eq: "default"
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
if (!settings) {
|
|
34
|
-
logger.info(`Settings not found; system is not yet installed.`);
|
|
35
|
-
// The system is not yet installed, skip migration.
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
const newSettings = await (0, _utils.queryOne)({
|
|
39
|
-
entity: this.newSettingsEntity,
|
|
40
|
-
partitionKey: `T#root#FM#SETTINGS`,
|
|
41
|
-
options: {
|
|
42
|
-
eq: "A"
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
if (newSettings) {
|
|
46
|
-
logger.info(`Settings record seems to be in order.`);
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
async execute({
|
|
52
|
-
logger
|
|
53
|
-
}) {
|
|
54
|
-
const tenants = await (0, _utils.queryAll)({
|
|
55
|
-
entity: this.tenantEntity,
|
|
56
|
-
partitionKey: "TENANTS",
|
|
57
|
-
options: {
|
|
58
|
-
index: "GSI1",
|
|
59
|
-
gt: " "
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
for (const tenant of tenants) {
|
|
63
|
-
const settings = await (0, _utils.queryOne)({
|
|
64
|
-
entity: this.legacySettingsEntity,
|
|
65
|
-
partitionKey: `T#${tenant.id}#FM#SETTINGS`,
|
|
66
|
-
options: {
|
|
67
|
-
eq: "default"
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
if (!settings) {
|
|
71
|
-
// It's possible that a tenant exists, but it was not yet installed.
|
|
72
|
-
logger.info(`Tenant ${tenant.name} (${tenant.id}) is not installed. Skipping migration of settings.`);
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
logger.info(`Updating FM settings for tenant ${tenant.name} (${tenant.id}).`);
|
|
76
|
-
await (0, _dbDynamodb.put)({
|
|
77
|
-
entity: this.newSettingsEntity,
|
|
78
|
-
item: {
|
|
79
|
-
PK: `T#${tenant.id}#FM#SETTINGS`,
|
|
80
|
-
SK: "A",
|
|
81
|
-
TYPE: "fm.settings",
|
|
82
|
-
data: {
|
|
83
|
-
...(0, _createSettingsEntity.getSettingsData)(settings),
|
|
84
|
-
tenant: tenant.id
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.FileManager_5_35_0_001_FileManagerSettings = FileManager_5_35_0_001_FileManagerSettings;
|
|
92
|
-
|
|
93
|
-
//# sourceMappingURL=FileSettingsMigration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_utils","require","_createTenantEntity","_createSettingsEntity","_dbDynamodb","FileManager_5_35_0_001_FileManagerSettings","constructor","table","newSettingsEntity","createStandardEntity","legacySettingsEntity","createLegacySettingsEntity","tenantEntity","createTenantEntity","getId","getDescription","shouldExecute","logger","settings","queryOne","entity","partitionKey","options","eq","info","newSettings","execute","tenants","queryAll","index","gt","tenant","id","name","put","item","PK","SK","TYPE","data","getSettingsData","exports"],"sources":["FileSettingsMigration.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { DataMigrationContext } from \"@webiny/data-migration\";\nimport { createStandardEntity, queryAll, queryOne } from \"~/utils\";\nimport { createTenantEntity } from \"./entities/createTenantEntity\";\nimport {\n createLegacySettingsEntity,\n createSettingsEntity,\n getSettingsData\n} from \"./entities/createSettingsEntity\";\nimport { put } from \"@webiny/db-dynamodb\";\n\nexport class FileManager_5_35_0_001_FileManagerSettings {\n private readonly newSettingsEntity: ReturnType<typeof createSettingsEntity>;\n private readonly legacySettingsEntity: ReturnType<typeof createLegacySettingsEntity>;\n private readonly tenantEntity: ReturnType<typeof createTenantEntity>;\n\n constructor(table: Table<string, string, string>) {\n this.newSettingsEntity = createStandardEntity(table, \"FM.Settings\");\n this.legacySettingsEntity = createLegacySettingsEntity(table);\n this.tenantEntity = createTenantEntity(table);\n }\n\n getId() {\n return \"FM Settings\";\n }\n\n getDescription() {\n return \"\";\n }\n\n async shouldExecute({ logger }: DataMigrationContext): Promise<boolean> {\n const settings = await queryOne({\n entity: this.legacySettingsEntity,\n partitionKey: `T#root#FM#SETTINGS`,\n options: {\n eq: \"default\"\n }\n });\n\n if (!settings) {\n logger.info(`Settings not found; system is not yet installed.`);\n // The system is not yet installed, skip migration.\n return false;\n }\n\n const newSettings = await queryOne({\n entity: this.newSettingsEntity,\n partitionKey: `T#root#FM#SETTINGS`,\n options: {\n eq: \"A\"\n }\n });\n\n if (newSettings) {\n logger.info(`Settings record seems to be in order.`);\n return false;\n }\n\n return true;\n }\n\n async execute({ logger }: DataMigrationContext): Promise<void> {\n const tenants = await queryAll<{ id: string; name: string }>({\n entity: this.tenantEntity,\n partitionKey: \"TENANTS\",\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n for (const tenant of tenants) {\n const settings = await queryOne({\n entity: this.legacySettingsEntity,\n partitionKey: `T#${tenant.id}#FM#SETTINGS`,\n options: {\n eq: \"default\"\n }\n });\n\n if (!settings) {\n // It's possible that a tenant exists, but it was not yet installed.\n logger.info(\n `Tenant ${tenant.name} (${tenant.id}) is not installed. Skipping migration of settings.`\n );\n continue;\n }\n\n logger.info(`Updating FM settings for tenant ${tenant.name} (${tenant.id}).`);\n await put({\n entity: this.newSettingsEntity,\n item: {\n PK: `T#${tenant.id}#FM#SETTINGS`,\n SK: \"A\",\n TYPE: \"fm.settings\",\n data: {\n ...getSettingsData(settings),\n tenant: tenant.id\n }\n }\n });\n }\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AAEO,MAAMI,0CAA0C,CAAC;EAKpDC,WAAWA,CAACC,KAAoC,EAAE;IAC9C,IAAI,CAACC,iBAAiB,GAAG,IAAAC,2BAAoB,EAACF,KAAK,EAAE,aAAa,CAAC;IACnE,IAAI,CAACG,oBAAoB,GAAG,IAAAC,gDAA0B,EAACJ,KAAK,CAAC;IAC7D,IAAI,CAACK,YAAY,GAAG,IAAAC,sCAAkB,EAACN,KAAK,CAAC;EACjD;EAEAO,KAAKA,CAAA,EAAG;IACJ,OAAO,aAAa;EACxB;EAEAC,cAAcA,CAAA,EAAG;IACb,OAAO,EAAE;EACb;EAEA,MAAMC,aAAaA,CAAC;IAAEC;EAA6B,CAAC,EAAoB;IACpE,MAAMC,QAAQ,GAAG,MAAM,IAAAC,eAAQ,EAAC;MAC5BC,MAAM,EAAE,IAAI,CAACV,oBAAoB;MACjCW,YAAY,EAAG,oBAAmB;MAClCC,OAAO,EAAE;QACLC,EAAE,EAAE;MACR;IACJ,CAAC,CAAC;IAEF,IAAI,CAACL,QAAQ,EAAE;MACXD,MAAM,CAACO,IAAI,CAAE,kDAAiD,CAAC;MAC/D;MACA,OAAO,KAAK;IAChB;IAEA,MAAMC,WAAW,GAAG,MAAM,IAAAN,eAAQ,EAAC;MAC/BC,MAAM,EAAE,IAAI,CAACZ,iBAAiB;MAC9Ba,YAAY,EAAG,oBAAmB;MAClCC,OAAO,EAAE;QACLC,EAAE,EAAE;MACR;IACJ,CAAC,CAAC;IAEF,IAAIE,WAAW,EAAE;MACbR,MAAM,CAACO,IAAI,CAAE,uCAAsC,CAAC;MACpD,OAAO,KAAK;IAChB;IAEA,OAAO,IAAI;EACf;EAEA,MAAME,OAAOA,CAAC;IAAET;EAA6B,CAAC,EAAiB;IAC3D,MAAMU,OAAO,GAAG,MAAM,IAAAC,eAAQ,EAA+B;MACzDR,MAAM,EAAE,IAAI,CAACR,YAAY;MACzBS,YAAY,EAAE,SAAS;MACvBC,OAAO,EAAE;QACLO,KAAK,EAAE,MAAM;QACbC,EAAE,EAAE;MACR;IACJ,CAAC,CAAC;IAEF,KAAK,MAAMC,MAAM,IAAIJ,OAAO,EAAE;MAC1B,MAAMT,QAAQ,GAAG,MAAM,IAAAC,eAAQ,EAAC;QAC5BC,MAAM,EAAE,IAAI,CAACV,oBAAoB;QACjCW,YAAY,EAAG,KAAIU,MAAM,CAACC,EAAG,cAAa;QAC1CV,OAAO,EAAE;UACLC,EAAE,EAAE;QACR;MACJ,CAAC,CAAC;MAEF,IAAI,CAACL,QAAQ,EAAE;QACX;QACAD,MAAM,CAACO,IAAI,CACN,UAASO,MAAM,CAACE,IAAK,KAAIF,MAAM,CAACC,EAAG,qDACxC,CAAC;QACD;MACJ;MAEAf,MAAM,CAACO,IAAI,CAAE,mCAAkCO,MAAM,CAACE,IAAK,KAAIF,MAAM,CAACC,EAAG,IAAG,CAAC;MAC7E,MAAM,IAAAE,eAAG,EAAC;QACNd,MAAM,EAAE,IAAI,CAACZ,iBAAiB;QAC9B2B,IAAI,EAAE;UACFC,EAAE,EAAG,KAAIL,MAAM,CAACC,EAAG,cAAa;UAChCK,EAAE,EAAE,GAAG;UACPC,IAAI,EAAE,aAAa;UACnBC,IAAI,EAAE;YACF,GAAG,IAAAC,qCAAe,EAACtB,QAAQ,CAAC;YAC5Ba,MAAM,EAAEA,MAAM,CAACC;UACnB;QACJ;MACJ,CAAC,CAAC;IACN;EACJ;AACJ;AAACS,OAAA,CAAApC,0CAAA,GAAAA,0CAAA","ignoreList":[]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
-
import { DataMigration, DataMigrationContext } from "@webiny/data-migration";
|
|
3
|
-
export type FileMigrationCheckpoint = Record<string, string | boolean | undefined>;
|
|
4
|
-
export declare class FileManager_5_35_0_001_FileData implements DataMigration<FileMigrationCheckpoint> {
|
|
5
|
-
private readonly newFileEntity;
|
|
6
|
-
private readonly legacyFileEntity;
|
|
7
|
-
private readonly tenantEntity;
|
|
8
|
-
private readonly localeEntity;
|
|
9
|
-
constructor(table: Table<string, string, string>);
|
|
10
|
-
getId(): string;
|
|
11
|
-
getDescription(): string;
|
|
12
|
-
shouldExecute({ logger }: DataMigrationContext): Promise<boolean>;
|
|
13
|
-
execute({ logger, ...context }: DataMigrationContext): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.FileManager_5_35_0_001_FileData = void 0;
|
|
7
|
-
var _utils = require("@webiny/utils");
|
|
8
|
-
var _utils2 = require("../../../../utils");
|
|
9
|
-
var _createFileEntity = require("../entities/createFileEntity");
|
|
10
|
-
var _createLocaleEntity = require("../entities/createLocaleEntity");
|
|
11
|
-
var _createTenantEntity = require("../entities/createTenantEntity");
|
|
12
|
-
const isGroupMigrationCompleted = status => {
|
|
13
|
-
return typeof status === "boolean";
|
|
14
|
-
};
|
|
15
|
-
class FileManager_5_35_0_001_FileData {
|
|
16
|
-
constructor(table) {
|
|
17
|
-
this.newFileEntity = (0, _utils2.createStandardEntity)(table, "File");
|
|
18
|
-
this.legacyFileEntity = (0, _createFileEntity.createLegacyFileEntity)(table);
|
|
19
|
-
this.tenantEntity = (0, _createTenantEntity.createTenantEntity)(table);
|
|
20
|
-
this.localeEntity = (0, _createLocaleEntity.createLocaleEntity)(table);
|
|
21
|
-
}
|
|
22
|
-
getId() {
|
|
23
|
-
return "FileData";
|
|
24
|
-
}
|
|
25
|
-
getDescription() {
|
|
26
|
-
return "";
|
|
27
|
-
}
|
|
28
|
-
async shouldExecute({
|
|
29
|
-
logger
|
|
30
|
-
}) {
|
|
31
|
-
const defaultLocale = await (0, _utils2.queryOne)({
|
|
32
|
-
entity: this.localeEntity,
|
|
33
|
-
partitionKey: `T#root#I18N#L#D`,
|
|
34
|
-
options: {
|
|
35
|
-
eq: "default"
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
if (!defaultLocale) {
|
|
39
|
-
logger.info(`Default locale not found; system is not yet installed.`);
|
|
40
|
-
// The system is not yet installed, skip migration.
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Check if there are file records using the old record structure
|
|
45
|
-
const PK = `T#root#L#${defaultLocale.code}#FM#F`;
|
|
46
|
-
const lastLegacyFile = await (0, _utils2.queryOne)({
|
|
47
|
-
entity: this.legacyFileEntity,
|
|
48
|
-
partitionKey: PK,
|
|
49
|
-
options: {
|
|
50
|
-
gt: " ",
|
|
51
|
-
reverse: true
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
if (!lastLegacyFile) {
|
|
55
|
-
logger.info(`No applicable files were found to migrate.`);
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
if (lastLegacyFile) {
|
|
59
|
-
// Check if there's a corresponding new file for the same file ID
|
|
60
|
-
const lastNewFile = await (0, _utils2.queryOne)({
|
|
61
|
-
entity: this.newFileEntity,
|
|
62
|
-
partitionKey: `T#root#L#${defaultLocale.code}#FM#FILE#${lastLegacyFile.id}`,
|
|
63
|
-
options: {
|
|
64
|
-
eq: "A"
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
if (lastNewFile) {
|
|
68
|
-
logger.info(`All files seem to be in order.`);
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
async execute({
|
|
75
|
-
logger,
|
|
76
|
-
...context
|
|
77
|
-
}) {
|
|
78
|
-
const tenants = await (0, _utils2.queryAll)({
|
|
79
|
-
entity: this.tenantEntity,
|
|
80
|
-
partitionKey: "TENANTS",
|
|
81
|
-
options: {
|
|
82
|
-
index: "GSI1",
|
|
83
|
-
gt: " "
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
const migrationStatus = context.checkpoint || {};
|
|
87
|
-
for (const tenant of tenants) {
|
|
88
|
-
const locales = await (0, _utils2.queryAll)({
|
|
89
|
-
entity: this.localeEntity,
|
|
90
|
-
partitionKey: `T#${tenant.id}#I18N#L`,
|
|
91
|
-
options: {
|
|
92
|
-
gt: " "
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
for (const locale of locales) {
|
|
96
|
-
const groupId = `${tenant.id}:${locale.code}`;
|
|
97
|
-
const status = migrationStatus[groupId];
|
|
98
|
-
if (isGroupMigrationCompleted(status)) {
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
let batch = 0;
|
|
102
|
-
await (0, _utils2.ddbQueryAllWithCallback)({
|
|
103
|
-
entity: this.legacyFileEntity,
|
|
104
|
-
partitionKey: `T#${tenant.id}#L#${locale.code}#FM#F`,
|
|
105
|
-
options: {
|
|
106
|
-
gt: status || " "
|
|
107
|
-
}
|
|
108
|
-
}, async files => {
|
|
109
|
-
batch++;
|
|
110
|
-
logger.info(`Processing batch #${batch} in group ${groupId} (${files.length} files).`);
|
|
111
|
-
const items = files.map(file => {
|
|
112
|
-
return this.newFileEntity.putBatch({
|
|
113
|
-
PK: `T#${tenant.id}#L#${locale.code}#FM#FILE#${file.id}`,
|
|
114
|
-
SK: "A",
|
|
115
|
-
GSI1_PK: `T#${tenant.id}#L#${locale.code}#FM#FILES`,
|
|
116
|
-
GSI1_SK: file.id,
|
|
117
|
-
TYPE: "fm.file",
|
|
118
|
-
data: {
|
|
119
|
-
...(0, _createFileEntity.getFileData)(file),
|
|
120
|
-
webinyVersion: process.env.WEBINY_VERSION
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
const execute = () => {
|
|
125
|
-
return (0, _utils2.batchWriteAll)({
|
|
126
|
-
table: this.newFileEntity.table,
|
|
127
|
-
items
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
await (0, _utils.executeWithRetry)(execute, {
|
|
131
|
-
onFailedAttempt: error => {
|
|
132
|
-
logger.error(`"batchWriteAll" attempt #${error.attemptNumber} failed.`);
|
|
133
|
-
logger.error(error.message);
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
const cursor = files[files.length - 1].id;
|
|
137
|
-
|
|
138
|
-
// Update checkpoint after every batch
|
|
139
|
-
migrationStatus[groupId] = cursor;
|
|
140
|
-
|
|
141
|
-
// Check if we should store checkpoint and exit.
|
|
142
|
-
if (context.runningOutOfTime()) {
|
|
143
|
-
await context.createCheckpointAndExit(migrationStatus);
|
|
144
|
-
} else {
|
|
145
|
-
await context.createCheckpoint(migrationStatus);
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
migrationStatus[groupId] = true;
|
|
149
|
-
await context.createCheckpoint(migrationStatus);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
exports.FileManager_5_35_0_001_FileData = FileManager_5_35_0_001_FileData;
|
|
155
|
-
|
|
156
|
-
//# sourceMappingURL=FileDataMigration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_utils","require","_utils2","_createFileEntity","_createLocaleEntity","_createTenantEntity","isGroupMigrationCompleted","status","FileManager_5_35_0_001_FileData","constructor","table","newFileEntity","createStandardEntity","legacyFileEntity","createLegacyFileEntity","tenantEntity","createTenantEntity","localeEntity","createLocaleEntity","getId","getDescription","shouldExecute","logger","defaultLocale","queryOne","entity","partitionKey","options","eq","info","PK","code","lastLegacyFile","gt","reverse","lastNewFile","id","execute","context","tenants","queryAll","index","migrationStatus","checkpoint","tenant","locales","locale","groupId","batch","ddbQueryAllWithCallback","files","length","items","map","file","putBatch","SK","GSI1_PK","GSI1_SK","TYPE","data","getFileData","webinyVersion","process","env","WEBINY_VERSION","batchWriteAll","executeWithRetry","onFailedAttempt","error","attemptNumber","message","cursor","runningOutOfTime","createCheckpointAndExit","createCheckpoint","exports"],"sources":["FileDataMigration.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { DataMigration, DataMigrationContext } from \"@webiny/data-migration\";\nimport { PrimitiveValue } from \"@webiny/api-elasticsearch/types\";\nimport { executeWithRetry } from \"@webiny/utils\";\nimport {\n createStandardEntity,\n queryOne,\n queryAll,\n ddbQueryAllWithCallback,\n batchWriteAll\n} from \"~/utils\";\nimport {\n createFileEntity,\n getFileData,\n createLegacyFileEntity\n} from \"../entities/createFileEntity\";\nimport { createLocaleEntity } from \"../entities/createLocaleEntity\";\nimport { createTenantEntity } from \"../entities/createTenantEntity\";\n\nexport type FileMigrationCheckpoint = Record<string, string | boolean | undefined>;\n\nconst isGroupMigrationCompleted = (\n status: PrimitiveValue[] | boolean | undefined\n): status is boolean => {\n return typeof status === \"boolean\";\n};\n\nexport class FileManager_5_35_0_001_FileData implements DataMigration<FileMigrationCheckpoint> {\n private readonly newFileEntity: ReturnType<typeof createFileEntity>;\n private readonly legacyFileEntity: ReturnType<typeof createLegacyFileEntity>;\n private readonly tenantEntity: ReturnType<typeof createTenantEntity>;\n private readonly localeEntity: ReturnType<typeof createLocaleEntity>;\n\n constructor(table: Table<string, string, string>) {\n this.newFileEntity = createStandardEntity(table, \"File\");\n this.legacyFileEntity = createLegacyFileEntity(table);\n this.tenantEntity = createTenantEntity(table);\n this.localeEntity = createLocaleEntity(table);\n }\n\n getId() {\n return \"FileData\";\n }\n\n getDescription() {\n return \"\";\n }\n\n async shouldExecute({ logger }: DataMigrationContext): Promise<boolean> {\n const defaultLocale = await queryOne<{ code: string }>({\n entity: this.localeEntity,\n partitionKey: `T#root#I18N#L#D`,\n options: {\n eq: \"default\"\n }\n });\n\n if (!defaultLocale) {\n logger.info(`Default locale not found; system is not yet installed.`);\n // The system is not yet installed, skip migration.\n return false;\n }\n\n // Check if there are file records using the old record structure\n const PK = `T#root#L#${defaultLocale.code}#FM#F`;\n const lastLegacyFile = await queryOne<{ id: string }>({\n entity: this.legacyFileEntity,\n partitionKey: PK,\n options: { gt: \" \", reverse: true }\n });\n\n if (!lastLegacyFile) {\n logger.info(`No applicable files were found to migrate.`);\n return false;\n }\n\n if (lastLegacyFile) {\n // Check if there's a corresponding new file for the same file ID\n const lastNewFile = await queryOne({\n entity: this.newFileEntity,\n partitionKey: `T#root#L#${defaultLocale.code}#FM#FILE#${lastLegacyFile.id}`,\n options: {\n eq: \"A\"\n }\n });\n\n if (lastNewFile) {\n logger.info(`All files seem to be in order.`);\n return false;\n }\n }\n\n return true;\n }\n\n async execute({ logger, ...context }: DataMigrationContext): Promise<void> {\n const tenants = await queryAll<{ id: string }>({\n entity: this.tenantEntity,\n partitionKey: \"TENANTS\",\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n const migrationStatus = context.checkpoint || {};\n\n for (const tenant of tenants) {\n const locales = await queryAll<{ code: string }>({\n entity: this.localeEntity,\n partitionKey: `T#${tenant.id}#I18N#L`,\n options: {\n gt: \" \"\n }\n });\n\n for (const locale of locales) {\n const groupId = `${tenant.id}:${locale.code}`;\n const status = migrationStatus[groupId];\n\n if (isGroupMigrationCompleted(status)) {\n continue;\n }\n\n let batch = 0;\n await ddbQueryAllWithCallback<{ id: string }>(\n {\n entity: this.legacyFileEntity,\n partitionKey: `T#${tenant.id}#L#${locale.code}#FM#F`,\n options: {\n gt: status || \" \"\n }\n },\n async files => {\n batch++;\n logger.info(\n `Processing batch #${batch} in group ${groupId} (${files.length} files).`\n );\n const items = files.map(file => {\n return this.newFileEntity.putBatch({\n PK: `T#${tenant.id}#L#${locale.code}#FM#FILE#${file.id}`,\n SK: \"A\",\n GSI1_PK: `T#${tenant.id}#L#${locale.code}#FM#FILES`,\n GSI1_SK: file.id,\n TYPE: \"fm.file\",\n data: {\n ...getFileData(file),\n webinyVersion: process.env.WEBINY_VERSION\n }\n });\n });\n\n const execute = () => {\n return batchWriteAll({ table: this.newFileEntity.table, items });\n };\n\n await executeWithRetry(execute, {\n onFailedAttempt: error => {\n logger.error(\n `\"batchWriteAll\" attempt #${error.attemptNumber} failed.`\n );\n logger.error(error.message);\n }\n });\n\n const cursor = files[files.length - 1].id;\n\n // Update checkpoint after every batch\n migrationStatus[groupId] = cursor;\n\n // Check if we should store checkpoint and exit.\n if (context.runningOutOfTime()) {\n await context.createCheckpointAndExit(migrationStatus);\n } else {\n await context.createCheckpoint(migrationStatus);\n }\n }\n );\n\n migrationStatus[groupId] = true;\n await context.createCheckpoint(migrationStatus);\n }\n }\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
-
import { DataMigration, DataMigrationContext } from "@webiny/data-migration";
|
|
3
|
-
export declare class FileManager_5_35_0_001 implements DataMigration {
|
|
4
|
-
private migrations;
|
|
5
|
-
constructor(table: Table<string, string, string>);
|
|
6
|
-
getId(): string;
|
|
7
|
-
getDescription(): string;
|
|
8
|
-
shouldExecute(context: DataMigrationContext): Promise<boolean>;
|
|
9
|
-
execute(context: DataMigrationContext): Promise<void>;
|
|
10
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.FileManager_5_35_0_001 = void 0;
|
|
7
|
-
var _dataMigration = require("@webiny/data-migration");
|
|
8
|
-
var _ioc = require("@webiny/ioc");
|
|
9
|
-
var _FileDataMigration = require("./FileDataMigration");
|
|
10
|
-
var _FileSettingsMigration = require("../FileSettingsMigration");
|
|
11
|
-
class FileManager_5_35_0_001 {
|
|
12
|
-
constructor(table) {
|
|
13
|
-
this.migrations = [new _FileDataMigration.FileManager_5_35_0_001_FileData(table), new _FileSettingsMigration.FileManager_5_35_0_001_FileManagerSettings(table)];
|
|
14
|
-
}
|
|
15
|
-
getId() {
|
|
16
|
-
return "5.35.0-001";
|
|
17
|
-
}
|
|
18
|
-
getDescription() {
|
|
19
|
-
return "Upgrade File Manager to use better PKs and `data` envelope.";
|
|
20
|
-
}
|
|
21
|
-
async shouldExecute(context) {
|
|
22
|
-
for (const migration of this.migrations) {
|
|
23
|
-
const childLogger = (0, _dataMigration.getChildLogger)(context.logger, migration);
|
|
24
|
-
const childContext = {
|
|
25
|
-
...context,
|
|
26
|
-
logger: childLogger
|
|
27
|
-
};
|
|
28
|
-
if (await migration.shouldExecute(childContext)) {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
async execute(context) {
|
|
35
|
-
for (const migration of this.migrations) {
|
|
36
|
-
const childLogger = (0, _dataMigration.getChildLogger)(context.logger, migration);
|
|
37
|
-
const childContext = {
|
|
38
|
-
...context,
|
|
39
|
-
logger: childLogger
|
|
40
|
-
};
|
|
41
|
-
if (await migration.shouldExecute(childContext)) {
|
|
42
|
-
await migration.execute(childContext);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.FileManager_5_35_0_001 = FileManager_5_35_0_001;
|
|
48
|
-
(0, _ioc.makeInjectable)(FileManager_5_35_0_001, [(0, _ioc.inject)(_dataMigration.PrimaryDynamoTableSymbol)]);
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_dataMigration","require","_ioc","_FileDataMigration","_FileSettingsMigration","FileManager_5_35_0_001","constructor","table","migrations","FileManager_5_35_0_001_FileData","FileManager_5_35_0_001_FileManagerSettings","getId","getDescription","shouldExecute","context","migration","childLogger","getChildLogger","logger","childContext","execute","exports","makeInjectable","inject","PrimaryDynamoTableSymbol"],"sources":["index.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport {\n DataMigration,\n DataMigrationContext,\n getChildLogger,\n PrimaryDynamoTableSymbol\n} from \"@webiny/data-migration\";\nimport { makeInjectable, inject } from \"@webiny/ioc\";\nimport { FileManager_5_35_0_001_FileData } from \"./FileDataMigration\";\nimport { FileManager_5_35_0_001_FileManagerSettings } from \"../FileSettingsMigration\";\n\nexport class FileManager_5_35_0_001 implements DataMigration {\n private migrations: DataMigration[];\n\n constructor(table: Table<string, string, string>) {\n this.migrations = [\n new FileManager_5_35_0_001_FileData(table),\n new FileManager_5_35_0_001_FileManagerSettings(table)\n ];\n }\n\n getId(): string {\n return \"5.35.0-001\";\n }\n\n getDescription(): string {\n return \"Upgrade File Manager to use better PKs and `data` envelope.\";\n }\n\n async shouldExecute(context: DataMigrationContext): Promise<boolean> {\n for (const migration of this.migrations) {\n const childLogger = getChildLogger(context.logger, migration);\n const childContext = { ...context, logger: childLogger };\n if (await migration.shouldExecute(childContext)) {\n return true;\n }\n }\n return false;\n }\n\n async execute(context: DataMigrationContext): Promise<void> {\n for (const migration of this.migrations) {\n const childLogger = getChildLogger(context.logger, migration);\n const childContext = { ...context, logger: childLogger };\n if (await migration.shouldExecute(childContext)) {\n await migration.execute(childContext);\n }\n }\n }\n}\n\nmakeInjectable(FileManager_5_35_0_001, [inject(PrimaryDynamoTableSymbol)]);\n"],"mappings":";;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AAMA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AAEO,MAAMI,sBAAsB,CAA0B;EAGzDC,WAAWA,CAACC,KAAoC,EAAE;IAC9C,IAAI,CAACC,UAAU,GAAG,CACd,IAAIC,kDAA+B,CAACF,KAAK,CAAC,EAC1C,IAAIG,iEAA0C,CAACH,KAAK,CAAC,CACxD;EACL;EAEAI,KAAKA,CAAA,EAAW;IACZ,OAAO,YAAY;EACvB;EAEAC,cAAcA,CAAA,EAAW;IACrB,OAAO,6DAA6D;EACxE;EAEA,MAAMC,aAAaA,CAACC,OAA6B,EAAoB;IACjE,KAAK,MAAMC,SAAS,IAAI,IAAI,CAACP,UAAU,EAAE;MACrC,MAAMQ,WAAW,GAAG,IAAAC,6BAAc,EAACH,OAAO,CAACI,MAAM,EAAEH,SAAS,CAAC;MAC7D,MAAMI,YAAY,GAAG;QAAE,GAAGL,OAAO;QAAEI,MAAM,EAAEF;MAAY,CAAC;MACxD,IAAI,MAAMD,SAAS,CAACF,aAAa,CAACM,YAAY,CAAC,EAAE;QAC7C,OAAO,IAAI;MACf;IACJ;IACA,OAAO,KAAK;EAChB;EAEA,MAAMC,OAAOA,CAACN,OAA6B,EAAiB;IACxD,KAAK,MAAMC,SAAS,IAAI,IAAI,CAACP,UAAU,EAAE;MACrC,MAAMQ,WAAW,GAAG,IAAAC,6BAAc,EAACH,OAAO,CAACI,MAAM,EAAEH,SAAS,CAAC;MAC7D,MAAMI,YAAY,GAAG;QAAE,GAAGL,OAAO;QAAEI,MAAM,EAAEF;MAAY,CAAC;MACxD,IAAI,MAAMD,SAAS,CAACF,aAAa,CAACM,YAAY,CAAC,EAAE;QAC7C,MAAMJ,SAAS,CAACK,OAAO,CAACD,YAAY,CAAC;MACzC;IACJ;EACJ;AACJ;AAACE,OAAA,CAAAhB,sBAAA,GAAAA,sBAAA;AAED,IAAAiB,mBAAc,EAACjB,sBAAsB,EAAE,CAAC,IAAAkB,WAAM,EAACC,uCAAwB,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
-
import { Client } from "@elastic/elasticsearch";
|
|
3
|
-
import { PrimitiveValue } from "@webiny/api-elasticsearch/types";
|
|
4
|
-
import { DataMigration, DataMigrationContext } from "@webiny/data-migration";
|
|
5
|
-
type FileMigrationCheckpoint = Record<string, PrimitiveValue[] | boolean | undefined>;
|
|
6
|
-
export declare class FileManager_5_35_0_001_FileData implements DataMigration<FileMigrationCheckpoint> {
|
|
7
|
-
private readonly elasticsearchClient;
|
|
8
|
-
private readonly newFileEntity;
|
|
9
|
-
private readonly tenantEntity;
|
|
10
|
-
private readonly localeEntity;
|
|
11
|
-
constructor(table: Table<string, string, string>, elasticsearchClient: Client);
|
|
12
|
-
getId(): string;
|
|
13
|
-
getDescription(): string;
|
|
14
|
-
shouldExecute({ logger, checkpoint }: DataMigrationContext): Promise<boolean>;
|
|
15
|
-
execute({ logger, ...context }: DataMigrationContext<FileMigrationCheckpoint>): Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|