@jrmc/adonis-attachment 6.0.0-alpha.1 → 6.0.0-alpha.3
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/build/commands/commands.json +1 -1
- package/build/commands/make/attachment_v5_migration.d.ts.map +1 -1
- package/build/commands/make/attachment_v5_migration.js +6 -3
- package/build/commands/make/attachment_v5_migration.js.map +1 -1
- package/build/commands/make/attachments_table.d.ts.map +1 -1
- package/build/commands/make/attachments_table.js +8 -2
- package/build/commands/make/attachments_table.js.map +1 -1
- package/build/commands/make/converter.d.ts +17 -0
- package/build/commands/make/converter.d.ts.map +1 -0
- package/build/commands/make/converter.js +27 -0
- package/build/commands/make/converter.js.map +1 -0
- package/build/index.d.ts +12 -6
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3 -5
- package/build/index.js.map +1 -1
- package/build/providers/attachment_provider.d.ts.map +1 -1
- package/build/providers/attachment_provider.js +36 -1
- package/build/providers/attachment_provider.js.map +1 -1
- package/build/services/converters.d.ts +10 -0
- package/build/services/converters.d.ts.map +1 -0
- package/build/services/converters.js +17 -0
- package/build/services/converters.js.map +1 -0
- package/build/src/adapters/adonis_drive_storage.d.ts.map +1 -1
- package/build/src/adapters/adonis_drive_storage.js +4 -1
- package/build/src/adapters/adonis_drive_storage.js.map +1 -1
- package/build/src/adapters/local_file_storage.d.ts.map +1 -1
- package/build/src/adapters/local_file_storage.js +9 -2
- package/build/src/adapters/local_file_storage.js.map +1 -1
- package/build/src/converters/autodetect_converter.d.ts +24 -0
- package/build/src/converters/autodetect_converter.d.ts.map +1 -0
- package/build/src/converters/autodetect_converter.js +113 -0
- package/build/src/converters/autodetect_converter.js.map +1 -0
- package/build/src/converters/configured_variant_converter_registry.d.ts +36 -0
- package/build/src/converters/configured_variant_converter_registry.d.ts.map +1 -0
- package/build/src/converters/configured_variant_converter_registry.js +81 -0
- package/build/src/converters/configured_variant_converter_registry.js.map +1 -0
- package/build/src/converters/converter.d.ts +148 -0
- package/build/src/converters/converter.d.ts.map +1 -0
- package/build/src/converters/converter.js +24 -0
- package/build/src/converters/converter.js.map +1 -0
- package/build/src/core/attachment.d.ts +7 -3
- package/build/src/core/attachment.d.ts.map +1 -1
- package/build/src/core/attachment.js +29 -4
- package/build/src/core/attachment.js.map +1 -1
- package/build/src/core/attachment_job_processor.d.ts +17 -1
- package/build/src/core/attachment_job_processor.d.ts.map +1 -1
- package/build/src/core/attachment_job_processor.js +81 -8
- package/build/src/core/attachment_job_processor.js.map +1 -1
- package/build/src/core/attachment_metadata_persister.d.ts +13 -0
- package/build/src/core/attachment_metadata_persister.d.ts.map +1 -0
- package/build/{tests/create_legacy_attachment_migration_script.spec.d.ts → src/core/attachment_metadata_persister.js} +1 -1
- package/build/src/core/attachment_metadata_persister.js.map +1 -0
- package/build/src/core/attachment_options.d.ts +3 -2
- package/build/src/core/attachment_options.d.ts.map +1 -1
- package/build/src/core/attachment_options.js.map +1 -1
- package/build/src/core/attachment_service.d.ts +24 -1
- package/build/src/core/attachment_service.d.ts.map +1 -1
- package/build/src/core/attachment_service.js +95 -4
- package/build/src/core/attachment_service.js.map +1 -1
- package/build/src/core/index.d.ts +9 -2
- package/build/src/core/index.d.ts.map +1 -1
- package/build/src/core/index.js +8 -2
- package/build/src/core/index.js.map +1 -1
- package/build/src/core/queue.d.ts +11 -1
- package/build/src/core/queue.d.ts.map +1 -1
- package/build/src/define_config.d.ts +40 -3
- package/build/src/define_config.d.ts.map +1 -1
- package/build/src/define_config.js +43 -1
- package/build/src/define_config.js.map +1 -1
- package/build/src/errors.d.ts +57 -0
- package/build/src/errors.d.ts.map +1 -0
- package/build/src/errors.js +96 -0
- package/build/src/errors.js.map +1 -0
- package/build/src/events/adonis_attachment_event_emitter.d.ts +17 -0
- package/build/src/events/adonis_attachment_event_emitter.d.ts.map +1 -0
- package/build/src/events/adonis_attachment_event_emitter.js +17 -0
- package/build/src/events/adonis_attachment_event_emitter.js.map +1 -0
- package/build/src/events/attachment_events.d.ts +43 -0
- package/build/src/events/attachment_events.d.ts.map +1 -0
- package/build/src/events/attachment_events.js +32 -0
- package/build/src/events/attachment_events.js.map +1 -0
- package/build/src/integrations/lucid/{attachment_column.d.ts → column/attachment_column.d.ts} +2 -2
- package/build/src/integrations/lucid/column/attachment_column.d.ts.map +1 -0
- package/build/src/integrations/lucid/{attachment_column.js → column/attachment_column.js} +2 -2
- package/build/src/integrations/lucid/column/attachment_column.js.map +1 -0
- package/build/src/integrations/lucid/index.d.ts +17 -13
- package/build/src/integrations/lucid/index.d.ts.map +1 -1
- package/build/src/integrations/lucid/index.js +17 -13
- package/build/src/integrations/lucid/index.js.map +1 -1
- package/build/src/integrations/lucid/migrations/legacy/legacy_attachment_migration_stub.d.ts +20 -0
- package/build/src/integrations/lucid/migrations/legacy/legacy_attachment_migration_stub.d.ts.map +1 -0
- package/build/src/integrations/lucid/migrations/legacy/legacy_attachment_migration_stub.js +18 -0
- package/build/src/integrations/lucid/migrations/legacy/legacy_attachment_migration_stub.js.map +1 -0
- package/build/src/integrations/lucid/{migrate_legacy_attachment.d.ts → migrations/legacy/migrate_legacy_attachment.d.ts} +22 -10
- package/build/src/integrations/lucid/migrations/legacy/migrate_legacy_attachment.d.ts.map +1 -0
- package/build/src/integrations/lucid/{migrate_legacy_attachment.js → migrations/legacy/migrate_legacy_attachment.js} +35 -25
- package/build/src/integrations/lucid/migrations/legacy/migrate_legacy_attachment.js.map +1 -0
- package/build/src/integrations/lucid/{migrate_legacy_attachment_records.d.ts → migrations/legacy/migrate_legacy_attachment_records.d.ts} +3 -3
- package/build/src/integrations/lucid/migrations/legacy/migrate_legacy_attachment_records.d.ts.map +1 -0
- package/build/src/integrations/lucid/{migrate_legacy_attachment_records.js → migrations/legacy/migrate_legacy_attachment_records.js} +11 -7
- package/build/src/integrations/lucid/migrations/legacy/migrate_legacy_attachment_records.js.map +1 -0
- package/build/src/integrations/lucid/models/attachment_link_model.d.ts +30 -0
- package/build/src/integrations/lucid/models/attachment_link_model.d.ts.map +1 -0
- package/build/src/integrations/lucid/models/attachment_link_model.js +59 -0
- package/build/src/integrations/lucid/models/attachment_link_model.js.map +1 -0
- package/build/src/integrations/lucid/{attachment_model.d.ts → models/attachment_model.d.ts} +5 -8
- package/build/src/integrations/lucid/models/attachment_model.d.ts.map +1 -0
- package/build/src/integrations/lucid/{attachment_model.js → models/attachment_model.js} +5 -16
- package/build/src/integrations/lucid/models/attachment_model.js.map +1 -0
- package/build/src/integrations/lucid/{lucid_attachment_lifecycle_service.d.ts → persistence/lucid_attachment_lifecycle_service.d.ts} +18 -14
- package/build/src/integrations/lucid/persistence/lucid_attachment_lifecycle_service.d.ts.map +1 -0
- package/build/src/integrations/lucid/persistence/lucid_attachment_lifecycle_service.js +252 -0
- package/build/src/integrations/lucid/persistence/lucid_attachment_lifecycle_service.js.map +1 -0
- package/build/src/integrations/lucid/persistence/lucid_attachment_metadata_persister.d.ts +17 -0
- package/build/src/integrations/lucid/persistence/lucid_attachment_metadata_persister.d.ts.map +1 -0
- package/build/src/integrations/lucid/persistence/lucid_attachment_metadata_persister.js +18 -0
- package/build/src/integrations/lucid/persistence/lucid_attachment_metadata_persister.js.map +1 -0
- package/build/src/integrations/lucid/{lucid_attachment_repository.d.ts → persistence/lucid_attachment_repository.d.ts} +3 -3
- package/build/src/integrations/lucid/persistence/lucid_attachment_repository.d.ts.map +1 -0
- package/build/src/integrations/lucid/{lucid_attachment_repository.js → persistence/lucid_attachment_repository.js} +1 -1
- package/build/src/integrations/lucid/persistence/lucid_attachment_repository.js.map +1 -0
- package/build/src/integrations/lucid/persistence/lucid_attachment_store.d.ts +48 -0
- package/build/src/integrations/lucid/persistence/lucid_attachment_store.d.ts.map +1 -0
- package/build/src/integrations/lucid/persistence/lucid_attachment_store.js +226 -0
- package/build/src/integrations/lucid/persistence/lucid_attachment_store.js.map +1 -0
- package/build/src/integrations/lucid/{lucid_variant_generation_service.d.ts → persistence/lucid_variant_generation_service.d.ts} +8 -5
- package/build/src/integrations/lucid/persistence/lucid_variant_generation_service.d.ts.map +1 -0
- package/build/src/integrations/lucid/{lucid_variant_generation_service.js → persistence/lucid_variant_generation_service.js} +9 -3
- package/build/src/integrations/lucid/persistence/lucid_variant_generation_service.js.map +1 -0
- package/build/src/integrations/lucid/relations/attachment_owner.d.ts.map +1 -0
- package/build/src/integrations/lucid/relations/attachment_owner.js.map +1 -0
- package/build/src/integrations/lucid/{attachment_relation.d.ts → relations/attachment_relation.d.ts} +29 -15
- package/build/src/integrations/lucid/relations/attachment_relation.d.ts.map +1 -0
- package/build/src/integrations/lucid/relations/attachment_relation.js +273 -0
- package/build/src/integrations/lucid/relations/attachment_relation.js.map +1 -0
- package/build/src/integrations/lucid/schema/attachment_schema_service.d.ts +28 -0
- package/build/src/integrations/lucid/schema/attachment_schema_service.d.ts.map +1 -0
- package/build/src/integrations/lucid/schema/attachment_schema_service.js +81 -0
- package/build/src/integrations/lucid/schema/attachment_schema_service.js.map +1 -0
- package/build/src/integrations/lucid/schema/attachment_table_names.d.ts +15 -0
- package/build/src/integrations/lucid/schema/attachment_table_names.d.ts.map +1 -0
- package/build/src/integrations/lucid/schema/attachment_table_names.js +23 -0
- package/build/src/integrations/lucid/schema/attachment_table_names.js.map +1 -0
- package/build/src/integrations/lucid/schema/attachments_table_stub.d.ts.map +1 -0
- package/build/src/integrations/lucid/{attachments_table_stub.js → schema/attachments_table_stub.js} +2 -4
- package/build/src/integrations/lucid/schema/attachments_table_stub.js.map +1 -0
- package/build/src/integrations/lucid/schema/configure_lucid_attachment_tables.d.ts +12 -0
- package/build/src/integrations/lucid/schema/configure_lucid_attachment_tables.d.ts.map +1 -0
- package/build/src/integrations/lucid/schema/configure_lucid_attachment_tables.js +19 -0
- package/build/src/integrations/lucid/schema/configure_lucid_attachment_tables.js.map +1 -0
- package/build/src/media/binaries.d.ts +79 -0
- package/build/src/media/binaries.d.ts.map +1 -0
- package/build/src/media/binaries.js +288 -0
- package/build/src/media/binaries.js.map +1 -0
- package/build/src/media/blurhash.d.ts +48 -0
- package/build/src/media/blurhash.d.ts.map +1 -0
- package/build/src/media/blurhash.js +46 -0
- package/build/src/media/blurhash.js.map +1 -0
- package/build/src/media/exif.d.ts +23 -0
- package/build/src/media/exif.d.ts.map +1 -0
- package/build/src/media/exif.js +98 -0
- package/build/src/media/exif.js.map +1 -0
- package/build/src/media/media_metadata.d.ts +55 -0
- package/build/src/media/media_metadata.d.ts.map +1 -0
- package/build/src/media/media_metadata.js +27 -0
- package/build/src/media/media_metadata.js.map +1 -0
- package/build/src/media/sharp.d.ts +45 -0
- package/build/src/media/sharp.d.ts.map +1 -0
- package/build/src/media/sharp.js +76 -0
- package/build/src/media/sharp.js.map +1 -0
- package/build/src/media/v5_metadata.d.ts +20 -0
- package/build/src/media/v5_metadata.d.ts.map +1 -0
- package/build/src/media/v5_metadata.js +20 -0
- package/build/src/media/v5_metadata.js.map +1 -0
- package/build/src/queues/memory_queue.d.ts.map +1 -1
- package/build/src/queues/memory_queue.js +4 -1
- package/build/src/queues/memory_queue.js.map +1 -1
- package/build/src/sources/attachment_manager.d.ts +1 -3
- package/build/src/sources/attachment_manager.d.ts.map +1 -1
- package/build/src/sources/attachment_manager.js +19 -12
- package/build/src/sources/attachment_manager.js.map +1 -1
- package/build/src/variants/variant_converter.d.ts +4 -1
- package/build/src/variants/variant_converter.d.ts.map +1 -1
- package/build/src/variants/variant_generation_service.d.ts +9 -3
- package/build/src/variants/variant_generation_service.d.ts.map +1 -1
- package/build/src/variants/variant_generation_service.js +47 -6
- package/build/src/variants/variant_generation_service.js.map +1 -1
- package/build/stubs/config/attachment.stub +23 -2
- package/build/stubs/converters/converter.stub +18 -0
- package/build/stubs/migrations/attachments_table.stub +7 -25
- package/build/{src/integrations/lucid/render_legacy_attachment_migration_script.js → stubs/migrations/legacy_attachment_migration.stub} +13 -15
- package/build/tests/adonis_queue.spec.js +56 -1
- package/build/tests/adonis_queue.spec.js.map +1 -1
- package/build/tests/attachment_events.spec.d.ts +8 -0
- package/build/tests/attachment_events.spec.d.ts.map +1 -0
- package/build/tests/attachment_events.spec.js +65 -0
- package/build/tests/attachment_events.spec.js.map +1 -0
- package/build/tests/attachment_job_processor.spec.js +77 -2
- package/build/tests/attachment_job_processor.spec.js.map +1 -1
- package/build/tests/attachment_provider.spec.js +84 -1
- package/build/tests/attachment_provider.spec.js.map +1 -1
- package/build/tests/attachment_schema_service.spec.d.ts +8 -0
- package/build/tests/attachment_schema_service.spec.d.ts.map +1 -0
- package/build/tests/attachment_schema_service.spec.js +52 -0
- package/build/tests/attachment_schema_service.spec.js.map +1 -0
- package/build/tests/attachment_service.spec.js +81 -2
- package/build/tests/attachment_service.spec.js.map +1 -1
- package/build/tests/attachment_table_names.spec.d.ts +8 -0
- package/build/tests/attachment_table_names.spec.d.ts.map +1 -0
- package/build/tests/attachment_table_names.spec.js +36 -0
- package/build/tests/attachment_table_names.spec.js.map +1 -0
- package/build/tests/attachments_table_stub.spec.js +41 -6
- package/build/tests/attachments_table_stub.spec.js.map +1 -1
- package/build/tests/autodetect_converter.spec.d.ts +8 -0
- package/build/tests/autodetect_converter.spec.d.ts.map +1 -0
- package/build/tests/autodetect_converter.spec.js +55 -0
- package/build/tests/autodetect_converter.spec.js.map +1 -0
- package/build/tests/binary_media.spec.d.ts +8 -0
- package/build/tests/binary_media.spec.d.ts.map +1 -0
- package/build/tests/binary_media.spec.js +106 -0
- package/build/tests/binary_media.spec.js.map +1 -0
- package/build/tests/blurhash_media.spec.d.ts +8 -0
- package/build/tests/blurhash_media.spec.d.ts.map +1 -0
- package/build/tests/blurhash_media.spec.js +40 -0
- package/build/tests/blurhash_media.spec.js.map +1 -0
- package/build/tests/configure.spec.js +1 -0
- package/build/tests/configure.spec.js.map +1 -1
- package/build/tests/configured_variant_converter_registry.spec.d.ts +8 -0
- package/build/tests/configured_variant_converter_registry.spec.d.ts.map +1 -0
- package/build/tests/configured_variant_converter_registry.spec.js +73 -0
- package/build/tests/configured_variant_converter_registry.spec.js.map +1 -0
- package/build/tests/converter_config.types.d.ts +36 -0
- package/build/tests/converter_config.types.d.ts.map +1 -0
- package/build/tests/converter_config.types.js +60 -0
- package/build/tests/converter_config.types.js.map +1 -0
- package/build/tests/define_config.spec.js +113 -0
- package/build/tests/define_config.spec.js.map +1 -1
- package/build/tests/errors.spec.d.ts +8 -0
- package/build/tests/errors.spec.d.ts.map +1 -0
- package/build/tests/errors.spec.js +43 -0
- package/build/tests/errors.spec.js.map +1 -0
- package/build/tests/exif_media.spec.d.ts +8 -0
- package/build/tests/exif_media.spec.d.ts.map +1 -0
- package/build/tests/exif_media.spec.js +50 -0
- package/build/tests/exif_media.spec.js.map +1 -0
- package/build/tests/helpers/lucid_test_database.d.ts.map +1 -1
- package/build/tests/helpers/lucid_test_database.js +17 -7
- package/build/tests/helpers/lucid_test_database.js.map +1 -1
- package/build/tests/legacy_attachment_migration_stub.spec.d.ts +8 -0
- package/build/tests/legacy_attachment_migration_stub.spec.d.ts.map +1 -0
- package/build/tests/legacy_attachment_migration_stub.spec.js +57 -0
- package/build/tests/legacy_attachment_migration_stub.spec.js.map +1 -0
- package/build/tests/lucid_attachment_collection_store.spec.js +5 -4
- package/build/tests/lucid_attachment_collection_store.spec.js.map +1 -1
- package/build/tests/lucid_attachment_column.spec.js +1 -1
- package/build/tests/lucid_attachment_column.spec.js.map +1 -1
- package/build/tests/lucid_attachment_lifecycle_service.spec.js +144 -256
- package/build/tests/lucid_attachment_lifecycle_service.spec.js.map +1 -1
- package/build/tests/lucid_attachment_metadata_persister.spec.d.ts +8 -0
- package/build/tests/lucid_attachment_metadata_persister.spec.d.ts.map +1 -0
- package/build/tests/lucid_attachment_metadata_persister.spec.js +34 -0
- package/build/tests/lucid_attachment_metadata_persister.spec.js.map +1 -0
- package/build/tests/lucid_attachment_relation.spec.js +167 -27
- package/build/tests/lucid_attachment_relation.spec.js.map +1 -1
- package/build/tests/lucid_attachment_repository.spec.js +1 -1
- package/build/tests/lucid_attachment_repository.spec.js.map +1 -1
- package/build/tests/lucid_attachment_store.spec.js +24 -52
- package/build/tests/lucid_attachment_store.spec.js.map +1 -1
- package/build/tests/lucid_sqlite_integration.spec.js +24 -18
- package/build/tests/lucid_sqlite_integration.spec.js.map +1 -1
- package/build/tests/lucid_variant_generation_service.spec.js +18 -1
- package/build/tests/lucid_variant_generation_service.spec.js.map +1 -1
- package/build/tests/make_converter.spec.d.ts +8 -0
- package/build/tests/make_converter.spec.d.ts.map +1 -0
- package/build/tests/make_converter.spec.js +32 -0
- package/build/tests/make_converter.spec.js.map +1 -0
- package/build/tests/media_metadata.spec.d.ts +8 -0
- package/build/tests/media_metadata.spec.d.ts.map +1 -0
- package/build/tests/media_metadata.spec.js +51 -0
- package/build/tests/media_metadata.spec.js.map +1 -0
- package/build/tests/migrate_legacy_attachment.spec.js +62 -47
- package/build/tests/migrate_legacy_attachment.spec.js.map +1 -1
- package/build/tests/migrate_legacy_attachment_records.spec.js +4 -3
- package/build/tests/migrate_legacy_attachment_records.spec.js.map +1 -1
- package/build/tests/package_exports.spec.js +18 -2
- package/build/tests/package_exports.spec.js.map +1 -1
- package/build/tests/sharp_media.spec.d.ts +8 -0
- package/build/tests/sharp_media.spec.d.ts.map +1 -0
- package/build/tests/sharp_media.spec.js +84 -0
- package/build/tests/sharp_media.spec.js.map +1 -0
- package/build/tests/v5_metadata.spec.d.ts +8 -0
- package/build/tests/v5_metadata.spec.d.ts.map +1 -0
- package/build/tests/v5_metadata.spec.js +19 -0
- package/build/tests/v5_metadata.spec.js.map +1 -0
- package/build/tests/variant_generation_service.spec.js +122 -0
- package/build/tests/variant_generation_service.spec.js.map +1 -1
- package/package.json +50 -2
- package/build/src/integrations/lucid/attachment_column.d.ts.map +0 -1
- package/build/src/integrations/lucid/attachment_column.js.map +0 -1
- package/build/src/integrations/lucid/attachment_model.d.ts.map +0 -1
- package/build/src/integrations/lucid/attachment_model.js.map +0 -1
- package/build/src/integrations/lucid/attachment_owner.d.ts.map +0 -1
- package/build/src/integrations/lucid/attachment_owner.js.map +0 -1
- package/build/src/integrations/lucid/attachment_relation.d.ts.map +0 -1
- package/build/src/integrations/lucid/attachment_relation.js +0 -163
- package/build/src/integrations/lucid/attachment_relation.js.map +0 -1
- package/build/src/integrations/lucid/attachments_table_stub.d.ts.map +0 -1
- package/build/src/integrations/lucid/attachments_table_stub.js.map +0 -1
- package/build/src/integrations/lucid/create_legacy_attachment_migration_script.d.ts +0 -13
- package/build/src/integrations/lucid/create_legacy_attachment_migration_script.d.ts.map +0 -1
- package/build/src/integrations/lucid/create_legacy_attachment_migration_script.js +0 -20
- package/build/src/integrations/lucid/create_legacy_attachment_migration_script.js.map +0 -1
- package/build/src/integrations/lucid/lucid_attachment_lifecycle_service.d.ts.map +0 -1
- package/build/src/integrations/lucid/lucid_attachment_lifecycle_service.js +0 -188
- package/build/src/integrations/lucid/lucid_attachment_lifecycle_service.js.map +0 -1
- package/build/src/integrations/lucid/lucid_attachment_repository.d.ts.map +0 -1
- package/build/src/integrations/lucid/lucid_attachment_repository.js.map +0 -1
- package/build/src/integrations/lucid/lucid_attachment_store.d.ts +0 -36
- package/build/src/integrations/lucid/lucid_attachment_store.d.ts.map +0 -1
- package/build/src/integrations/lucid/lucid_attachment_store.js +0 -179
- package/build/src/integrations/lucid/lucid_attachment_store.js.map +0 -1
- package/build/src/integrations/lucid/lucid_variant_generation_service.d.ts.map +0 -1
- package/build/src/integrations/lucid/lucid_variant_generation_service.js.map +0 -1
- package/build/src/integrations/lucid/migrate_legacy_attachment.d.ts.map +0 -1
- package/build/src/integrations/lucid/migrate_legacy_attachment.js.map +0 -1
- package/build/src/integrations/lucid/migrate_legacy_attachment_records.d.ts.map +0 -1
- package/build/src/integrations/lucid/migrate_legacy_attachment_records.js.map +0 -1
- package/build/src/integrations/lucid/render_legacy_attachment_migration_script.d.ts +0 -11
- package/build/src/integrations/lucid/render_legacy_attachment_migration_script.d.ts.map +0 -1
- package/build/src/integrations/lucid/render_legacy_attachment_migration_script.js.map +0 -1
- package/build/tests/create_legacy_attachment_migration_script.spec.d.ts.map +0 -1
- package/build/tests/create_legacy_attachment_migration_script.spec.js +0 -31
- package/build/tests/create_legacy_attachment_migration_script.spec.js.map +0 -1
- /package/build/src/integrations/lucid/{attachment_owner.d.ts → relations/attachment_owner.d.ts} +0 -0
- /package/build/src/integrations/lucid/{attachment_owner.js → relations/attachment_owner.js} +0 -0
- /package/build/src/integrations/lucid/{attachments_table_stub.d.ts → schema/attachments_table_stub.d.ts} +0 -0
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { configProvider } from '@adonisjs/core';
|
|
8
8
|
import { MemoryAttachmentQueue } from './queues/memory_queue.js';
|
|
9
|
+
import { AttachmentError } from './errors.js';
|
|
10
|
+
import { resolveAttachmentTableNames, } from './integrations/lucid/schema/attachment_table_names.js';
|
|
11
|
+
import { ConfiguredVariantConverterRegistry, } from './converters/configured_variant_converter_registry.js';
|
|
9
12
|
/**
|
|
10
13
|
* Defers resolution of optional Adonis integrations until application boot.
|
|
11
14
|
*/
|
|
@@ -25,6 +28,21 @@ export function defineConfig(config) {
|
|
|
25
28
|
: async () => { },
|
|
26
29
|
...(config.queueConcurrency ? { concurrency: config.queueConcurrency } : {}),
|
|
27
30
|
});
|
|
31
|
+
const metadataExtractors = config.media?.metadata
|
|
32
|
+
? await resolveIntegration(config.media.metadata, app)
|
|
33
|
+
: undefined;
|
|
34
|
+
const metadataPersister = config.media?.metadataPersister
|
|
35
|
+
? await resolveIntegration(config.media.metadataPersister, app)
|
|
36
|
+
: undefined;
|
|
37
|
+
const resolvedMetadataPersister = metadataPersister
|
|
38
|
+
?? await resolveLucidMetadataPersister(config.media?.metadataPolicy?.mode, config.integrations?.lucid);
|
|
39
|
+
const events = config.events ? await resolveIntegration(config.events, app) : undefined;
|
|
40
|
+
if (processor && events) {
|
|
41
|
+
processor.setEventEmitter(events);
|
|
42
|
+
}
|
|
43
|
+
if (config.media?.metadataPolicy?.mode === 'deferred' && !resolvedMetadataPersister) {
|
|
44
|
+
throw new AttachmentError('Deferred metadata extraction requires media.metadataPersister or integrations.lucid', { code: 'E_INVALID_ATTACHMENT_CONFIG' });
|
|
45
|
+
}
|
|
28
46
|
return {
|
|
29
47
|
defaultDisk: config.defaultDisk ?? storage.defaultDisk ?? 'fs',
|
|
30
48
|
storage,
|
|
@@ -35,17 +53,41 @@ export function defineConfig(config) {
|
|
|
35
53
|
: {}),
|
|
36
54
|
...(config.defaults ? { defaults: config.defaults } : {}),
|
|
37
55
|
...(config.sources ? { sources: config.sources } : {}),
|
|
56
|
+
...(metadataExtractors ? { metadataExtractors } : {}),
|
|
57
|
+
...(config.media?.metadataPolicy?.mode ? { metadataMode: config.media.metadataPolicy.mode } : {}),
|
|
58
|
+
...(config.media?.metadataPolicy?.variants !== undefined ? { metadataVariants: config.media.metadataPolicy.variants } : {}),
|
|
59
|
+
...(resolvedMetadataPersister ? { metadataPersister: resolvedMetadataPersister } : {}),
|
|
60
|
+
...(events ? { events } : {}),
|
|
61
|
+
...(config.converters
|
|
62
|
+
? { converters: new ConfiguredVariantConverterRegistry(config.converters) }
|
|
63
|
+
: {}),
|
|
64
|
+
...(config.integrations?.lucid
|
|
65
|
+
? {
|
|
66
|
+
integrations: {
|
|
67
|
+
lucid: resolveAttachmentTableNames(config.integrations.lucid.tableName),
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
: {}),
|
|
38
71
|
...(config.createId ? { createId: config.createId } : {}),
|
|
39
72
|
};
|
|
40
73
|
});
|
|
41
74
|
}
|
|
75
|
+
async function resolveLucidMetadataPersister(mode, lucid) {
|
|
76
|
+
if (mode !== 'deferred' || !lucid) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
const { LucidAttachmentMetadataPersister } = await import('./integrations/lucid/persistence/lucid_attachment_metadata_persister.js');
|
|
80
|
+
return new LucidAttachmentMetadataPersister();
|
|
81
|
+
}
|
|
42
82
|
function resolveRoute(route) {
|
|
43
83
|
if (route === false) {
|
|
44
84
|
return false;
|
|
45
85
|
}
|
|
46
86
|
const prefix = route?.prefix ?? '/attachments';
|
|
47
87
|
if (!prefix.startsWith('/') || prefix.includes(':')) {
|
|
48
|
-
throw new
|
|
88
|
+
throw new AttachmentError('Attachment route prefix must start with "/" and cannot contain parameters', {
|
|
89
|
+
code: 'E_INVALID_ATTACHMENT_ROUTE',
|
|
90
|
+
});
|
|
49
91
|
}
|
|
50
92
|
return { path: `${prefix.replace(/\/+$/, '') || ''}/:id` };
|
|
51
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define_config.js","sourceRoot":"","sources":["../../src/define_config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"define_config.js","sourceRoot":"","sources":["../../src/define_config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EACL,2BAA2B,GAE5B,MAAM,uDAAuD,CAAA;AAc9D,OAAO,EACL,kCAAkC,GAGnC,MAAM,uDAAuD,CAAA;AA0E9D;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAyC;IAEzC,OAAO,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACzC,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;QAC7D,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS;YAChC,CAAC,CAAC,MAAM,kBAAkB,CAAC,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC;YACjD,CAAC,CAAC,SAA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,CAAA;IACd,CAAC;IAED,MAAM,MAAM,GAAG,KAAK,EAAE,MAAM,IAAI,cAAc,CAAA;IAE9C,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,eAAe,CAAC,2EAA2E,EAAE;YACrG,IAAI,EAAE,4BAA4B;SACnC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,CAAA;AAC5D,CAAC;AAED,KAAK,UAAU,kBAAkB,CAC/B,WAA2B,EAC3B,GAAuB;IAEvB,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE,CAAC;QACtC,OAAQ,WAAmE,CAAC,GAAG,CAAC,CAAA;IAClF,CAAC;IAED,OAAO,WAAW,CAAA;AACpB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jrmc/adonis-attachment
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
|
+
*/
|
|
7
|
+
import { Exception } from '@adonisjs/core/exceptions';
|
|
8
|
+
export type AttachmentErrorOptions = ErrorOptions & {
|
|
9
|
+
code?: string;
|
|
10
|
+
status?: number;
|
|
11
|
+
};
|
|
12
|
+
/** Base exception for every error emitted by this package. */
|
|
13
|
+
export declare class AttachmentError extends Exception {
|
|
14
|
+
static code: string;
|
|
15
|
+
static status: number;
|
|
16
|
+
constructor(message: string, options?: AttachmentErrorOptions);
|
|
17
|
+
}
|
|
18
|
+
/** Raised when an attachment source cannot be normalized. */
|
|
19
|
+
export declare class AttachmentSourceError extends AttachmentError {
|
|
20
|
+
constructor(message: string, options?: AttachmentErrorOptions);
|
|
21
|
+
}
|
|
22
|
+
/** Raised when caller-provided attachment data fails a package invariant. */
|
|
23
|
+
export declare class AttachmentValidationError extends AttachmentError {
|
|
24
|
+
static code: string;
|
|
25
|
+
static status: number;
|
|
26
|
+
}
|
|
27
|
+
/** Raised when an attachment operation conflicts with current persisted state. */
|
|
28
|
+
export declare class AttachmentConflictError extends AttachmentError {
|
|
29
|
+
static code: string;
|
|
30
|
+
static status: number;
|
|
31
|
+
}
|
|
32
|
+
/** Raised when an adapter or integration has been configured incorrectly. */
|
|
33
|
+
export declare class AttachmentConfigurationError extends AttachmentError {
|
|
34
|
+
static code: string;
|
|
35
|
+
}
|
|
36
|
+
export declare class AttachmentNotFoundError extends AttachmentError {
|
|
37
|
+
constructor(attachmentId: string);
|
|
38
|
+
}
|
|
39
|
+
export declare class DeferredMetadataProcessorNotConfiguredError extends AttachmentError {
|
|
40
|
+
constructor();
|
|
41
|
+
}
|
|
42
|
+
export declare class DeferredMetadataNotConfiguredError extends AttachmentError {
|
|
43
|
+
constructor();
|
|
44
|
+
}
|
|
45
|
+
export declare class InvalidConverterModuleError extends AttachmentError {
|
|
46
|
+
constructor(key: string);
|
|
47
|
+
}
|
|
48
|
+
export declare class UnknownVariantConverterError extends AttachmentError {
|
|
49
|
+
constructor(key: string);
|
|
50
|
+
}
|
|
51
|
+
export declare class PersistedAttachmentNotFoundError extends AttachmentError {
|
|
52
|
+
constructor(id: string);
|
|
53
|
+
}
|
|
54
|
+
export declare class MissingOptionalDependencyError extends AttachmentError {
|
|
55
|
+
constructor(packages: string | readonly string[]);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG;IAClD,IAAI,CAAC,EAAE,MAAM,CA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ufourier <jeremy@chaufourier.fr>
|
|
6
|
+
*/
|
|
7
|
+
import { Exception } from '@adonisjs/core/exceptions';
|
|
8
|
+
/** Base exception for every error emitted by this package. */
|
|
9
|
+
export class AttachmentError extends Exception {
|
|
10
|
+
static code = 'E_ATTACHMENT_ERROR';
|
|
11
|
+
static status = 500;
|
|
12
|
+
constructor(message, options = {}) {
|
|
13
|
+
super(message, options);
|
|
14
|
+
const constructor = new.target;
|
|
15
|
+
this.code = options.code ?? constructor.code;
|
|
16
|
+
this.status = options.status ?? constructor.status;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Raised when an attachment source cannot be normalized. */
|
|
20
|
+
export class AttachmentSourceError extends AttachmentError {
|
|
21
|
+
constructor(message, options = {}) {
|
|
22
|
+
super(message, {
|
|
23
|
+
...options,
|
|
24
|
+
code: options.code ?? 'E_ATTACHMENT_SOURCE',
|
|
25
|
+
status: options.status ?? 400,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** Raised when caller-provided attachment data fails a package invariant. */
|
|
30
|
+
export class AttachmentValidationError extends AttachmentError {
|
|
31
|
+
static code = 'E_INVALID_ATTACHMENT';
|
|
32
|
+
static status = 400;
|
|
33
|
+
}
|
|
34
|
+
/** Raised when an attachment operation conflicts with current persisted state. */
|
|
35
|
+
export class AttachmentConflictError extends AttachmentError {
|
|
36
|
+
static code = 'E_ATTACHMENT_CONFLICT';
|
|
37
|
+
static status = 409;
|
|
38
|
+
}
|
|
39
|
+
/** Raised when an adapter or integration has been configured incorrectly. */
|
|
40
|
+
export class AttachmentConfigurationError extends AttachmentError {
|
|
41
|
+
static code = 'E_ATTACHMENT_CONFIGURATION';
|
|
42
|
+
}
|
|
43
|
+
export class AttachmentNotFoundError extends AttachmentError {
|
|
44
|
+
constructor(attachmentId) {
|
|
45
|
+
super(`Attachment "${attachmentId}" was not found`, {
|
|
46
|
+
code: 'E_ATTACHMENT_NOT_FOUND',
|
|
47
|
+
status: 404,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export class DeferredMetadataProcessorNotConfiguredError extends AttachmentError {
|
|
52
|
+
constructor() {
|
|
53
|
+
super('Attachment metadata jobs require a configured metadata processor', {
|
|
54
|
+
code: 'E_METADATA_PROCESSOR_NOT_CONFIGURED',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export class DeferredMetadataNotConfiguredError extends AttachmentError {
|
|
59
|
+
constructor() {
|
|
60
|
+
super('Deferred metadata extraction requires configured extractors and a metadata persister', {
|
|
61
|
+
code: 'E_METADATA_NOT_CONFIGURED',
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export class InvalidConverterModuleError extends AttachmentError {
|
|
66
|
+
constructor(key) {
|
|
67
|
+
super(`Converter "${key}" must default-export a Converter class or a VariantConverter object`, {
|
|
68
|
+
code: 'E_INVALID_CONVERTER_MODULE',
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export class UnknownVariantConverterError extends AttachmentError {
|
|
73
|
+
constructor(key) {
|
|
74
|
+
super(`No variant converter is registered for "${key}"`, {
|
|
75
|
+
code: 'E_UNKNOWN_VARIANT_CONVERTER',
|
|
76
|
+
status: 422,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export class PersistedAttachmentNotFoundError extends AttachmentError {
|
|
81
|
+
constructor(id) {
|
|
82
|
+
super(`Persisted attachment "${id}" was not found`, {
|
|
83
|
+
code: 'E_PERSISTED_ATTACHMENT_NOT_FOUND',
|
|
84
|
+
status: 404,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export class MissingOptionalDependencyError extends AttachmentError {
|
|
89
|
+
constructor(packages) {
|
|
90
|
+
const names = Array.isArray(packages) ? packages : [packages];
|
|
91
|
+
super(`Missing optional ${names.length === 1 ? 'dependency' : 'dependencies'}: ${names.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AAY,QAAoC;QAC9C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;QAC7D,KAAK,CAAC,oBAAoB,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE;YACnG,IAAI,EAAE,mBAAmB;SAC1B,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jrmc/adonis-attachment
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
|
+
*/
|
|
7
|
+
import type { AttachmentEventEmitter, AttachmentEventName, AttachmentEventPayload } from './attachment_events.js';
|
|
8
|
+
export type AdonisEmitter = {
|
|
9
|
+
emit(event: string, payload: unknown): void | Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
/** Adapts AdonisJS' emitter to the attachment event contract. */
|
|
12
|
+
export declare class AdonisAttachmentEventEmitter implements AttachmentEventEmitter {
|
|
13
|
+
#private;
|
|
14
|
+
constructor(emitter: AdonisEmitter);
|
|
15
|
+
emit(event: AttachmentEventName, payload: AttachmentEventPayload): void | Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=adonis_attachment_event_emitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adonis_attachment_event_emitter.d.ts","sourceRoot":"","sources":["../../../src/events/adonis_attachment_event_emitter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,wBAAwB,CAAA;AAE/B,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5D,CAAA;AAED,iEAAiE;AACjE,qBAAa,4BAA6B,YAAW,sBAAsB;;gBAG7D,OAAO,EAAE,aAAa;IAIlC,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,sBAAsB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAGxF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jrmc/adonis-attachment
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
|
+
*/
|
|
7
|
+
/** Adapts AdonisJS' emitter to the attachment event contract. */
|
|
8
|
+
export class AdonisAttachmentEventEmitter {
|
|
9
|
+
#emitter;
|
|
10
|
+
constructor(emitter) {
|
|
11
|
+
this.#emitter = emitter;
|
|
12
|
+
}
|
|
13
|
+
emit(event, payload) {
|
|
14
|
+
return this.#emitter.emit(event, payload);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=adonis_attachment_event_emitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adonis_attachment_event_emitter.js","sourceRoot":"","sources":["../../../src/events/adonis_attachment_event_emitter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,iEAAiE;AACjE,MAAM,OAAO,4BAA4B;IAC9B,QAAQ,CAAe;IAEhC,YAAY,OAAsB;QAChC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;IACzB,CAAC;IAED,IAAI,CAAC,KAA0B,EAAE,OAA+B;QAC9D,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC3C,CAAC;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jrmc/adonis-attachment
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
|
+
*/
|
|
7
|
+
import type { Attachment } from '../core/attachment.js';
|
|
8
|
+
export type AttachmentEventName = 'attachment:created' | 'attachment:deleted' | 'attachment:metadata_started' | 'attachment:metadata_completed' | 'attachment:metadata_failed' | 'attachment:variant_started' | 'attachment:variant_completed' | 'attachment:variant_failed';
|
|
9
|
+
/**
|
|
10
|
+
* Identifies a Lucid relation using the v5 event payload fields. It remains
|
|
11
|
+
* optional because the core can also run without any database integration.
|
|
12
|
+
*/
|
|
13
|
+
export type AttachmentEventContext = {
|
|
14
|
+
tableName: string;
|
|
15
|
+
attributeName: string;
|
|
16
|
+
primary: {
|
|
17
|
+
key: string;
|
|
18
|
+
value: string | number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type AttachmentEventFailure = {
|
|
22
|
+
message: string;
|
|
23
|
+
code?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Payload shared by attachment lifecycle events. `tableName`, `attributeName`
|
|
27
|
+
* and `primary` retain the v5 contract for attachments managed by Lucid.
|
|
28
|
+
*/
|
|
29
|
+
export type AttachmentEventPayload = Partial<AttachmentEventContext> & {
|
|
30
|
+
attachment: Attachment;
|
|
31
|
+
variants?: readonly string[];
|
|
32
|
+
error?: AttachmentEventFailure;
|
|
33
|
+
};
|
|
34
|
+
export interface AttachmentEventEmitter {
|
|
35
|
+
emit(event: AttachmentEventName, payload: AttachmentEventPayload): void | Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Dispatches observers without allowing their failures to alter attachment
|
|
39
|
+
* persistence or queue processing.
|
|
40
|
+
*/
|
|
41
|
+
export declare function emitAttachmentEvent(emitter: AttachmentEventEmitter | undefined, event: AttachmentEventName, payload: AttachmentEventPayload): void;
|
|
42
|
+
export declare function toAttachmentEventFailure(error: unknown): AttachmentEventFailure;
|
|
43
|
+
//# sourceMappingURL=attachment_events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment_events.d.ts","sourceRoot":"","sources":["../../../src/events/attachment_events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD,MAAM,MAAM,mBAAmB,GAC3B,oBAAoB,GACpB,oBAAoB,GACpB,6BAA6B,GAC7B,+BAA+B,GAC/B,4BAA4B,GAC5B,4BAA4B,GAC5B,8BAA8B,GAC9B,2BAA2B,CAAA;AAE/B;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KACvB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC,GAAG;IACrE,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5B,KAAK,CAAC,EAAE,sBAAsB,CAAA;CAC/B,CAAA;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,sBAAsB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACxF;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,sBAAsB,GAAG,SAAS,EAC3C,KAAK,EAAE,mBAAmB,EAC1B,OAAO,EAAE,sBAAsB,GAC9B,IAAI,CAUN;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,sBAAsB,CAU/E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jrmc/adonis-attachment
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Dispatches observers without allowing their failures to alter attachment
|
|
9
|
+
* persistence or queue processing.
|
|
10
|
+
*/
|
|
11
|
+
export function emitAttachmentEvent(emitter, event, payload) {
|
|
12
|
+
if (!emitter) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
void Promise.resolve(emitter.emit(event, payload)).catch(() => undefined);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
// Event listeners are observational and must never fail the attachment operation.
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function toAttachmentEventFailure(error) {
|
|
23
|
+
if (error && typeof error === 'object') {
|
|
24
|
+
const value = error;
|
|
25
|
+
return {
|
|
26
|
+
message: typeof value.message === 'string' ? value.message : String(error),
|
|
27
|
+
...(typeof value.code === 'string' ? { code: value.code } : {}),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return { message: String(error) };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=attachment_events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment_events.js","sourceRoot":"","sources":["../../../src/events/attachment_events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8CH;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAA2C,EAC3C,KAA0B,EAC1B,OAA+B;IAE/B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAM;IACR,CAAC;IAED,IAAI,CAAC;QACH,KAAK,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;IAC3E,CAAC;IAAC,MAAM,CAAC;QACP,kFAAkF;IACpF,CAAC;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAc;IACrD,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,MAAM,KAAK,GAAG,KAA8C,CAAA;QAC5D,OAAO;YACL,OAAO,EAAE,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YAC1E,GAAG,CAAC,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAChE,CAAA;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAA;AACnC,CAAC"}
|
package/build/src/integrations/lucid/{attachment_column.d.ts → column/attachment_column.d.ts}
RENAMED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
7
|
import type { LucidRow } from '@adonisjs/lucid/types/model';
|
|
8
|
-
import { type Attachment } from '
|
|
9
|
-
import type { AttachmentPersistenceOptions } from '
|
|
8
|
+
import { type Attachment } from '../../../core/attachment.js';
|
|
9
|
+
import type { AttachmentPersistenceOptions } from '../../../core/attachment_options.js';
|
|
10
10
|
export type LucidAttachmentOptions<Model = any> = AttachmentPersistenceOptions<Model> & {
|
|
11
11
|
serialize?: (value: Attachment | null | undefined) => unknown;
|
|
12
12
|
serializeAs?: string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment_column.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/lucid/column/attachment_column.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAc,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAEvE,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAEhF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAA;AAoBvF,MAAM,MAAM,sBAAsB,CAAC,KAAK,GAAG,GAAG,IAAI,4BAA4B,CAAC,KAAK,CAAC,GAAG;IACtF,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,KAAK,OAAO,CAAA;IAC7D,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B,CAAA;AAOD;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,GAAG,QAAQ,EAAE,OAAO,GAAE,sBAAsB,CAAC,KAAK,CAAM,GAAG,iBAAiB,CAoB3G"}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
7
|
import app from '@adonisjs/core/services/app';
|
|
8
|
-
import { isAttachmentDraft } from '
|
|
9
|
-
import { isAttachmentPending, markAttachmentPersisted } from '
|
|
8
|
+
import { isAttachmentDraft } from '../../../core/attachment.js';
|
|
9
|
+
import { isAttachmentPending, markAttachmentPersisted } from '../../../core/attachment_state.js';
|
|
10
10
|
const columnOptions = new WeakMap();
|
|
11
11
|
const saveStates = new WeakMap();
|
|
12
12
|
const deleteStates = new WeakMap();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment_column.js","sourceRoot":"","sources":["../../../../../src/integrations/lucid/column/attachment_column.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,GAAG,MAAM,6BAA6B,CAAA;AAG7C,OAAO,EAAE,iBAAiB,EAAmB,MAAM,6BAA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AAiB,CAAC,CAAsB,CAAA;IAClF,MAAM,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AACvF,CAAC"}
|
|
@@ -4,17 +4,21 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
-
export { AttachmentModel } from "./attachment_model.js";
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
7
|
+
export { AttachmentModel } from "./models/attachment_model.js";
|
|
8
|
+
export { AttachmentLinkModel } from "./models/attachment_link_model.js";
|
|
9
|
+
export { configureLucidAttachmentTables, } from "./schema/configure_lucid_attachment_tables.js";
|
|
10
|
+
export { resolveAttachmentTableNames, type AttachmentTableNames, } from "./schema/attachment_table_names.js";
|
|
11
|
+
export { AttachmentSchemaService, type AttachmentSchemaServiceOptions, } from "./schema/attachment_schema_service.js";
|
|
12
|
+
export { attachment, type LucidAttachmentOptions, } from "./column/attachment_column.js";
|
|
13
|
+
export { attachmentRelation, attachmentsRelation, AttachmentRelation, AttachmentCollectionRelation, type AttachmentRelationOptions, } from "./relations/attachment_relation.js";
|
|
14
|
+
export { LucidAttachmentRepository } from "./persistence/lucid_attachment_repository.js";
|
|
15
|
+
export { LucidAttachmentMetadataPersister } from "./persistence/lucid_attachment_metadata_persister.js";
|
|
16
|
+
export { LucidAttachmentStore, type LucidAttachmentWithVariants, type LucidAttachmentStoreOptions, } from "./persistence/lucid_attachment_store.js";
|
|
17
|
+
export { LucidAttachmentLifecycleService, type AttachmentFileService, type LucidAttachmentPersistence, } from "./persistence/lucid_attachment_lifecycle_service.js";
|
|
18
|
+
export { LucidVariantGenerationService, PersistedAttachmentNotFoundError, type LucidVariantGenerationServiceOptions, } from "./persistence/lucid_variant_generation_service.js";
|
|
19
|
+
export { createAttachmentOwnerKey, type AttachmentOwner, } from "./relations/attachment_owner.js";
|
|
20
|
+
export { createAttachmentsTableStubState, type AttachmentsTableStubOptions, type AttachmentsTableStubState, } from "./schema/attachments_table_stub.js";
|
|
21
|
+
export { migrateLegacyAttachment, migrateLegacyAttachmentColumn, type LegacyAttachment, type LegacyVariant, type MigrateLegacyAttachmentOptions, type MigrateLegacyAttachmentColumnOptions, type MigratedAttachmentBlob, type MigratedAttachmentLink, type MigratedAttachmentRows, } from "./migrations/legacy/migrate_legacy_attachment.js";
|
|
22
|
+
export { migrateLegacyAttachmentRecords, type LegacyAttachmentMigrationRecord, type LegacyAttachmentMigrationResult, type LegacyAttachmentMigrationWriter, type MigrateLegacyAttachmentRecordsOptions, } from "./migrations/legacy/migrate_legacy_attachment_records.js";
|
|
23
|
+
export { createLegacyAttachmentMigrationStubState, type LegacyAttachmentMigrationStubOptions, type LegacyAttachmentMigrationStubState, } from "./migrations/legacy/legacy_attachment_migration_stub.js";
|
|
20
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/lucid/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/lucid/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EACL,8BAA8B,GAC/B,MAAM,+CAA+C,CAAC;AACvD,OAAO,E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AAO,EACL,wCAAwC,EACxC,KAAK,oCAAoC,EACzC,KAAK,kCAAkC,GACxC,MAAM,yDAAyD,CAAC"}
|
|
@@ -4,17 +4,21 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
-
export { AttachmentModel } from "./attachment_model.js";
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
7
|
+
export { AttachmentModel } from "./models/attachment_model.js";
|
|
8
|
+
export { AttachmentLinkModel } from "./models/attachment_link_model.js";
|
|
9
|
+
export { configureLucidAttachmentTables, } from "./schema/configure_lucid_attachment_tables.js";
|
|
10
|
+
export { resolveAttachmentTableNames, } from "./schema/attachment_table_names.js";
|
|
11
|
+
export { AttachmentSchemaService, } from "./schema/attachment_schema_service.js";
|
|
12
|
+
export { attachment, } from "./column/attachment_column.js";
|
|
13
|
+
export { attachmentRelation, attachmentsRelation, AttachmentRelation, AttachmentCollectionRelation, } from "./relations/attachment_relation.js";
|
|
14
|
+
export { LucidAttachmentRepository } from "./persistence/lucid_attachment_repository.js";
|
|
15
|
+
export { LucidAttachmentMetadataPersister } from "./persistence/lucid_attachment_metadata_persister.js";
|
|
16
|
+
export { LucidAttachmentStore, } from "./persistence/lucid_attachment_store.js";
|
|
17
|
+
export { LucidAttachmentLifecycleService, } from "./persistence/lucid_attachment_lifecycle_service.js";
|
|
18
|
+
export { LucidVariantGenerationService, PersistedAttachmentNotFoundError, } from "./persistence/lucid_variant_generation_service.js";
|
|
19
|
+
export { createAttachmentOwnerKey, } from "./relations/attachment_owner.js";
|
|
20
|
+
export { createAttachmentsTableStubState, } from "./schema/attachments_table_stub.js";
|
|
21
|
+
export { migrateLegacyAttachment, migrateLegacyAttachmentColumn, } from "./migrations/legacy/migrate_legacy_attachment.js";
|
|
22
|
+
export { migrateLegacyAttachmentRecords, } from "./migrations/legacy/migrate_legacy_attachment_records.js";
|
|
23
|
+
export { createLegacyAttachmentMigrationStubState, } from "./migrations/legacy/legacy_attachment_migration_stub.js";
|
|
20
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/integrations/lucid/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/integrations/lucid/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EACL,8BAA8B,GAC/B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,2BAA2B,GAE5B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,uBAAuB,GAExB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,UAAU,GAEX,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,4BAA4B,GAE7B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EACL,oBAAoB,GAGrB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,+BAA+B,GAGhC,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,6BAA6B,EAC7B,gCAAgC,GAEjC,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EACL,wBAAwB,GAEzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,+BAA+B,GAGhC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,uBAAuB,EACvB,6BAA6B,GAQ9B,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACL,8BAA8B,GAK/B,MAAM,0DAA0D,CAAC;AAClE,OAAO,EACL,wCAAwC,GAGzC,MAAM,yDAAyD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jrmc/adonis-attachment
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
|
+
*/
|
|
7
|
+
export type LegacyAttachmentMigrationStubOptions = {
|
|
8
|
+
directory: string;
|
|
9
|
+
defaultDisk?: string;
|
|
10
|
+
timestamp?: number;
|
|
11
|
+
};
|
|
12
|
+
export type LegacyAttachmentMigrationStubState = {
|
|
13
|
+
destination: string;
|
|
14
|
+
defaultDisk: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Builds the state consumed by the legacy attachment data-migration stub.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createLegacyAttachmentMigrationStubState(options: LegacyAttachmentMigrationStubOptions): LegacyAttachmentMigrationStubState;
|
|
20
|
+
//# sourceMappingURL=legacy_attachment_migration_stub.d.ts.map
|
package/build/src/integrations/lucid/migrations/legacy/legacy_attachment_migration_stub.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy_attachment_migration_stub.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/lucid/migrations/legacy/legacy_attachment_migration_stub.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,MAAM,oCAAoC,GAAG;IACjD,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,kCAAkC,GAAG;IAC/C,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,wBAAgB,wCAAwC,CACtD,OAAO,EAAE,oCAAoC,GAC5C,kCAAkC,CAOpC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jrmc/adonis-attachment
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
|
+
*/
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
/**
|
|
9
|
+
* Builds the state consumed by the legacy attachment data-migration stub.
|
|
10
|
+
*/
|
|
11
|
+
export function createLegacyAttachmentMigrationStubState(options) {
|
|
12
|
+
const timestamp = options.timestamp ?? Date.now();
|
|
13
|
+
return {
|
|
14
|
+
destination: join(options.directory, `${timestamp}_migrate_v5_attachments.ts`),
|
|
15
|
+
defaultDisk: options.defaultDisk ?? 'public',
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=legacy_attachment_migration_stub.js.map
|
package/build/src/integrations/lucid/migrations/legacy/legacy_attachment_migration_stub.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy_attachment_migration_stub.js","sourceRoot":"","sources":["../../../../../../src/integrations/lucid/migrations/legacy/legacy_attachment_migration_stub.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAahC;;GAEG;AACH,MAAM,UAAU,wCAAwC,CACtD,OAA6C;IAE7C,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,CAAA;IAEjD,OAAO;QACL,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,SAAS,4BAA4B,CAAC;QAC9E,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,QAAQ;KAC7C,CAAA;AACH,CAAC"}
|