- Add jsonLimit: 5MB to bodyParser configuration in API routes
- Fixes issue with 413 'request entity too large' errors when uploading large documents via API
- Resolves#10239
Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
* Reducing loading on first open, closes#10263
* perf: Prosemirror deps loaded with Document model
* More initial component reduction
* more
* refactor
* Restrict document permanent deletion to admins only
- Split the document policy to separate restore and permanentDelete permissions
- permanentDelete now requires isTeamAdmin check
- Added test to verify non-admin users cannot permanently delete documents
- Updated existing test title for clarity
Fixes#10249
* Fix test: expect 'Authorization error' instead of 'Authorization required'
The policy system throws AuthorizationError with message 'Authorization error'
when authorization fails, not 'Authorization required'.
* Trigger CI: Code analysis confirms implementation is correct
- Policy correctly restricts permanentDelete to team admins only
- Test implementation follows established patterns and expects correct error message
- Linting and TypeScript compilation pass successfully
- Issue appears to be environmental rather than code-related
* Clean up temporary CI trigger file
* Fix failing tests after restricting permanent delete to admins
- Update tests to expect permanentDelete ability to be false for regular users
- Add test to verify admin users still have permanentDelete abilities
- This aligns with the policy changes that restrict permanent deletion to team admins only
---------
Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Some OIDC providers return 401 Unauthorized errors with an empty body
when the access token has expired.
Avoid trying to parse the body as JSON before we've checked whether the
status code is OK.
Fixes#10251.
- Added originalDocumentId property to SourceMetadata type
- Updated documentDuplicator to set originalDocumentId for both parent and child documents
- Added comprehensive tests to verify the functionality works correctly
- Preserves existing sourceMetadata while adding the new property
Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
* fix: New Dutch translations from Crowdin [ci skip]
* fix: New Italian translations from Crowdin [ci skip]
* fix: New Italian translations from Crowdin [ci skip]
* fix: New Korean translations from Crowdin [ci skip]
* fix: New German translations from Crowdin [ci skip]
* fix: New Chinese Simplified translations from Crowdin [ci skip]
* Fix foreign key constraint error for shares.collectionId
- Add migration to update shares_collectionId_fkey constraint with CASCADE delete
- This fixes the constraint violation when deleting collections that have associated shares
- Follows the same pattern as the existing shares_documentId_fkey cascade fix
Fixes#10185
* Simplify migration by removing unnecessary loop and constraint array
- Remove loop and constraintNames array since there's only one constraint
- Directly reference 'shares_collectionId_fkey' constraint name
- Keep the same functionality but with cleaner, simpler code
---------
Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
* Add TeamPreference to prevent document embedding
- Add PreventDocumentEmbedding enum value to TeamPreference
- Add default value (false) to maintain backward compatibility
- Update TeamPreferences interface with new boolean property
- Modify renderShare function to respect team preference
- When preference is true, X-Frame-Options header is kept to prevent iframe embedding
- When preference is false (default), X-Frame-Options is removed to allow embedding
* Add preventDocumentEmbedding to TeamsUpdateSchema
- Add preventDocumentEmbedding boolean field to the preferences object in TeamsUpdateSchema
- This allows the new TeamPreference to be modified through the API
- The existing teamUpdater function will automatically handle the new preference
- API responses will include the preference via the presentTeam function
---------
Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
* feat: use sourceMetadata column for collections in import processes
- Update ImportsProcessor to populate sourceMetadata with externalId, externalName, and createdByName for collections
- Add sourceMetadata to collection presenter for API responses
- Ensure collections follow same metadata methodology as documents during imports
Co-authored-by: Tom Moor <tom@getoutline.com>
* Update collection.ts
---------
Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
* fix: New French translations from Crowdin [ci skip]
* fix: New Hebrew translations from Crowdin [ci skip]
* fix: New Hungarian translations from Crowdin [ci skip]
* fix: New Polish translations from Crowdin [ci skip]
* fix: New Korean translations from Crowdin [ci skip]
* fix: New German translations from Crowdin [ci skip]
* fix: New Romanian translations from Crowdin [ci skip]
* fix: New Spanish translations from Crowdin [ci skip]
* fix: New Czech translations from Crowdin [ci skip]
* fix: New Danish translations from Crowdin [ci skip]
* fix: New Italian translations from Crowdin [ci skip]
* fix: New Japanese translations from Crowdin [ci skip]
* fix: New Dutch translations from Crowdin [ci skip]
* fix: New Portuguese translations from Crowdin [ci skip]
* fix: New Swedish translations from Crowdin [ci skip]
* fix: New Turkish translations from Crowdin [ci skip]
* fix: New Ukrainian translations from Crowdin [ci skip]
* fix: New Chinese Simplified translations from Crowdin [ci skip]
* fix: New Chinese Traditional translations from Crowdin [ci skip]
* fix: New Vietnamese translations from Crowdin [ci skip]
* fix: New Portuguese, Brazilian translations from Crowdin [ci skip]
* fix: New Indonesian translations from Crowdin [ci skip]
* fix: New Persian translations from Crowdin [ci skip]
* fix: New Thai translations from Crowdin [ci skip]
* fix: New English, United Kingdom translations from Crowdin [ci skip]
* fix: New Norwegian Bokmal translations from Crowdin [ci skip]
* fix: New Norwegian Bokmal translations from Crowdin [ci skip]
* fix: New Korean translations from Crowdin [ci skip]
* fix: New French translations from Crowdin [ci skip]
* fix: New Hebrew translations from Crowdin [ci skip]
* fix: New Hungarian translations from Crowdin [ci skip]
* fix: New Polish translations from Crowdin [ci skip]
* fix: New Korean translations from Crowdin [ci skip]
* fix: New German translations from Crowdin [ci skip]
* fix: New Romanian translations from Crowdin [ci skip]
* fix: New Spanish translations from Crowdin [ci skip]
* fix: New Czech translations from Crowdin [ci skip]
* fix: New Danish translations from Crowdin [ci skip]
* fix: New Italian translations from Crowdin [ci skip]
* fix: New Japanese translations from Crowdin [ci skip]
* fix: New Dutch translations from Crowdin [ci skip]
* fix: New Portuguese translations from Crowdin [ci skip]
* fix: New Swedish translations from Crowdin [ci skip]
* fix: New Turkish translations from Crowdin [ci skip]
* fix: New Ukrainian translations from Crowdin [ci skip]
* fix: New Chinese Simplified translations from Crowdin [ci skip]
* fix: New Chinese Traditional translations from Crowdin [ci skip]
* fix: New Vietnamese translations from Crowdin [ci skip]
* fix: New Portuguese, Brazilian translations from Crowdin [ci skip]
* fix: New Indonesian translations from Crowdin [ci skip]
* fix: New Persian translations from Crowdin [ci skip]
* fix: New Thai translations from Crowdin [ci skip]
* fix: New English, United Kingdom translations from Crowdin [ci skip]
* fix: New Norwegian Bokmal translations from Crowdin [ci skip]
* fix: New French translations from Crowdin [ci skip]
* fix: New Hebrew translations from Crowdin [ci skip]
* fix: New Hungarian translations from Crowdin [ci skip]
* fix: New Polish translations from Crowdin [ci skip]
* fix: New Korean translations from Crowdin [ci skip]
* fix: New German translations from Crowdin [ci skip]
* fix: New Romanian translations from Crowdin [ci skip]
* fix: New Spanish translations from Crowdin [ci skip]
* fix: New Czech translations from Crowdin [ci skip]
* fix: New Danish translations from Crowdin [ci skip]
* fix: New Italian translations from Crowdin [ci skip]
* fix: New Japanese translations from Crowdin [ci skip]
* fix: New Dutch translations from Crowdin [ci skip]
* fix: New Portuguese translations from Crowdin [ci skip]
* fix: New Swedish translations from Crowdin [ci skip]
* fix: New Turkish translations from Crowdin [ci skip]
* fix: New Ukrainian translations from Crowdin [ci skip]
* fix: New Chinese Simplified translations from Crowdin [ci skip]
* fix: New Chinese Traditional translations from Crowdin [ci skip]
* fix: New Vietnamese translations from Crowdin [ci skip]
* fix: New Portuguese, Brazilian translations from Crowdin [ci skip]
* fix: New Indonesian translations from Crowdin [ci skip]
* fix: New Persian translations from Crowdin [ci skip]
* fix: New Thai translations from Crowdin [ci skip]
* fix: New English, United Kingdom translations from Crowdin [ci skip]
* fix: New Norwegian Bokmal translations from Crowdin [ci skip]
* fix: New French translations from Crowdin [ci skip]
* fix: New Romanian translations from Crowdin [ci skip]
* fix: New Spanish translations from Crowdin [ci skip]
* fix: New Czech translations from Crowdin [ci skip]
* fix: New Hebrew translations from Crowdin [ci skip]
* fix: New Hungarian translations from Crowdin [ci skip]
* fix: New Polish translations from Crowdin [ci skip]
* fix: New Korean translations from Crowdin [ci skip]
* fix: New German translations from Crowdin [ci skip]
* fix: New Danish translations from Crowdin [ci skip]
* fix: New Italian translations from Crowdin [ci skip]
* fix: New Japanese translations from Crowdin [ci skip]
* fix: New Dutch translations from Crowdin [ci skip]
* fix: New Portuguese translations from Crowdin [ci skip]
* fix: New Swedish translations from Crowdin [ci skip]
* fix: New Turkish translations from Crowdin [ci skip]
* fix: New Ukrainian translations from Crowdin [ci skip]
* fix: New Chinese Simplified translations from Crowdin [ci skip]
* fix: New Chinese Traditional translations from Crowdin [ci skip]
* fix: New Vietnamese translations from Crowdin [ci skip]
* fix: New Portuguese, Brazilian translations from Crowdin [ci skip]
* fix: New Indonesian translations from Crowdin [ci skip]
* fix: New Persian translations from Crowdin [ci skip]
* fix: New Thai translations from Crowdin [ci skip]
* fix: New English, United Kingdom translations from Crowdin [ci skip]
* fix: New Norwegian Bokmal translations from Crowdin [ci skip]
* fix: New German translations from Crowdin [ci skip]
* fix: New French translations from Crowdin [ci skip]
* fix: New Hebrew translations from Crowdin [ci skip]
* fix: New Hungarian translations from Crowdin [ci skip]
* fix: New Polish translations from Crowdin [ci skip]
* fix: New Korean translations from Crowdin [ci skip]
* fix: New German translations from Crowdin [ci skip]
* fix: New Romanian translations from Crowdin [ci skip]
* fix: New Spanish translations from Crowdin [ci skip]
* fix: New Czech translations from Crowdin [ci skip]
* fix: New Danish translations from Crowdin [ci skip]
* fix: New Italian translations from Crowdin [ci skip]
* fix: New Japanese translations from Crowdin [ci skip]
* fix: New Dutch translations from Crowdin [ci skip]
* fix: New Portuguese translations from Crowdin [ci skip]
* fix: New Swedish translations from Crowdin [ci skip]
* fix: New Turkish translations from Crowdin [ci skip]
* fix: New Ukrainian translations from Crowdin [ci skip]
* fix: New Chinese Simplified translations from Crowdin [ci skip]
* fix: New Chinese Traditional translations from Crowdin [ci skip]
* fix: New Vietnamese translations from Crowdin [ci skip]
* fix: New Portuguese, Brazilian translations from Crowdin [ci skip]
* fix: New Indonesian translations from Crowdin [ci skip]
* fix: New Persian translations from Crowdin [ci skip]
* fix: New Thai translations from Crowdin [ci skip]
* fix: New English, United Kingdom translations from Crowdin [ci skip]
* fix: New Norwegian Bokmal translations from Crowdin [ci skip]
* fix: New Norwegian Bokmal translations from Crowdin [ci skip]
* fix: New Dutch translations from Crowdin [ci skip]
* fix: New Chinese Simplified translations from Crowdin [ci skip]
* fix: New Chinese Simplified translations from Crowdin [ci skip]
* fix: New Chinese Simplified translations from Crowdin [ci skip]
* fix: New Chinese Simplified translations from Crowdin [ci skip]
* fix: New Chinese Simplified translations from Crowdin [ci skip]
* fix: New German translations from Crowdin [ci skip]
* fix: New Swedish translations from Crowdin [ci skip]
* fix: New French translations from Crowdin [ci skip]
* fix: New Hebrew translations from Crowdin [ci skip]
* fix: New Hungarian translations from Crowdin [ci skip]
* fix: New Polish translations from Crowdin [ci skip]
* fix: New Korean translations from Crowdin [ci skip]
* fix: New German translations from Crowdin [ci skip]
* fix: New Romanian translations from Crowdin [ci skip]
* fix: New Spanish translations from Crowdin [ci skip]
* fix: New Czech translations from Crowdin [ci skip]
* fix: New Danish translations from Crowdin [ci skip]
* fix: New Italian translations from Crowdin [ci skip]
* fix: New Japanese translations from Crowdin [ci skip]
* fix: New Dutch translations from Crowdin [ci skip]
* fix: New Portuguese translations from Crowdin [ci skip]
* fix: New Swedish translations from Crowdin [ci skip]
* fix: New Turkish translations from Crowdin [ci skip]
* fix: New Ukrainian translations from Crowdin [ci skip]
* fix: New Chinese Simplified translations from Crowdin [ci skip]
* fix: New Chinese Traditional translations from Crowdin [ci skip]
* fix: New Vietnamese translations from Crowdin [ci skip]
* fix: New Portuguese, Brazilian translations from Crowdin [ci skip]
* fix: New Indonesian translations from Crowdin [ci skip]
* fix: New Persian translations from Crowdin [ci skip]
* fix: New Thai translations from Crowdin [ci skip]
* fix: New English, United Kingdom translations from Crowdin [ci skip]
* fix: New Norwegian Bokmal translations from Crowdin [ci skip]
* fix: New Turkish translations from Crowdin [ci skip]
* fix: New Ukrainian translations from Crowdin [ci skip]
This adds the sourceMetadata column to the collections table to match
the one on documents. The column is defined as JSONB and allows null values.
Changes:
- Added migration to create sourceMetadata column on collections table
- Added sourceMetadata field to Collection model with SourceMetadata type
- Imported SourceMetadata type in Collection model
Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>