@webiny/migrations 5.39.7-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +26 -0
- package/README.md +1 -0
- package/ddb-es.d.ts +18 -0
- package/ddb-es.js +67 -0
- package/ddb-es.js.map +1 -0
- package/ddb.d.ts +18 -0
- package/ddb.js +49 -0
- package/ddb.js.map +1 -0
- package/migrations/5.35.0/001/FileSettingsMigration.d.ts +12 -0
- package/migrations/5.35.0/001/FileSettingsMigration.js +93 -0
- package/migrations/5.35.0/001/FileSettingsMigration.js.map +1 -0
- package/migrations/5.35.0/001/ddb/FileDataMigration.d.ts +14 -0
- package/migrations/5.35.0/001/ddb/FileDataMigration.js +156 -0
- package/migrations/5.35.0/001/ddb/FileDataMigration.js.map +1 -0
- package/migrations/5.35.0/001/ddb/index.d.ts +10 -0
- package/migrations/5.35.0/001/ddb/index.js +50 -0
- package/migrations/5.35.0/001/ddb/index.js.map +1 -0
- package/migrations/5.35.0/001/ddb-es/FileDataMigration.d.ts +17 -0
- package/migrations/5.35.0/001/ddb-es/FileDataMigration.js +172 -0
- package/migrations/5.35.0/001/ddb-es/FileDataMigration.js.map +1 -0
- package/migrations/5.35.0/001/ddb-es/index.d.ts +12 -0
- package/migrations/5.35.0/001/ddb-es/index.js +65 -0
- package/migrations/5.35.0/001/ddb-es/index.js.map +1 -0
- package/migrations/5.35.0/001/entities/createFileEntity.d.ts +92 -0
- package/migrations/5.35.0/001/entities/createFileEntity.js +62 -0
- package/migrations/5.35.0/001/entities/createFileEntity.js.map +1 -0
- package/migrations/5.35.0/001/entities/createLocaleEntity.d.ts +42 -0
- package/migrations/5.35.0/001/entities/createLocaleEntity.js +52 -0
- package/migrations/5.35.0/001/entities/createLocaleEntity.js.map +1 -0
- package/migrations/5.35.0/001/entities/createSettingsEntity.d.ts +90 -0
- package/migrations/5.35.0/001/entities/createSettingsEntity.js +37 -0
- package/migrations/5.35.0/001/entities/createSettingsEntity.js.map +1 -0
- package/migrations/5.35.0/001/entities/createTenantEntity.d.ts +42 -0
- package/migrations/5.35.0/001/entities/createTenantEntity.js +69 -0
- package/migrations/5.35.0/001/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.35.0/001/types.d.ts +19 -0
- package/migrations/5.35.0/001/types.js +7 -0
- package/migrations/5.35.0/001/types.js.map +1 -0
- package/migrations/5.35.0/002/createLocaleEntity.d.ts +42 -0
- package/migrations/5.35.0/002/createLocaleEntity.js +32 -0
- package/migrations/5.35.0/002/createLocaleEntity.js.map +1 -0
- package/migrations/5.35.0/002/createSettingsEntity.d.ts +90 -0
- package/migrations/5.35.0/002/createSettingsEntity.js +61 -0
- package/migrations/5.35.0/002/createSettingsEntity.js.map +1 -0
- package/migrations/5.35.0/002/createTenantEntity.d.ts +42 -0
- package/migrations/5.35.0/002/createTenantEntity.js +46 -0
- package/migrations/5.35.0/002/createTenantEntity.js.map +1 -0
- package/migrations/5.35.0/002/index.d.ts +13 -0
- package/migrations/5.35.0/002/index.js +117 -0
- package/migrations/5.35.0/002/index.js.map +1 -0
- package/migrations/5.35.0/003/createTenantEntity.d.ts +42 -0
- package/migrations/5.35.0/003/createTenantEntity.js +46 -0
- package/migrations/5.35.0/003/createTenantEntity.js.map +1 -0
- package/migrations/5.35.0/003/createUserEntity.d.ts +90 -0
- package/migrations/5.35.0/003/createUserEntity.js +55 -0
- package/migrations/5.35.0/003/createUserEntity.js.map +1 -0
- package/migrations/5.35.0/003/index.d.ts +12 -0
- package/migrations/5.35.0/003/index.js +92 -0
- package/migrations/5.35.0/003/index.js.map +1 -0
- package/migrations/5.35.0/004/createTenantEntity.d.ts +90 -0
- package/migrations/5.35.0/004/createTenantEntity.js +57 -0
- package/migrations/5.35.0/004/createTenantEntity.js.map +1 -0
- package/migrations/5.35.0/004/index.d.ts +11 -0
- package/migrations/5.35.0/004/index.js +80 -0
- package/migrations/5.35.0/004/index.js.map +1 -0
- package/migrations/5.35.0/005/createLocaleEntity.d.ts +42 -0
- package/migrations/5.35.0/005/createLocaleEntity.js +32 -0
- package/migrations/5.35.0/005/createLocaleEntity.js.map +1 -0
- package/migrations/5.35.0/005/createModelEntity.d.ts +42 -0
- package/migrations/5.35.0/005/createModelEntity.js +101 -0
- package/migrations/5.35.0/005/createModelEntity.js.map +1 -0
- package/migrations/5.35.0/005/createTenantEntity.d.ts +48 -0
- package/migrations/5.35.0/005/createTenantEntity.js +13 -0
- package/migrations/5.35.0/005/createTenantEntity.js.map +1 -0
- package/migrations/5.35.0/005/index.d.ts +15 -0
- package/migrations/5.35.0/005/index.js +144 -0
- package/migrations/5.35.0/005/index.js.map +1 -0
- package/migrations/5.35.0/005/types.d.ts +42 -0
- package/migrations/5.35.0/005/types.js +7 -0
- package/migrations/5.35.0/005/types.js.map +1 -0
- package/migrations/5.35.0/006/constants.d.ts +3 -0
- package/migrations/5.35.0/006/constants.js +14 -0
- package/migrations/5.35.0/006/constants.js.map +1 -0
- package/migrations/5.35.0/006/ddb/PageDataMigration.d.ts +17 -0
- package/migrations/5.35.0/006/ddb/PageDataMigration.js +249 -0
- package/migrations/5.35.0/006/ddb/PageDataMigration.js.map +1 -0
- package/migrations/5.35.0/006/ddb/index.d.ts +10 -0
- package/migrations/5.35.0/006/ddb/index.js +49 -0
- package/migrations/5.35.0/006/ddb/index.js.map +1 -0
- package/migrations/5.35.0/006/ddb-es/PageDataMigration.d.ts +22 -0
- package/migrations/5.35.0/006/ddb-es/PageDataMigration.js +413 -0
- package/migrations/5.35.0/006/ddb-es/PageDataMigration.js.map +1 -0
- package/migrations/5.35.0/006/ddb-es/index.d.ts +12 -0
- package/migrations/5.35.0/006/ddb-es/index.js +64 -0
- package/migrations/5.35.0/006/ddb-es/index.js.map +1 -0
- package/migrations/5.35.0/006/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.35.0/006/entities/createEntryEntity.js +106 -0
- package/migrations/5.35.0/006/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.35.0/006/entities/createLocaleEntity.d.ts +42 -0
- package/migrations/5.35.0/006/entities/createLocaleEntity.js +32 -0
- package/migrations/5.35.0/006/entities/createLocaleEntity.js.map +1 -0
- package/migrations/5.35.0/006/entities/createPageEntity.d.ts +89 -0
- package/migrations/5.35.0/006/entities/createPageEntity.js +113 -0
- package/migrations/5.35.0/006/entities/createPageEntity.js.map +1 -0
- package/migrations/5.35.0/006/entities/createTenantEntity.d.ts +48 -0
- package/migrations/5.35.0/006/entities/createTenantEntity.js +13 -0
- package/migrations/5.35.0/006/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.35.0/006/types.d.ts +91 -0
- package/migrations/5.35.0/006/types.js +7 -0
- package/migrations/5.35.0/006/types.js.map +1 -0
- package/migrations/5.35.0/006/utils/getCompressedData.d.ts +4 -0
- package/migrations/5.35.0/006/utils/getCompressedData.js +19 -0
- package/migrations/5.35.0/006/utils/getCompressedData.js.map +1 -0
- package/migrations/5.35.0/006/utils/getLexicalContentText.d.ts +1 -0
- package/migrations/5.35.0/006/utils/getLexicalContentText.js +29 -0
- package/migrations/5.35.0/006/utils/getLexicalContentText.js.map +1 -0
- package/migrations/5.35.0/006/utils/getSearchableContent.d.ts +6 -0
- package/migrations/5.35.0/006/utils/getSearchableContent.js +45 -0
- package/migrations/5.35.0/006/utils/getSearchableContent.js.map +1 -0
- package/migrations/5.35.0/006/utils/processors/button.d.ts +1 -0
- package/migrations/5.35.0/006/utils/processors/button.js +17 -0
- package/migrations/5.35.0/006/utils/processors/button.js.map +1 -0
- package/migrations/5.35.0/006/utils/processors/image.d.ts +1 -0
- package/migrations/5.35.0/006/utils/processors/image.js +17 -0
- package/migrations/5.35.0/006/utils/processors/image.js.map +1 -0
- package/migrations/5.35.0/006/utils/processors/images.d.ts +1 -0
- package/migrations/5.35.0/006/utils/processors/images.js +18 -0
- package/migrations/5.35.0/006/utils/processors/images.js.map +1 -0
- package/migrations/5.35.0/006/utils/processors/index.d.ts +1 -0
- package/migrations/5.35.0/006/utils/processors/index.js +14 -0
- package/migrations/5.35.0/006/utils/processors/index.js.map +1 -0
- package/migrations/5.35.0/006/utils/processors/paragraph.d.ts +1 -0
- package/migrations/5.35.0/006/utils/processors/paragraph.js +25 -0
- package/migrations/5.35.0/006/utils/processors/paragraph.js.map +1 -0
- package/migrations/5.36.0/001/constants.d.ts +3 -0
- package/migrations/5.36.0/001/constants.js +14 -0
- package/migrations/5.36.0/001/constants.js.map +1 -0
- package/migrations/5.36.0/001/ddb/FileDataMigration.d.ts +17 -0
- package/migrations/5.36.0/001/ddb/FileDataMigration.js +241 -0
- package/migrations/5.36.0/001/ddb/FileDataMigration.js.map +1 -0
- package/migrations/5.36.0/001/ddb/index.d.ts +10 -0
- package/migrations/5.36.0/001/ddb/index.js +49 -0
- package/migrations/5.36.0/001/ddb/index.js.map +1 -0
- package/migrations/5.36.0/001/ddb-es/FileDataMigration.d.ts +20 -0
- package/migrations/5.36.0/001/ddb-es/FileDataMigration.js +405 -0
- package/migrations/5.36.0/001/ddb-es/FileDataMigration.js.map +1 -0
- package/migrations/5.36.0/001/ddb-es/index.d.ts +12 -0
- package/migrations/5.36.0/001/ddb-es/index.js +64 -0
- package/migrations/5.36.0/001/ddb-es/index.js.map +1 -0
- package/migrations/5.36.0/001/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.36.0/001/entities/createEntryEntity.js +106 -0
- package/migrations/5.36.0/001/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.36.0/001/entities/createFileEntity.d.ts +95 -0
- package/migrations/5.36.0/001/entities/createFileEntity.js +33 -0
- package/migrations/5.36.0/001/entities/createFileEntity.js.map +1 -0
- package/migrations/5.36.0/001/entities/createLocaleEntity.d.ts +42 -0
- package/migrations/5.36.0/001/entities/createLocaleEntity.js +32 -0
- package/migrations/5.36.0/001/entities/createLocaleEntity.js.map +1 -0
- package/migrations/5.36.0/001/entities/createTenantEntity.d.ts +48 -0
- package/migrations/5.36.0/001/entities/createTenantEntity.js +13 -0
- package/migrations/5.36.0/001/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.36.0/001/types.d.ts +67 -0
- package/migrations/5.36.0/001/types.js +7 -0
- package/migrations/5.36.0/001/types.js.map +1 -0
- package/migrations/5.36.0/001/utils/createMimeTag.d.ts +1 -0
- package/migrations/5.36.0/001/utils/createMimeTag.js +10 -0
- package/migrations/5.36.0/001/utils/createMimeTag.js.map +1 -0
- package/migrations/5.36.0/001/utils/getCompressedData.d.ts +4 -0
- package/migrations/5.36.0/001/utils/getCompressedData.js +19 -0
- package/migrations/5.36.0/001/utils/getCompressedData.js.map +1 -0
- package/migrations/5.37.0/001/TenantLinkDataMigration.d.ts +14 -0
- package/migrations/5.37.0/001/TenantLinkDataMigration.js +106 -0
- package/migrations/5.37.0/001/TenantLinkDataMigration.js.map +1 -0
- package/migrations/5.37.0/001/entities/createTenantEntity.d.ts +48 -0
- package/migrations/5.37.0/001/entities/createTenantEntity.js +13 -0
- package/migrations/5.37.0/001/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.37.0/001/entities/createTenantLinkEntity.d.ts +48 -0
- package/migrations/5.37.0/001/entities/createTenantLinkEntity.js +17 -0
- package/migrations/5.37.0/001/entities/createTenantLinkEntity.js.map +1 -0
- package/migrations/5.37.0/001/index.d.ts +10 -0
- package/migrations/5.37.0/001/index.js +49 -0
- package/migrations/5.37.0/001/index.js.map +1 -0
- package/migrations/5.37.0/001/types.d.ts +25 -0
- package/migrations/5.37.0/001/types.js +7 -0
- package/migrations/5.37.0/001/types.js.map +1 -0
- package/migrations/5.37.0/001/utils/isMigratedTenantLink.d.ts +2 -0
- package/migrations/5.37.0/001/utils/isMigratedTenantLink.js +12 -0
- package/migrations/5.37.0/001/utils/isMigratedTenantLink.js.map +1 -0
- package/migrations/5.37.0/002/constants.d.ts +1 -0
- package/migrations/5.37.0/002/constants.js +10 -0
- package/migrations/5.37.0/002/constants.js.map +1 -0
- package/migrations/5.37.0/002/ddb/index.d.ts +22 -0
- package/migrations/5.37.0/002/ddb/index.js +133 -0
- package/migrations/5.37.0/002/ddb/index.js.map +1 -0
- package/migrations/5.37.0/002/ddb-es/index.d.ts +35 -0
- package/migrations/5.37.0/002/ddb-es/index.js +321 -0
- package/migrations/5.37.0/002/ddb-es/index.js.map +1 -0
- package/migrations/5.37.0/002/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.37.0/002/entities/createEntryEntity.js +109 -0
- package/migrations/5.37.0/002/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.37.0/002/entities/createLocaleEntity.d.ts +42 -0
- package/migrations/5.37.0/002/entities/createLocaleEntity.js +32 -0
- package/migrations/5.37.0/002/entities/createLocaleEntity.js.map +1 -0
- package/migrations/5.37.0/002/entities/createTenantEntity.d.ts +48 -0
- package/migrations/5.37.0/002/entities/createTenantEntity.js +13 -0
- package/migrations/5.37.0/002/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.37.0/002/types.d.ts +53 -0
- package/migrations/5.37.0/002/types.js +7 -0
- package/migrations/5.37.0/002/types.js.map +1 -0
- package/migrations/5.37.0/002/utils/getCompressedData.d.ts +4 -0
- package/migrations/5.37.0/002/utils/getCompressedData.js +19 -0
- package/migrations/5.37.0/002/utils/getCompressedData.js.map +1 -0
- package/migrations/5.37.0/002/utils/getDecompressedData.d.ts +1 -0
- package/migrations/5.37.0/002/utils/getDecompressedData.js +31 -0
- package/migrations/5.37.0/002/utils/getDecompressedData.js.map +1 -0
- package/migrations/5.37.0/003/constants.d.ts +3 -0
- package/migrations/5.37.0/003/constants.js +14 -0
- package/migrations/5.37.0/003/constants.js.map +1 -0
- package/migrations/5.37.0/003/ddb/AcoFolderMigration.d.ts +15 -0
- package/migrations/5.37.0/003/ddb/AcoFolderMigration.js +179 -0
- package/migrations/5.37.0/003/ddb/AcoFolderMigration.js.map +1 -0
- package/migrations/5.37.0/003/ddb/index.d.ts +10 -0
- package/migrations/5.37.0/003/ddb/index.js +49 -0
- package/migrations/5.37.0/003/ddb/index.js.map +1 -0
- package/migrations/5.37.0/003/ddb-es/AcoFolderMigration.d.ts +20 -0
- package/migrations/5.37.0/003/ddb-es/AcoFolderMigration.js +313 -0
- package/migrations/5.37.0/003/ddb-es/AcoFolderMigration.js.map +1 -0
- package/migrations/5.37.0/003/ddb-es/index.d.ts +12 -0
- package/migrations/5.37.0/003/ddb-es/index.js +64 -0
- package/migrations/5.37.0/003/ddb-es/index.js.map +1 -0
- package/migrations/5.37.0/003/ddb-es/latestElasticsearchData.d.ts +4 -0
- package/migrations/5.37.0/003/ddb-es/latestElasticsearchData.js +30 -0
- package/migrations/5.37.0/003/ddb-es/latestElasticsearchData.js.map +1 -0
- package/migrations/5.37.0/003/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.37.0/003/entities/createEntryEntity.js +109 -0
- package/migrations/5.37.0/003/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.37.0/003/entities/createLocaleEntity.d.ts +42 -0
- package/migrations/5.37.0/003/entities/createLocaleEntity.js +32 -0
- package/migrations/5.37.0/003/entities/createLocaleEntity.js.map +1 -0
- package/migrations/5.37.0/003/entities/createTenantEntity.d.ts +48 -0
- package/migrations/5.37.0/003/entities/createTenantEntity.js +13 -0
- package/migrations/5.37.0/003/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.37.0/003/types.d.ts +46 -0
- package/migrations/5.37.0/003/types.js +7 -0
- package/migrations/5.37.0/003/types.js.map +1 -0
- package/migrations/5.37.0/003/utils/getCompressedData.d.ts +4 -0
- package/migrations/5.37.0/003/utils/getCompressedData.js +19 -0
- package/migrations/5.37.0/003/utils/getCompressedData.js.map +1 -0
- package/migrations/5.37.0/003/utils/getDecompressedData.d.ts +1 -0
- package/migrations/5.37.0/003/utils/getDecompressedData.js +31 -0
- package/migrations/5.37.0/003/utils/getDecompressedData.js.map +1 -0
- package/migrations/5.37.0/004/constants.d.ts +7 -0
- package/migrations/5.37.0/004/constants.js +22 -0
- package/migrations/5.37.0/004/constants.js.map +1 -0
- package/migrations/5.37.0/004/ddb/PageDataMigration.d.ts +17 -0
- package/migrations/5.37.0/004/ddb/PageDataMigration.js +269 -0
- package/migrations/5.37.0/004/ddb/PageDataMigration.js.map +1 -0
- package/migrations/5.37.0/004/ddb/index.d.ts +10 -0
- package/migrations/5.37.0/004/ddb/index.js +49 -0
- package/migrations/5.37.0/004/ddb/index.js.map +1 -0
- package/migrations/5.37.0/004/ddb-es/PageDataMigration.d.ts +22 -0
- package/migrations/5.37.0/004/ddb-es/PageDataMigration.js +364 -0
- package/migrations/5.37.0/004/ddb-es/PageDataMigration.js.map +1 -0
- package/migrations/5.37.0/004/ddb-es/index.d.ts +12 -0
- package/migrations/5.37.0/004/ddb-es/index.js +64 -0
- package/migrations/5.37.0/004/ddb-es/index.js.map +1 -0
- package/migrations/5.37.0/004/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.37.0/004/entities/createEntryEntity.js +109 -0
- package/migrations/5.37.0/004/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.37.0/004/entities/createLocaleEntity.d.ts +42 -0
- package/migrations/5.37.0/004/entities/createLocaleEntity.js +32 -0
- package/migrations/5.37.0/004/entities/createLocaleEntity.js.map +1 -0
- package/migrations/5.37.0/004/entities/createPageEntity.d.ts +89 -0
- package/migrations/5.37.0/004/entities/createPageEntity.js +113 -0
- package/migrations/5.37.0/004/entities/createPageEntity.js.map +1 -0
- package/migrations/5.37.0/004/entities/createTenantEntity.d.ts +48 -0
- package/migrations/5.37.0/004/entities/createTenantEntity.js +13 -0
- package/migrations/5.37.0/004/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.37.0/004/types.d.ts +149 -0
- package/migrations/5.37.0/004/types.js +7 -0
- package/migrations/5.37.0/004/types.js.map +1 -0
- package/migrations/5.37.0/004/utils/getCompressedData.d.ts +4 -0
- package/migrations/5.37.0/004/utils/getCompressedData.js +19 -0
- package/migrations/5.37.0/004/utils/getCompressedData.js.map +1 -0
- package/migrations/5.37.0/005/constants.d.ts +3 -0
- package/migrations/5.37.0/005/constants.js +14 -0
- package/migrations/5.37.0/005/constants.js.map +1 -0
- package/migrations/5.37.0/005/ddb/index.d.ts +20 -0
- package/migrations/5.37.0/005/ddb/index.js +245 -0
- package/migrations/5.37.0/005/ddb/index.js.map +1 -0
- package/migrations/5.37.0/005/ddb-es/index.d.ts +22 -0
- package/migrations/5.37.0/005/ddb-es/index.js +382 -0
- package/migrations/5.37.0/005/ddb-es/index.js.map +1 -0
- package/migrations/5.37.0/005/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.37.0/005/entities/createEntryEntity.js +109 -0
- package/migrations/5.37.0/005/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.37.0/005/entities/createFileEntity.d.ts +95 -0
- package/migrations/5.37.0/005/entities/createFileEntity.js +33 -0
- package/migrations/5.37.0/005/entities/createFileEntity.js.map +1 -0
- package/migrations/5.37.0/005/entities/createLocaleEntity.d.ts +42 -0
- package/migrations/5.37.0/005/entities/createLocaleEntity.js +32 -0
- package/migrations/5.37.0/005/entities/createLocaleEntity.js.map +1 -0
- package/migrations/5.37.0/005/entities/createTenantEntity.d.ts +48 -0
- package/migrations/5.37.0/005/entities/createTenantEntity.js +13 -0
- package/migrations/5.37.0/005/entities/createTenantEntity.js.map +1 -0
- package/migrations/5.37.0/005/entities/createTenantLinkEntity.d.ts +48 -0
- package/migrations/5.37.0/005/entities/createTenantLinkEntity.js +17 -0
- package/migrations/5.37.0/005/entities/createTenantLinkEntity.js.map +1 -0
- package/migrations/5.37.0/005/types.d.ts +109 -0
- package/migrations/5.37.0/005/types.js +7 -0
- package/migrations/5.37.0/005/types.js.map +1 -0
- package/migrations/5.38.0/001/ddb/index.d.ts +11 -0
- package/migrations/5.38.0/001/ddb/index.js +116 -0
- package/migrations/5.38.0/001/ddb/index.js.map +1 -0
- package/migrations/5.38.0/001/ddb-es/index.d.ts +13 -0
- package/migrations/5.38.0/001/ddb-es/index.js +211 -0
- package/migrations/5.38.0/001/ddb-es/index.js.map +1 -0
- package/migrations/5.38.0/001/entities/createFormEntity.d.ts +42 -0
- package/migrations/5.38.0/001/entities/createFormEntity.js +92 -0
- package/migrations/5.38.0/001/entities/createFormEntity.js.map +1 -0
- package/migrations/5.38.0/001/types.d.ts +11 -0
- package/migrations/5.38.0/001/types.js +7 -0
- package/migrations/5.38.0/001/types.js.map +1 -0
- package/migrations/5.38.0/002/ddb/index.d.ts +22 -0
- package/migrations/5.38.0/002/ddb/index.js +140 -0
- package/migrations/5.38.0/002/ddb/index.js.map +1 -0
- package/migrations/5.38.0/002/ddb-es/index.d.ts +32 -0
- package/migrations/5.38.0/002/ddb-es/index.js +250 -0
- package/migrations/5.38.0/002/ddb-es/index.js.map +1 -0
- package/migrations/5.38.0/002/entities/createFormEntity.d.ts +42 -0
- package/migrations/5.38.0/002/entities/createFormEntity.js +92 -0
- package/migrations/5.38.0/002/entities/createFormEntity.js.map +1 -0
- package/migrations/5.38.0/002/entities/createFormSubmissionDdbEsEntity.d.ts +48 -0
- package/migrations/5.38.0/002/entities/createFormSubmissionDdbEsEntity.js +29 -0
- package/migrations/5.38.0/002/entities/createFormSubmissionDdbEsEntity.js.map +1 -0
- package/migrations/5.38.0/002/entities/createFormSubmissionEntity.d.ts +42 -0
- package/migrations/5.38.0/002/entities/createFormSubmissionEntity.js +56 -0
- package/migrations/5.38.0/002/entities/createFormSubmissionEntity.js.map +1 -0
- package/migrations/5.38.0/002/types.d.ts +23 -0
- package/migrations/5.38.0/002/types.js +7 -0
- package/migrations/5.38.0/002/types.js.map +1 -0
- package/migrations/5.38.0/003/ddb/compressContent.d.ts +4 -0
- package/migrations/5.38.0/003/ddb/compressContent.js +17 -0
- package/migrations/5.38.0/003/ddb/compressContent.js.map +1 -0
- package/migrations/5.38.0/003/ddb/index.d.ts +12 -0
- package/migrations/5.38.0/003/ddb/index.js +143 -0
- package/migrations/5.38.0/003/ddb/index.js.map +1 -0
- package/migrations/5.38.0/003/entities/createPageBlockEntity.d.ts +83 -0
- package/migrations/5.38.0/003/entities/createPageBlockEntity.js +68 -0
- package/migrations/5.38.0/003/entities/createPageBlockEntity.js.map +1 -0
- package/migrations/5.38.0/003/types.d.ts +8 -0
- package/migrations/5.38.0/003/types.js +7 -0
- package/migrations/5.38.0/003/types.js.map +1 -0
- package/migrations/5.39.0/001/ddb/index.d.ts +20 -0
- package/migrations/5.39.0/001/ddb/index.js +136 -0
- package/migrations/5.39.0/001/ddb/index.js.map +1 -0
- package/migrations/5.39.0/001/ddb-es/index.d.ts +30 -0
- package/migrations/5.39.0/001/ddb-es/index.js +266 -0
- package/migrations/5.39.0/001/ddb-es/index.js.map +1 -0
- package/migrations/5.39.0/001/entities/createEntryEntity.d.ts +89 -0
- package/migrations/5.39.0/001/entities/createEntryEntity.js +164 -0
- package/migrations/5.39.0/001/entities/createEntryEntity.js.map +1 -0
- package/migrations/5.39.0/001/types.d.ts +136 -0
- package/migrations/5.39.0/001/types.js +7 -0
- package/migrations/5.39.0/001/types.js.map +1 -0
- package/migrations/5.39.0/001/utils/assignNewMetaFields.d.ts +11 -0
- package/migrations/5.39.0/001/utils/assignNewMetaFields.js +44 -0
- package/migrations/5.39.0/001/utils/assignNewMetaFields.js.map +1 -0
- package/migrations/5.39.0/001/utils/ensureAllNonNullableValues.d.ts +8 -0
- package/migrations/5.39.0/001/utils/ensureAllNonNullableValues.js +38 -0
- package/migrations/5.39.0/001/utils/ensureAllNonNullableValues.js.map +1 -0
- package/migrations/5.39.0/001/utils/fixTypeFieldValue.d.ts +3 -0
- package/migrations/5.39.0/001/utils/fixTypeFieldValue.js +33 -0
- package/migrations/5.39.0/001/utils/fixTypeFieldValue.js.map +1 -0
- package/migrations/5.39.0/001/utils/getCompressedData.d.ts +4 -0
- package/migrations/5.39.0/001/utils/getCompressedData.js +19 -0
- package/migrations/5.39.0/001/utils/getCompressedData.js.map +1 -0
- package/migrations/5.39.0/001/utils/getDecompressedData.d.ts +1 -0
- package/migrations/5.39.0/001/utils/getDecompressedData.js +31 -0
- package/migrations/5.39.0/001/utils/getDecompressedData.js.map +1 -0
- package/migrations/5.39.0/001/utils/getFallbackIdentity.d.ts +8 -0
- package/migrations/5.39.0/001/utils/getFallbackIdentity.js +44 -0
- package/migrations/5.39.0/001/utils/getFallbackIdentity.js.map +1 -0
- package/migrations/5.39.0/001/utils/getFirstLastPublishedOn.d.ts +11 -0
- package/migrations/5.39.0/001/utils/getFirstLastPublishedOn.js +40 -0
- package/migrations/5.39.0/001/utils/getFirstLastPublishedOn.js.map +1 -0
- package/migrations/5.39.0/001/utils/getNonNullableFieldsWithMissingValues.d.ts +2 -0
- package/migrations/5.39.0/001/utils/getNonNullableFieldsWithMissingValues.js +22 -0
- package/migrations/5.39.0/001/utils/getNonNullableFieldsWithMissingValues.js.map +1 -0
- package/migrations/5.39.0/001/utils/getOldestRevisionCreatedOn.d.ts +11 -0
- package/migrations/5.39.0/001/utils/getOldestRevisionCreatedOn.js +33 -0
- package/migrations/5.39.0/001/utils/getOldestRevisionCreatedOn.js.map +1 -0
- package/migrations/5.39.0/001/utils/hasAllNonNullableValues.d.ts +2 -0
- package/migrations/5.39.0/001/utils/hasAllNonNullableValues.js +21 -0
- package/migrations/5.39.0/001/utils/hasAllNonNullableValues.js.map +1 -0
- package/migrations/5.39.0/001/utils/hasValidTypeFieldValue.d.ts +4 -0
- package/migrations/5.39.0/001/utils/hasValidTypeFieldValue.js +21 -0
- package/migrations/5.39.0/001/utils/hasValidTypeFieldValue.js.map +1 -0
- package/migrations/5.39.0/001/utils/isMigratedEntry.d.ts +2 -0
- package/migrations/5.39.0/001/utils/isMigratedEntry.js +12 -0
- package/migrations/5.39.0/001/utils/isMigratedEntry.js.map +1 -0
- package/migrations/5.39.0/002/ddb/FileManager_5_39_0_002.d.ts +14 -0
- package/migrations/5.39.0/002/ddb/FileManager_5_39_0_002.js +133 -0
- package/migrations/5.39.0/002/ddb/FileManager_5_39_0_002.js.map +1 -0
- package/migrations/5.39.0/002/ddb/index.d.ts +1 -0
- package/migrations/5.39.0/002/ddb/index.js +18 -0
- package/migrations/5.39.0/002/ddb/index.js.map +1 -0
- package/migrations/5.39.0/002/ddb-es/FileManager_5_39_0_002.d.ts +15 -0
- package/migrations/5.39.0/002/ddb-es/FileManager_5_39_0_002.js +190 -0
- package/migrations/5.39.0/002/ddb-es/FileManager_5_39_0_002.js.map +1 -0
- package/migrations/5.39.0/002/ddb-es/index.d.ts +1 -0
- package/migrations/5.39.0/002/ddb-es/index.js +18 -0
- package/migrations/5.39.0/002/ddb-es/index.js.map +1 -0
- package/migrations/5.39.0/002/utils/FileMetadata.d.ts +12 -0
- package/migrations/5.39.0/002/utils/FileMetadata.js +55 -0
- package/migrations/5.39.0/002/utils/FileMetadata.js.map +1 -0
- package/migrations/5.39.0/002/utils/createFileEntity.d.ts +53 -0
- package/migrations/5.39.0/002/utils/createFileEntity.js +50 -0
- package/migrations/5.39.0/002/utils/createFileEntity.js.map +1 -0
- package/migrations/5.39.0/002/utils/createLocaleEntity.d.ts +42 -0
- package/migrations/5.39.0/002/utils/createLocaleEntity.js +32 -0
- package/migrations/5.39.0/002/utils/createLocaleEntity.js.map +1 -0
- package/migrations/5.39.0/002/utils/createTenantEntity.d.ts +48 -0
- package/migrations/5.39.0/002/utils/createTenantEntity.js +13 -0
- package/migrations/5.39.0/002/utils/createTenantEntity.js.map +1 -0
- package/migrations/5.39.2/001/ddb-es/index.d.ts +30 -0
- package/migrations/5.39.2/001/ddb-es/index.js +276 -0
- package/migrations/5.39.2/001/ddb-es/index.js.map +1 -0
- package/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.d.ts +21 -0
- package/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.js +167 -0
- package/migrations/5.39.6/001/ddb-es/MetaFieldsMigration.js.map +1 -0
- package/migrations/5.39.6/001/ddb-es/SegmentProcessor.d.ts +23 -0
- package/migrations/5.39.6/001/ddb-es/SegmentProcessor.js +31 -0
- package/migrations/5.39.6/001/ddb-es/SegmentProcessor.js.map +1 -0
- package/migrations/5.39.6/001/ddb-es/bin.d.ts +2 -0
- package/migrations/5.39.6/001/ddb-es/bin.js +83 -0
- package/migrations/5.39.6/001/ddb-es/bin.js.map +1 -0
- package/migrations/5.39.6/001/ddb-es/createMetaFieldsDataMigrationDeploymentHook.d.ts +11 -0
- package/migrations/5.39.6/001/ddb-es/createMetaFieldsDataMigrationDeploymentHook.js +83 -0
- package/migrations/5.39.6/001/ddb-es/createMetaFieldsDataMigrationDeploymentHook.js.map +1 -0
- package/migrations/5.39.6/001/ddb-es/index.d.ts +30 -0
- package/migrations/5.39.6/001/ddb-es/index.js +329 -0
- package/migrations/5.39.6/001/ddb-es/index.js.map +1 -0
- package/migrations/5.39.6/001/ddb-es/utils.d.ts +28 -0
- package/migrations/5.39.6/001/ddb-es/utils.js +62 -0
- package/migrations/5.39.6/001/ddb-es/utils.js.map +1 -0
- package/migrations/5.39.6/001/ddb-es/worker.d.ts +1 -0
- package/migrations/5.39.6/001/ddb-es/worker.js +352 -0
- package/migrations/5.39.6/001/ddb-es/worker.js.map +1 -0
- package/package.json +45 -0
- package/utils/createEntity.d.ts +89 -0
- package/utils/createEntity.js +67 -0
- package/utils/createEntity.js.map +1 -0
- package/utils/createLocaleEntity.d.ts +42 -0
- package/utils/createLocaleEntity.js +32 -0
- package/utils/createLocaleEntity.js.map +1 -0
- package/utils/createTenantEntity.d.ts +48 -0
- package/utils/createTenantEntity.js +13 -0
- package/utils/createTenantEntity.js.map +1 -0
- package/utils/dynamoDb.d.ts +3 -0
- package/utils/dynamoDb.js +62 -0
- package/utils/dynamoDb.js.map +1 -0
- package/utils/elasticsearch/disableEsIndexing.d.ts +9 -0
- package/utils/elasticsearch/disableEsIndexing.js +34 -0
- package/utils/elasticsearch/disableEsIndexing.js.map +1 -0
- package/utils/elasticsearch/esCreateIndex.d.ts +9 -0
- package/utils/elasticsearch/esCreateIndex.js +62 -0
- package/utils/elasticsearch/esCreateIndex.js.map +1 -0
- package/utils/elasticsearch/esFindOne.d.ts +8 -0
- package/utils/elasticsearch/esFindOne.js +27 -0
- package/utils/elasticsearch/esFindOne.js.map +1 -0
- package/utils/elasticsearch/esGetIndexExist.d.ts +9 -0
- package/utils/elasticsearch/esGetIndexExist.js +37 -0
- package/utils/elasticsearch/esGetIndexExist.js.map +1 -0
- package/utils/elasticsearch/esGetIndexName.d.ts +7 -0
- package/utils/elasticsearch/esGetIndexName.js +40 -0
- package/utils/elasticsearch/esGetIndexName.js.map +1 -0
- package/utils/elasticsearch/esGetIndexSettings.d.ts +7 -0
- package/utils/elasticsearch/esGetIndexSettings.js +32 -0
- package/utils/elasticsearch/esGetIndexSettings.js.map +1 -0
- package/utils/elasticsearch/esListIndexes.d.ts +6 -0
- package/utils/elasticsearch/esListIndexes.js +23 -0
- package/utils/elasticsearch/esListIndexes.js.map +1 -0
- package/utils/elasticsearch/esPutIndexSettings.d.ts +7 -0
- package/utils/elasticsearch/esPutIndexSettings.js +30 -0
- package/utils/elasticsearch/esPutIndexSettings.js.map +1 -0
- package/utils/elasticsearch/esQueryAll.d.ts +8 -0
- package/utils/elasticsearch/esQueryAll.js +26 -0
- package/utils/elasticsearch/esQueryAll.js.map +1 -0
- package/utils/elasticsearch/esQueryAllWithCallback.d.ts +10 -0
- package/utils/elasticsearch/esQueryAllWithCallback.js +45 -0
- package/utils/elasticsearch/esQueryAllWithCallback.js.map +1 -0
- package/utils/elasticsearch/fetchOriginalEsSettings.d.ts +13 -0
- package/utils/elasticsearch/fetchOriginalEsSettings.js +36 -0
- package/utils/elasticsearch/fetchOriginalEsSettings.js.map +1 -0
- package/utils/elasticsearch/index.d.ts +12 -0
- package/utils/elasticsearch/index.js +139 -0
- package/utils/elasticsearch/index.js.map +1 -0
- package/utils/elasticsearch/plugins/base.d.ts +3 -0
- package/utils/elasticsearch/plugins/base.js +13 -0
- package/utils/elasticsearch/plugins/base.js.map +1 -0
- package/utils/elasticsearch/plugins/index.d.ts +6 -0
- package/utils/elasticsearch/plugins/index.js +14 -0
- package/utils/elasticsearch/plugins/index.js.map +1 -0
- package/utils/elasticsearch/plugins/japanese.d.ts +4 -0
- package/utils/elasticsearch/plugins/japanese.js +14 -0
- package/utils/elasticsearch/plugins/japanese.js.map +1 -0
- package/utils/elasticsearch/restoreOriginalEsSettings.d.ts +15 -0
- package/utils/elasticsearch/restoreOriginalEsSettings.js +44 -0
- package/utils/elasticsearch/restoreOriginalEsSettings.js.map +1 -0
- package/utils/forEachTenantLocale.d.ts +13 -0
- package/utils/forEachTenantLocale.js +55 -0
- package/utils/forEachTenantLocale.js.map +1 -0
- package/utils/index.d.ts +6 -0
- package/utils/index.js +73 -0
- package/utils/index.js.map +1 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MultiStepForms_5_38_0_002 = void 0;
|
|
7
|
+
var _dataMigration = require("@webiny/data-migration");
|
|
8
|
+
var _utils = require("../../../../utils");
|
|
9
|
+
var _ioc = require("@webiny/ioc");
|
|
10
|
+
var _utils2 = require("@webiny/utils");
|
|
11
|
+
var _createFormSubmissionEntity = require("../entities/createFormSubmissionEntity");
|
|
12
|
+
var _createFormSubmissionDdbEsEntity = require("../entities/createFormSubmissionDdbEsEntity");
|
|
13
|
+
class MultiStepForms_5_38_0_002 {
|
|
14
|
+
constructor(table, esTable, elasticsearchClient) {
|
|
15
|
+
this.table = table;
|
|
16
|
+
this.esTable = esTable;
|
|
17
|
+
this.formSubmissionEntity = (0, _createFormSubmissionEntity.createFormSubmissionEntity)(table);
|
|
18
|
+
this.formSubmissionDdbEsEntity = (0, _createFormSubmissionDdbEsEntity.createFormSubmissionDdbEsEntity)(esTable);
|
|
19
|
+
this.elasticsearchClient = elasticsearchClient;
|
|
20
|
+
}
|
|
21
|
+
getId() {
|
|
22
|
+
return "5.38.0-002";
|
|
23
|
+
}
|
|
24
|
+
getDescription() {
|
|
25
|
+
return "Convert forms to multi-step forms (form submissions).";
|
|
26
|
+
}
|
|
27
|
+
async shouldExecute({
|
|
28
|
+
logger
|
|
29
|
+
}) {
|
|
30
|
+
let shouldExecute = false;
|
|
31
|
+
await (0, _utils.forEachTenantLocale)({
|
|
32
|
+
table: this.table,
|
|
33
|
+
logger,
|
|
34
|
+
callback: async ({
|
|
35
|
+
tenantId,
|
|
36
|
+
localeCode
|
|
37
|
+
}) => {
|
|
38
|
+
const indexNameParams = {
|
|
39
|
+
tenant: tenantId,
|
|
40
|
+
locale: localeCode,
|
|
41
|
+
type: "form-builder",
|
|
42
|
+
isHeadlessCmsModel: false
|
|
43
|
+
};
|
|
44
|
+
const indexExists = await (0, _utils.esGetIndexExist)({
|
|
45
|
+
elasticsearchClient: this.elasticsearchClient,
|
|
46
|
+
...indexNameParams
|
|
47
|
+
});
|
|
48
|
+
if (!indexExists) {
|
|
49
|
+
logger.info(`No Elasticsearch index found for folders in tenant "${tenantId}" and locale "${localeCode}"; skipping.`);
|
|
50
|
+
|
|
51
|
+
// Continue with next locale.
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
const esRecords = await (0, _utils.esQueryAll)({
|
|
55
|
+
elasticsearchClient: this.elasticsearchClient,
|
|
56
|
+
index: (0, _utils.esGetIndexName)(indexNameParams),
|
|
57
|
+
body: {
|
|
58
|
+
query: {
|
|
59
|
+
bool: {
|
|
60
|
+
filter: [{
|
|
61
|
+
term: {
|
|
62
|
+
"__type.keyword": "fb.submission"
|
|
63
|
+
}
|
|
64
|
+
}],
|
|
65
|
+
must_not: {
|
|
66
|
+
exists: {
|
|
67
|
+
field: "form.steps"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
size: 1
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
if (esRecords.length) {
|
|
76
|
+
shouldExecute = true;
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return shouldExecute;
|
|
83
|
+
}
|
|
84
|
+
async execute({
|
|
85
|
+
logger,
|
|
86
|
+
...context
|
|
87
|
+
}) {
|
|
88
|
+
const migrationStatus = context.checkpoint || {};
|
|
89
|
+
if (migrationStatus.lastEvaluatedKey === true) {
|
|
90
|
+
logger.info(`Migration completed, no need to start again.`);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
let usingKey = "";
|
|
94
|
+
if (migrationStatus?.lastEvaluatedKey) {
|
|
95
|
+
usingKey = JSON.stringify(migrationStatus.lastEvaluatedKey);
|
|
96
|
+
}
|
|
97
|
+
logger.debug(`Scanning DynamoDB table... ${usingKey}`);
|
|
98
|
+
await (0, _utils.ddbScanWithCallback)({
|
|
99
|
+
entity: this.formSubmissionEntity,
|
|
100
|
+
options: {
|
|
101
|
+
filters: [{
|
|
102
|
+
attr: "TYPE",
|
|
103
|
+
eq: "fb.formSubmission"
|
|
104
|
+
}],
|
|
105
|
+
startKey: migrationStatus.lastEvaluatedKey || undefined,
|
|
106
|
+
limit: 500
|
|
107
|
+
}
|
|
108
|
+
}, async scanResults => {
|
|
109
|
+
logger.debug(`Processing ${scanResults.items.length} items...`);
|
|
110
|
+
const primaryTableRecordsToWrite = [];
|
|
111
|
+
const ddbEsTableRecordsToRead = [];
|
|
112
|
+
const ddbEsTableRecordsToWrite = [];
|
|
113
|
+
|
|
114
|
+
// First, let's prepare a list of records to write to the primary table.
|
|
115
|
+
for (const scanResult of scanResults.items) {
|
|
116
|
+
if (scanResult.form.steps) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// If no steps are defined, we need to create a single step.
|
|
121
|
+
scanResult.form.steps = [];
|
|
122
|
+
if (Array.isArray(scanResult.form.layout)) {
|
|
123
|
+
// If layout is an array, we need to create a single step with all the fields.
|
|
124
|
+
scanResult.form.steps = [{
|
|
125
|
+
title: "Step 1",
|
|
126
|
+
layout: scanResult.form.layout
|
|
127
|
+
}];
|
|
128
|
+
delete scanResult.form.layout;
|
|
129
|
+
}
|
|
130
|
+
primaryTableRecordsToWrite.push(this.formSubmissionEntity.putBatch(scanResult));
|
|
131
|
+
ddbEsTableRecordsToRead.push(this.formSubmissionDdbEsEntity.getBatch(scanResult));
|
|
132
|
+
const index = (0, _utils.esGetIndexName)({
|
|
133
|
+
tenant: scanResult.tenant,
|
|
134
|
+
locale: scanResult.locale,
|
|
135
|
+
type: "form-builder",
|
|
136
|
+
isHeadlessCmsModel: false
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
// Check for the elasticsearch index settings
|
|
140
|
+
if (!migrationStatus.indexes || migrationStatus.indexes[index] === undefined) {
|
|
141
|
+
// We need to fetch the index settings first
|
|
142
|
+
const settings = await (0, _utils.fetchOriginalElasticsearchSettings)({
|
|
143
|
+
index,
|
|
144
|
+
logger,
|
|
145
|
+
elasticsearchClient: this.elasticsearchClient
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
// ... add it to the checkpoint...
|
|
149
|
+
migrationStatus.indexes = {
|
|
150
|
+
...migrationStatus.indexes,
|
|
151
|
+
[index]: settings
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// and then set not to index
|
|
155
|
+
await (0, _utils.disableElasticsearchIndexing)({
|
|
156
|
+
elasticsearchClient: this.elasticsearchClient,
|
|
157
|
+
index,
|
|
158
|
+
logger
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Second, let's prepare a list of records to write to the DDB-ES table.
|
|
164
|
+
const ddbEsTableRecords = await (0, _utils.batchReadAll)({
|
|
165
|
+
table: this.esTable,
|
|
166
|
+
items: ddbEsTableRecordsToRead
|
|
167
|
+
});
|
|
168
|
+
for (const ddbEsTableRecord of ddbEsTableRecords) {
|
|
169
|
+
if (!ddbEsTableRecord.data || !ddbEsTableRecord.data.form) {
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
if (ddbEsTableRecord.data.form.steps) {
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// If no steps are defined, we need to create a single step.
|
|
177
|
+
ddbEsTableRecord.data.form.steps = [];
|
|
178
|
+
if (Array.isArray(ddbEsTableRecord.data.form.layout)) {
|
|
179
|
+
// If layout is an array, we need to create a single step with all the fields.
|
|
180
|
+
ddbEsTableRecord.data.form.steps = [{
|
|
181
|
+
title: "Step 1",
|
|
182
|
+
layout: ddbEsTableRecord.data.form.layout
|
|
183
|
+
}];
|
|
184
|
+
delete ddbEsTableRecord.data.form.layout;
|
|
185
|
+
}
|
|
186
|
+
ddbEsTableRecordsToWrite.push(this.formSubmissionDdbEsEntity.putBatch(ddbEsTableRecord));
|
|
187
|
+
}
|
|
188
|
+
{
|
|
189
|
+
// 1. Update DynamoDB records (primary table).
|
|
190
|
+
const execute = () => {
|
|
191
|
+
return (0, _utils.batchWriteAll)({
|
|
192
|
+
table: this.formSubmissionEntity.table,
|
|
193
|
+
items: primaryTableRecordsToWrite
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
logger.trace("Storing the DynamoDB records (primary table)...");
|
|
197
|
+
await (0, _utils2.executeWithRetry)(execute, {
|
|
198
|
+
onFailedAttempt: error => {
|
|
199
|
+
logger.error(`"batchWriteAll" attempt #${error.attemptNumber} failed.`);
|
|
200
|
+
logger.error(error.message);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
logger.trace("...stored.");
|
|
204
|
+
}
|
|
205
|
+
{
|
|
206
|
+
// 2. Update DynamoDB records (DDB-ES table).
|
|
207
|
+
const execute = () => {
|
|
208
|
+
return (0, _utils.batchWriteAll)({
|
|
209
|
+
table: this.formSubmissionDdbEsEntity.table,
|
|
210
|
+
items: ddbEsTableRecordsToWrite
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
logger.trace("Storing the DynamoDB records (DynamoDB-ES table)...");
|
|
214
|
+
await (0, _utils2.executeWithRetry)(execute, {
|
|
215
|
+
onFailedAttempt: error => {
|
|
216
|
+
logger.error(`"batchWriteAll" attempt #${error.attemptNumber} failed.`);
|
|
217
|
+
logger.error(error.message);
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
logger.trace("...stored.");
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Update checkpoint after every batch
|
|
224
|
+
migrationStatus.lastEvaluatedKey = scanResults.lastEvaluatedKey?.PK ? scanResults.lastEvaluatedKey : true;
|
|
225
|
+
|
|
226
|
+
// Check if we should store checkpoint and exit.
|
|
227
|
+
if (context.runningOutOfTime()) {
|
|
228
|
+
await context.createCheckpointAndExit(migrationStatus);
|
|
229
|
+
} else {
|
|
230
|
+
await context.createCheckpoint(migrationStatus);
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* This is the end of the migration.
|
|
236
|
+
*/
|
|
237
|
+
await (0, _utils.restoreOriginalElasticsearchSettings)({
|
|
238
|
+
indexSettings: migrationStatus.indexes,
|
|
239
|
+
logger,
|
|
240
|
+
elasticsearchClient: this.elasticsearchClient
|
|
241
|
+
});
|
|
242
|
+
migrationStatus.lastEvaluatedKey = true;
|
|
243
|
+
migrationStatus.indexes = {};
|
|
244
|
+
context.createCheckpoint(migrationStatus);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
exports.MultiStepForms_5_38_0_002 = MultiStepForms_5_38_0_002;
|
|
248
|
+
(0, _ioc.makeInjectable)(MultiStepForms_5_38_0_002, [(0, _ioc.inject)(_dataMigration.PrimaryDynamoTableSymbol), (0, _ioc.inject)(_dataMigration.ElasticsearchDynamoTableSymbol), (0, _ioc.inject)(_dataMigration.ElasticsearchClientSymbol)]);
|
|
249
|
+
|
|
250
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_dataMigration","require","_utils","_ioc","_utils2","_createFormSubmissionEntity","_createFormSubmissionDdbEsEntity","MultiStepForms_5_38_0_002","constructor","table","esTable","elasticsearchClient","formSubmissionEntity","createFormSubmissionEntity","formSubmissionDdbEsEntity","createFormSubmissionDdbEsEntity","getId","getDescription","shouldExecute","logger","forEachTenantLocale","callback","tenantId","localeCode","indexNameParams","tenant","locale","type","isHeadlessCmsModel","indexExists","esGetIndexExist","info","esRecords","esQueryAll","index","esGetIndexName","body","query","bool","filter","term","must_not","exists","field","size","length","execute","context","migrationStatus","checkpoint","lastEvaluatedKey","usingKey","JSON","stringify","debug","ddbScanWithCallback","entity","options","filters","attr","eq","startKey","undefined","limit","scanResults","items","primaryTableRecordsToWrite","ddbEsTableRecordsToRead","ddbEsTableRecordsToWrite","scanResult","form","steps","Array","isArray","layout","title","push","putBatch","getBatch","indexes","settings","fetchOriginalElasticsearchSettings","disableElasticsearchIndexing","ddbEsTableRecords","batchReadAll","ddbEsTableRecord","data","batchWriteAll","trace","executeWithRetry","onFailedAttempt","error","attemptNumber","message","PK","runningOutOfTime","createCheckpointAndExit","createCheckpoint","restoreOriginalElasticsearchSettings","indexSettings","exports","makeInjectable","inject","PrimaryDynamoTableSymbol","ElasticsearchDynamoTableSymbol","ElasticsearchClientSymbol"],"sources":["index.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport {\n DataMigration,\n DataMigrationContext,\n ElasticsearchClientSymbol,\n ElasticsearchDynamoTableSymbol,\n PrimaryDynamoTableSymbol\n} from \"@webiny/data-migration\";\nimport {\n batchReadAll,\n BatchReadItem,\n batchWriteAll,\n BatchWriteItem,\n ddbScanWithCallback,\n disableElasticsearchIndexing,\n esGetIndexExist,\n esGetIndexName,\n esQueryAll,\n fetchOriginalElasticsearchSettings,\n forEachTenantLocale,\n restoreOriginalElasticsearchSettings\n} from \"~/utils\";\nimport { FbForm, FbFormSubmission } from \"../types\";\nimport { inject, makeInjectable } from \"@webiny/ioc\";\nimport { Client } from \"@elastic/elasticsearch\";\nimport { executeWithRetry } from \"@webiny/utils\";\nimport { createFormSubmissionEntity } from \"~/migrations/5.38.0/002/entities/createFormSubmissionEntity\";\nimport { createFormSubmissionDdbEsEntity } from \"~/migrations/5.38.0/002/entities/createFormSubmissionDdbEsEntity\";\n\ninterface LastEvaluatedKey {\n PK: string;\n SK: string;\n GSI1_PK: string;\n GSI1_SK: string;\n}\n\ninterface IndexSettings {\n number_of_replicas: number;\n refresh_interval: `${number}s`;\n}\n\ninterface FormSubmissionsDataMigrationCheckpoint {\n lastEvaluatedKey?: LastEvaluatedKey | boolean;\n indexes: {\n [index: string]: IndexSettings | null;\n };\n}\n\nexport class MultiStepForms_5_38_0_002 implements DataMigration {\n private readonly table: Table<string, string, string>;\n private readonly esTable: Table<string, string, string>;\n private readonly formSubmissionEntity: ReturnType<typeof createFormSubmissionEntity>;\n private readonly formSubmissionDdbEsEntity: ReturnType<typeof createFormSubmissionDdbEsEntity>;\n private readonly elasticsearchClient: Client;\n\n constructor(\n table: Table<string, string, string>,\n esTable: Table<string, string, string>,\n elasticsearchClient: Client\n ) {\n this.table = table;\n this.esTable = esTable;\n this.formSubmissionEntity = createFormSubmissionEntity(table);\n this.formSubmissionDdbEsEntity = createFormSubmissionDdbEsEntity(esTable);\n this.elasticsearchClient = elasticsearchClient;\n }\n\n getId() {\n return \"5.38.0-002\";\n }\n\n getDescription() {\n return \"Convert forms to multi-step forms (form submissions).\";\n }\n\n async shouldExecute({ logger }: DataMigrationContext): Promise<boolean> {\n let shouldExecute = false;\n\n await forEachTenantLocale({\n table: this.table,\n logger,\n callback: async ({ tenantId, localeCode }) => {\n const indexNameParams = {\n tenant: tenantId,\n locale: localeCode,\n type: \"form-builder\",\n isHeadlessCmsModel: false\n };\n\n const indexExists = await esGetIndexExist({\n elasticsearchClient: this.elasticsearchClient,\n ...indexNameParams\n });\n\n if (!indexExists) {\n logger.info(\n `No Elasticsearch index found for folders in tenant \"${tenantId}\" and locale \"${localeCode}\"; skipping.`\n );\n\n // Continue with next locale.\n return true;\n }\n\n const esRecords = await esQueryAll<FbForm>({\n elasticsearchClient: this.elasticsearchClient,\n index: esGetIndexName(indexNameParams),\n body: {\n query: {\n bool: {\n filter: [{ term: { \"__type.keyword\": \"fb.submission\" } }],\n must_not: {\n exists: {\n field: \"form.steps\"\n }\n }\n }\n },\n size: 1\n }\n });\n\n if (esRecords.length) {\n shouldExecute = true;\n return false;\n }\n\n return true;\n }\n });\n\n return shouldExecute;\n }\n\n async execute({\n logger,\n ...context\n }: DataMigrationContext<FormSubmissionsDataMigrationCheckpoint>): Promise<void> {\n const migrationStatus =\n context.checkpoint || ({} as FormSubmissionsDataMigrationCheckpoint);\n\n if (migrationStatus.lastEvaluatedKey === true) {\n logger.info(`Migration completed, no need to start again.`);\n return;\n }\n\n let usingKey = \"\";\n if (migrationStatus?.lastEvaluatedKey) {\n usingKey = JSON.stringify(migrationStatus.lastEvaluatedKey);\n }\n\n logger.debug(`Scanning DynamoDB table... ${usingKey}`);\n\n await ddbScanWithCallback<FbFormSubmission>(\n {\n entity: this.formSubmissionEntity,\n options: {\n filters: [\n {\n attr: \"TYPE\",\n eq: \"fb.formSubmission\"\n }\n ],\n startKey: migrationStatus.lastEvaluatedKey || undefined,\n limit: 500\n }\n },\n async scanResults => {\n logger.debug(`Processing ${scanResults.items.length} items...`);\n const primaryTableRecordsToWrite: BatchWriteItem[] = [];\n const ddbEsTableRecordsToRead: BatchReadItem[] = [];\n const ddbEsTableRecordsToWrite: BatchWriteItem[] = [];\n\n // First, let's prepare a list of records to write to the primary table.\n for (const scanResult of scanResults.items) {\n if (scanResult.form.steps) {\n continue;\n }\n\n // If no steps are defined, we need to create a single step.\n scanResult.form.steps = [];\n\n if (Array.isArray(scanResult.form.layout)) {\n // If layout is an array, we need to create a single step with all the fields.\n scanResult.form.steps = [\n { title: \"Step 1\", layout: scanResult.form.layout }\n ];\n delete scanResult.form.layout;\n }\n\n primaryTableRecordsToWrite.push(this.formSubmissionEntity.putBatch(scanResult));\n ddbEsTableRecordsToRead.push(\n this.formSubmissionDdbEsEntity.getBatch(scanResult)\n );\n\n const index = esGetIndexName({\n tenant: scanResult.tenant,\n locale: scanResult.locale,\n type: \"form-builder\",\n isHeadlessCmsModel: false\n });\n\n // Check for the elasticsearch index settings\n if (!migrationStatus.indexes || migrationStatus.indexes[index] === undefined) {\n // We need to fetch the index settings first\n const settings = await fetchOriginalElasticsearchSettings({\n index,\n logger,\n elasticsearchClient: this.elasticsearchClient\n });\n\n // ... add it to the checkpoint...\n migrationStatus.indexes = {\n ...migrationStatus.indexes,\n [index]: settings\n };\n\n // and then set not to index\n await disableElasticsearchIndexing({\n elasticsearchClient: this.elasticsearchClient,\n index,\n logger\n });\n }\n }\n\n // Second, let's prepare a list of records to write to the DDB-ES table.\n const ddbEsTableRecords = await batchReadAll({\n table: this.esTable,\n items: ddbEsTableRecordsToRead\n });\n\n for (const ddbEsTableRecord of ddbEsTableRecords) {\n if (!ddbEsTableRecord.data || !ddbEsTableRecord.data.form) {\n continue;\n }\n\n if (ddbEsTableRecord.data.form.steps) {\n continue;\n }\n\n // If no steps are defined, we need to create a single step.\n ddbEsTableRecord.data.form.steps = [];\n\n if (Array.isArray(ddbEsTableRecord.data.form.layout)) {\n // If layout is an array, we need to create a single step with all the fields.\n ddbEsTableRecord.data.form.steps = [\n { title: \"Step 1\", layout: ddbEsTableRecord.data.form.layout }\n ];\n delete ddbEsTableRecord.data.form.layout;\n }\n\n ddbEsTableRecordsToWrite.push(\n this.formSubmissionDdbEsEntity.putBatch(ddbEsTableRecord)\n );\n }\n\n {\n // 1. Update DynamoDB records (primary table).\n const execute = () => {\n return batchWriteAll({\n table: this.formSubmissionEntity.table,\n items: primaryTableRecordsToWrite\n });\n };\n\n logger.trace(\"Storing the DynamoDB records (primary table)...\");\n await executeWithRetry(execute, {\n onFailedAttempt: error => {\n logger.error(`\"batchWriteAll\" attempt #${error.attemptNumber} failed.`);\n logger.error(error.message);\n }\n });\n\n logger.trace(\"...stored.\");\n }\n\n {\n // 2. Update DynamoDB records (DDB-ES table).\n const execute = () => {\n return batchWriteAll({\n table: this.formSubmissionDdbEsEntity.table,\n items: ddbEsTableRecordsToWrite\n });\n };\n\n logger.trace(\"Storing the DynamoDB records (DynamoDB-ES table)...\");\n await executeWithRetry(execute, {\n onFailedAttempt: error => {\n logger.error(`\"batchWriteAll\" attempt #${error.attemptNumber} failed.`);\n logger.error(error.message);\n }\n });\n\n logger.trace(\"...stored.\");\n }\n\n // Update checkpoint after every batch\n migrationStatus.lastEvaluatedKey = scanResults.lastEvaluatedKey?.PK\n ? (scanResults.lastEvaluatedKey as unknown as LastEvaluatedKey)\n : true;\n\n // Check if we should store checkpoint and exit.\n if (context.runningOutOfTime()) {\n await context.createCheckpointAndExit(migrationStatus);\n } else {\n await context.createCheckpoint(migrationStatus);\n }\n }\n );\n\n /**\n * This is the end of the migration.\n */\n await restoreOriginalElasticsearchSettings({\n indexSettings: migrationStatus.indexes,\n logger,\n elasticsearchClient: this.elasticsearchClient\n });\n\n migrationStatus.lastEvaluatedKey = true;\n migrationStatus.indexes = {};\n context.createCheckpoint(migrationStatus);\n }\n}\n\nmakeInjectable(MultiStepForms_5_38_0_002, [\n inject(PrimaryDynamoTableSymbol),\n inject(ElasticsearchDynamoTableSymbol),\n inject(ElasticsearchClientSymbol)\n]);\n"],"mappings":";;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AAOA,IAAAC,MAAA,GAAAD,OAAA;AAeA,IAAAE,IAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,2BAAA,GAAAJ,OAAA;AACA,IAAAK,gCAAA,GAAAL,OAAA;AAqBO,MAAMM,yBAAyB,CAA0B;EAO5DC,WAAWA,CACPC,KAAoC,EACpCC,OAAsC,EACtCC,mBAA2B,EAC7B;IACE,IAAI,CAACF,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACE,oBAAoB,GAAG,IAAAC,sDAA0B,EAACJ,KAAK,CAAC;IAC7D,IAAI,CAACK,yBAAyB,GAAG,IAAAC,gEAA+B,EAACL,OAAO,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,GAAG,CAAC,CAAC;IAC5BhC,OAAO,CAACkD,gBAAgB,CAACjD,eAAe,CAAC;EAC7C;AACJ;AAACoD,OAAA,CAAA7F,yBAAA,GAAAA,yBAAA;AAED,IAAA8F,mBAAc,EAAC9F,yBAAyB,EAAE,CACtC,IAAA+F,WAAM,EAACC,uCAAwB,CAAC,EAChC,IAAAD,WAAM,EAACE,6CAA8B,CAAC,EACtC,IAAAF,WAAM,EAACG,wCAAyB,CAAC,CACpC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
export declare const createFormEntity: (table: Table<string, string, string>) => import("dynamodb-toolbox/dist/cjs/classes/Entity/Entity").default<string, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, Table<string, string, string>, true, true, boolean, string, string, string, boolean, {
|
|
3
|
+
PK: {
|
|
4
|
+
partitionKey: true;
|
|
5
|
+
};
|
|
6
|
+
SK: {
|
|
7
|
+
sortKey: true;
|
|
8
|
+
};
|
|
9
|
+
GSI1_PK: {
|
|
10
|
+
type: "string";
|
|
11
|
+
};
|
|
12
|
+
GSI1_SK: {
|
|
13
|
+
type: "string";
|
|
14
|
+
};
|
|
15
|
+
TYPE: {
|
|
16
|
+
type: "string";
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
PK: {
|
|
20
|
+
partitionKey: true;
|
|
21
|
+
};
|
|
22
|
+
SK: {
|
|
23
|
+
sortKey: true;
|
|
24
|
+
};
|
|
25
|
+
GSI1_PK: {
|
|
26
|
+
type: "string";
|
|
27
|
+
};
|
|
28
|
+
GSI1_SK: {
|
|
29
|
+
type: "string";
|
|
30
|
+
};
|
|
31
|
+
TYPE: {
|
|
32
|
+
type: "string";
|
|
33
|
+
};
|
|
34
|
+
}, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParsedAttributes<import("ts-toolbelt/out/Any/Key").Key>, any, {
|
|
35
|
+
[x: string]: any;
|
|
36
|
+
[x: number]: any;
|
|
37
|
+
[x: symbol]: any;
|
|
38
|
+
}, {
|
|
39
|
+
[x: string]: any;
|
|
40
|
+
[x: number]: any;
|
|
41
|
+
[x: symbol]: any;
|
|
42
|
+
}>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createFormEntity = void 0;
|
|
7
|
+
var _utils = require("../../../../utils");
|
|
8
|
+
const createFormEntity = table => {
|
|
9
|
+
return (0, _utils.createLegacyEntity)(table, "FormBuilderForm", {
|
|
10
|
+
PK: {
|
|
11
|
+
partitionKey: true
|
|
12
|
+
},
|
|
13
|
+
SK: {
|
|
14
|
+
sortKey: true
|
|
15
|
+
},
|
|
16
|
+
GSI1_PK: {
|
|
17
|
+
type: "string"
|
|
18
|
+
},
|
|
19
|
+
GSI1_SK: {
|
|
20
|
+
type: "string"
|
|
21
|
+
},
|
|
22
|
+
TYPE: {
|
|
23
|
+
type: "string"
|
|
24
|
+
},
|
|
25
|
+
id: {
|
|
26
|
+
type: "string"
|
|
27
|
+
},
|
|
28
|
+
formId: {
|
|
29
|
+
type: "string"
|
|
30
|
+
},
|
|
31
|
+
tenant: {
|
|
32
|
+
type: "string"
|
|
33
|
+
},
|
|
34
|
+
locale: {
|
|
35
|
+
type: "string"
|
|
36
|
+
},
|
|
37
|
+
createdBy: {
|
|
38
|
+
type: "map"
|
|
39
|
+
},
|
|
40
|
+
ownedBy: {
|
|
41
|
+
type: "map"
|
|
42
|
+
},
|
|
43
|
+
savedOn: {
|
|
44
|
+
type: "string"
|
|
45
|
+
},
|
|
46
|
+
createdOn: {
|
|
47
|
+
type: "string"
|
|
48
|
+
},
|
|
49
|
+
name: {
|
|
50
|
+
type: "string"
|
|
51
|
+
},
|
|
52
|
+
slug: {
|
|
53
|
+
type: "string"
|
|
54
|
+
},
|
|
55
|
+
version: {
|
|
56
|
+
type: "number"
|
|
57
|
+
},
|
|
58
|
+
locked: {
|
|
59
|
+
type: "boolean"
|
|
60
|
+
},
|
|
61
|
+
published: {
|
|
62
|
+
type: "boolean"
|
|
63
|
+
},
|
|
64
|
+
publishedOn: {
|
|
65
|
+
type: "string"
|
|
66
|
+
},
|
|
67
|
+
status: {
|
|
68
|
+
type: "string"
|
|
69
|
+
},
|
|
70
|
+
fields: {
|
|
71
|
+
type: "list"
|
|
72
|
+
},
|
|
73
|
+
steps: {
|
|
74
|
+
type: "list"
|
|
75
|
+
},
|
|
76
|
+
stats: {
|
|
77
|
+
type: "map"
|
|
78
|
+
},
|
|
79
|
+
settings: {
|
|
80
|
+
type: "map"
|
|
81
|
+
},
|
|
82
|
+
triggers: {
|
|
83
|
+
type: "map"
|
|
84
|
+
},
|
|
85
|
+
webinyVersion: {
|
|
86
|
+
type: "string"
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
exports.createFormEntity = createFormEntity;
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=createFormEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_utils","require","createFormEntity","table","createLegacyEntity","PK","partitionKey","SK","sortKey","GSI1_PK","type","GSI1_SK","TYPE","id","formId","tenant","locale","createdBy","ownedBy","savedOn","createdOn","name","slug","version","locked","published","publishedOn","status","fields","steps","stats","settings","triggers","webinyVersion","exports"],"sources":["createFormEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity } from \"~/utils\";\n\nexport const createFormEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"FormBuilderForm\", {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n GSI1_PK: {\n type: \"string\"\n },\n GSI1_SK: {\n type: \"string\"\n },\n TYPE: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n formId: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n ownedBy: {\n type: \"map\"\n },\n savedOn: {\n type: \"string\"\n },\n createdOn: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n slug: {\n type: \"string\"\n },\n version: {\n type: \"number\"\n },\n locked: {\n type: \"boolean\"\n },\n published: {\n type: \"boolean\"\n },\n publishedOn: {\n type: \"string\"\n },\n status: {\n type: \"string\"\n },\n fields: {\n type: \"list\"\n },\n steps: {\n type: \"list\"\n },\n stats: {\n type: \"map\"\n },\n settings: {\n type: \"map\"\n },\n triggers: {\n type: \"map\"\n },\n webinyVersion: {\n type: \"string\"\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,gBAAgB,GAAIC,KAAoC,IAAK;EACtE,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,iBAAiB,EAAE;IAChDE,EAAE,EAAE;MACAC,YAAY,EAAE;IAClB,CAAC;IACDC,EAAE,EAAE;MACAC,OAAO,EAAE;IACb,CAAC;IACDC,OAAO,EAAE;MACLC,IAAI,EAAE;IACV,CAAC;IACDC,OAAO,EAAE;MACLD,IAAI,EAAE;IACV,CAAC;IACDE,IAAI,EAAE;MACFF,IAAI,EAAE;IACV,CAAC;IACDG,EAAE,EAAE;MACAH,IAAI,EAAE;IACV,CAAC;IACDI,MAAM,EAAE;MACJJ,IAAI,EAAE;IACV,CAAC;IACDK,MAAM,EAAE;MACJL,IAAI,EAAE;IACV,CAAC;IACDM,MAAM,EAAE;MACJN,IAAI,EAAE;IACV,CAAC;IACDO,SAAS,EAAE;MACPP,IAAI,EAAE;IACV,CAAC;IACDQ,OAAO,EAAE;MACLR,IAAI,EAAE;IACV,CAAC;IACDS,OAAO,EAAE;MACLT,IAAI,EAAE;IACV,CAAC;IACDU,SAAS,EAAE;MACPV,IAAI,EAAE;IACV,CAAC;IACDW,IAAI,EAAE;MACFX,IAAI,EAAE;IACV,CAAC;IACDY,IAAI,EAAE;MACFZ,IAAI,EAAE;IACV,CAAC;IACDa,OAAO,EAAE;MACLb,IAAI,EAAE;IACV,CAAC;IACDc,MAAM,EAAE;MACJd,IAAI,EAAE;IACV,CAAC;IACDe,SAAS,EAAE;MACPf,IAAI,EAAE;IACV,CAAC;IACDgB,WAAW,EAAE;MACThB,IAAI,EAAE;IACV,CAAC;IACDiB,MAAM,EAAE;MACJjB,IAAI,EAAE;IACV,CAAC;IACDkB,MAAM,EAAE;MACJlB,IAAI,EAAE;IACV,CAAC;IACDmB,KAAK,EAAE;MACHnB,IAAI,EAAE;IACV,CAAC;IACDoB,KAAK,EAAE;MACHpB,IAAI,EAAE;IACV,CAAC;IACDqB,QAAQ,EAAE;MACNrB,IAAI,EAAE;IACV,CAAC;IACDsB,QAAQ,EAAE;MACNtB,IAAI,EAAE;IACV,CAAC;IACDuB,aAAa,EAAE;MACXvB,IAAI,EAAE;IACV;EACJ,CAAC,CAAC;AACN,CAAC;AAACwB,OAAA,CAAAhC,gBAAA,GAAAA,gBAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
export declare const createFormSubmissionDdbEsEntity: (table: Table<string, string, string>) => import("dynamodb-toolbox/dist/cjs/classes/Entity/Entity").default<string, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, Table<string, string, string>, true, true, boolean, string, string, string, boolean, {
|
|
3
|
+
PK: {
|
|
4
|
+
partitionKey: true;
|
|
5
|
+
};
|
|
6
|
+
SK: {
|
|
7
|
+
sortKey: true;
|
|
8
|
+
};
|
|
9
|
+
GSI1_PK: {
|
|
10
|
+
type: "string";
|
|
11
|
+
};
|
|
12
|
+
GSI1_SK: {
|
|
13
|
+
type: "string";
|
|
14
|
+
};
|
|
15
|
+
TYPE: {
|
|
16
|
+
type: "string";
|
|
17
|
+
};
|
|
18
|
+
data: {
|
|
19
|
+
type: "map";
|
|
20
|
+
};
|
|
21
|
+
}, {
|
|
22
|
+
PK: {
|
|
23
|
+
partitionKey: true;
|
|
24
|
+
};
|
|
25
|
+
SK: {
|
|
26
|
+
sortKey: true;
|
|
27
|
+
};
|
|
28
|
+
GSI1_PK: {
|
|
29
|
+
type: "string";
|
|
30
|
+
};
|
|
31
|
+
GSI1_SK: {
|
|
32
|
+
type: "string";
|
|
33
|
+
};
|
|
34
|
+
TYPE: {
|
|
35
|
+
type: "string";
|
|
36
|
+
};
|
|
37
|
+
data: {
|
|
38
|
+
type: "map";
|
|
39
|
+
};
|
|
40
|
+
}, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParsedAttributes<import("ts-toolbelt/out/Any/Key").Key>, any, {
|
|
41
|
+
[x: string]: any;
|
|
42
|
+
[x: number]: any;
|
|
43
|
+
[x: symbol]: any;
|
|
44
|
+
}, {
|
|
45
|
+
[x: string]: any;
|
|
46
|
+
[x: number]: any;
|
|
47
|
+
[x: symbol]: any;
|
|
48
|
+
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createFormSubmissionDdbEsEntity = void 0;
|
|
7
|
+
var _utils = require("../../../../utils");
|
|
8
|
+
const ddbEsAttributes = {
|
|
9
|
+
PK: {
|
|
10
|
+
type: "string",
|
|
11
|
+
partitionKey: true
|
|
12
|
+
},
|
|
13
|
+
SK: {
|
|
14
|
+
type: "string",
|
|
15
|
+
sortKey: true
|
|
16
|
+
},
|
|
17
|
+
index: {
|
|
18
|
+
type: "string"
|
|
19
|
+
},
|
|
20
|
+
data: {
|
|
21
|
+
type: "map"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const createFormSubmissionDdbEsEntity = table => {
|
|
25
|
+
return (0, _utils.createStandardEntity)(table, "FormBuilderSubmissionEs", ddbEsAttributes);
|
|
26
|
+
};
|
|
27
|
+
exports.createFormSubmissionDdbEsEntity = createFormSubmissionDdbEsEntity;
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=createFormSubmissionDdbEsEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_utils","require","ddbEsAttributes","PK","type","partitionKey","SK","sortKey","index","data","createFormSubmissionDdbEsEntity","table","createStandardEntity","exports"],"sources":["createFormSubmissionDdbEsEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createStandardEntity } from \"~/utils\";\n\nconst ddbEsAttributes: Parameters<typeof createStandardEntity>[2] = {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n index: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n }\n};\n\nexport const createFormSubmissionDdbEsEntity = (table: Table<string, string, string>) => {\n return createStandardEntity(table, \"FormBuilderSubmissionEs\", ddbEsAttributes);\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA,MAAMC,eAA2D,GAAG;EAChEC,EAAE,EAAE;IACAC,IAAI,EAAE,QAAQ;IACdC,YAAY,EAAE;EAClB,CAAC;EACDC,EAAE,EAAE;IACAF,IAAI,EAAE,QAAQ;IACdG,OAAO,EAAE;EACb,CAAC;EACDC,KAAK,EAAE;IACHJ,IAAI,EAAE;EACV,CAAC;EACDK,IAAI,EAAE;IACFL,IAAI,EAAE;EACV;AACJ,CAAC;AAEM,MAAMM,+BAA+B,GAAIC,KAAoC,IAAK;EACrF,OAAO,IAAAC,2BAAoB,EAACD,KAAK,EAAE,yBAAyB,EAAET,eAAe,CAAC;AAClF,CAAC;AAACW,OAAA,CAAAH,+BAAA,GAAAA,+BAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
+
export declare const createFormSubmissionEntity: (table: Table<string, string, string>) => import("dynamodb-toolbox/dist/cjs/classes/Entity/Entity").default<string, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, import("dynamodb-toolbox/dist/cjs/classes/Entity").Overlay, Table<string, string, string>, true, true, boolean, string, string, string, boolean, {
|
|
3
|
+
PK: {
|
|
4
|
+
partitionKey: true;
|
|
5
|
+
};
|
|
6
|
+
SK: {
|
|
7
|
+
sortKey: true;
|
|
8
|
+
};
|
|
9
|
+
GSI1_PK: {
|
|
10
|
+
type: "string";
|
|
11
|
+
};
|
|
12
|
+
GSI1_SK: {
|
|
13
|
+
type: "string";
|
|
14
|
+
};
|
|
15
|
+
TYPE: {
|
|
16
|
+
type: "string";
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
PK: {
|
|
20
|
+
partitionKey: true;
|
|
21
|
+
};
|
|
22
|
+
SK: {
|
|
23
|
+
sortKey: true;
|
|
24
|
+
};
|
|
25
|
+
GSI1_PK: {
|
|
26
|
+
type: "string";
|
|
27
|
+
};
|
|
28
|
+
GSI1_SK: {
|
|
29
|
+
type: "string";
|
|
30
|
+
};
|
|
31
|
+
TYPE: {
|
|
32
|
+
type: "string";
|
|
33
|
+
};
|
|
34
|
+
}, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParsedAttributes<import("ts-toolbelt/out/Any/Key").Key>, any, {
|
|
35
|
+
[x: string]: any;
|
|
36
|
+
[x: number]: any;
|
|
37
|
+
[x: symbol]: any;
|
|
38
|
+
}, {
|
|
39
|
+
[x: string]: any;
|
|
40
|
+
[x: number]: any;
|
|
41
|
+
[x: symbol]: any;
|
|
42
|
+
}>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createFormSubmissionEntity = void 0;
|
|
7
|
+
var _utils = require("../../../../utils");
|
|
8
|
+
const createFormSubmissionEntity = table => {
|
|
9
|
+
return (0, _utils.createLegacyEntity)(table, "FormBuilderForm", {
|
|
10
|
+
PK: {
|
|
11
|
+
partitionKey: true
|
|
12
|
+
},
|
|
13
|
+
SK: {
|
|
14
|
+
sortKey: true
|
|
15
|
+
},
|
|
16
|
+
id: {
|
|
17
|
+
type: "string"
|
|
18
|
+
},
|
|
19
|
+
TYPE: {
|
|
20
|
+
type: "string"
|
|
21
|
+
},
|
|
22
|
+
data: {
|
|
23
|
+
type: "map"
|
|
24
|
+
},
|
|
25
|
+
meta: {
|
|
26
|
+
type: "map"
|
|
27
|
+
},
|
|
28
|
+
form: {
|
|
29
|
+
type: "map"
|
|
30
|
+
},
|
|
31
|
+
logs: {
|
|
32
|
+
type: "list"
|
|
33
|
+
},
|
|
34
|
+
createdOn: {
|
|
35
|
+
type: "string"
|
|
36
|
+
},
|
|
37
|
+
savedOn: {
|
|
38
|
+
type: "string"
|
|
39
|
+
},
|
|
40
|
+
ownedBy: {
|
|
41
|
+
type: "map"
|
|
42
|
+
},
|
|
43
|
+
tenant: {
|
|
44
|
+
type: "string"
|
|
45
|
+
},
|
|
46
|
+
locale: {
|
|
47
|
+
type: "string"
|
|
48
|
+
},
|
|
49
|
+
webinyVersion: {
|
|
50
|
+
type: "string"
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
exports.createFormSubmissionEntity = createFormSubmissionEntity;
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=createFormSubmissionEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_utils","require","createFormSubmissionEntity","table","createLegacyEntity","PK","partitionKey","SK","sortKey","id","type","TYPE","data","meta","form","logs","createdOn","savedOn","ownedBy","tenant","locale","webinyVersion","exports"],"sources":["createFormSubmissionEntity.ts"],"sourcesContent":["import { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { createLegacyEntity } from \"~/utils\";\n\nexport const createFormSubmissionEntity = (table: Table<string, string, string>) => {\n return createLegacyEntity(table, \"FormBuilderForm\", {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n id: {\n type: \"string\"\n },\n TYPE: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n form: {\n type: \"map\"\n },\n logs: {\n type: \"list\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n ownedBy: {\n type: \"map\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,0BAA0B,GAAIC,KAAoC,IAAK;EAChF,OAAO,IAAAC,yBAAkB,EAACD,KAAK,EAAE,iBAAiB,EAAE;IAChDE,EAAE,EAAE;MACAC,YAAY,EAAE;IAClB,CAAC;IACDC,EAAE,EAAE;MACAC,OAAO,EAAE;IACb,CAAC;IACDC,EAAE,EAAE;MACAC,IAAI,EAAE;IACV,CAAC;IACDC,IAAI,EAAE;MACFD,IAAI,EAAE;IACV,CAAC;IACDE,IAAI,EAAE;MACFF,IAAI,EAAE;IACV,CAAC;IACDG,IAAI,EAAE;MACFH,IAAI,EAAE;IACV,CAAC;IACDI,IAAI,EAAE;MACFJ,IAAI,EAAE;IACV,CAAC;IACDK,IAAI,EAAE;MACFL,IAAI,EAAE;IACV,CAAC;IACDM,SAAS,EAAE;MACPN,IAAI,EAAE;IACV,CAAC;IACDO,OAAO,EAAE;MACLP,IAAI,EAAE;IACV,CAAC;IACDQ,OAAO,EAAE;MACLR,IAAI,EAAE;IACV,CAAC;IACDS,MAAM,EAAE;MACJT,IAAI,EAAE;IACV,CAAC;IACDU,MAAM,EAAE;MACJV,IAAI,EAAE;IACV,CAAC;IACDW,aAAa,EAAE;MACXX,IAAI,EAAE;IACV;EACJ,CAAC,CAAC;AACN,CAAC;AAACY,OAAA,CAAApB,0BAAA,GAAAA,0BAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare type FbFormLayout = Array<Array<string>>;
|
|
2
|
+
export interface FbForm {
|
|
3
|
+
id: string;
|
|
4
|
+
formId: string;
|
|
5
|
+
steps?: Array<{
|
|
6
|
+
title: string;
|
|
7
|
+
layout: FbFormLayout;
|
|
8
|
+
}>;
|
|
9
|
+
layout?: FbFormLayout;
|
|
10
|
+
TYPE?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface FbFormSubmission {
|
|
13
|
+
tenant: string;
|
|
14
|
+
locale: string;
|
|
15
|
+
id: string;
|
|
16
|
+
form: {
|
|
17
|
+
steps?: Array<{
|
|
18
|
+
title: string;
|
|
19
|
+
layout: FbFormLayout;
|
|
20
|
+
}>;
|
|
21
|
+
layout?: FbFormLayout;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type FbFormLayout = Array<Array<string>>;\n\nexport interface FbForm {\n id: string;\n formId: string;\n steps?: Array<{ title: string; layout: FbFormLayout }>;\n layout?: FbFormLayout;\n TYPE?: string;\n}\n\nexport interface FbFormSubmission {\n tenant: string;\n locale: string;\n id: string;\n form: {\n steps?: Array<{ title: string; layout: FbFormLayout }>;\n layout?: FbFormLayout;\n };\n}\n"],"mappings":""}
|