• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / storage / 26213785588

21 May 2026 08:08AM UTC coverage: 40.286% (-34.7%) from 74.992%
26213785588

Pull #1118

github

web-flow
Merge fcbe53820 into 322ab2ebb
Pull Request #1118: fix: single callback for memory collector

2182 of 5969 branches covered (36.56%)

Branch coverage included in aggregate %.

15 of 15 new or added lines in 2 files covered. (100.0%)

3727 existing lines in 166 files now uncovered.

4335 of 10208 relevant lines covered (42.47%)

35.26 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

13.33
/src/http/routes/object/moveObject.ts
1
import { FastifyInstance, FastifyRequest } from 'fastify'
2
import { FromSchema } from 'json-schema-to-ts'
3
import { createDefaultSchema } from '../../routes-helper'
4
import { AuthenticatedRequest } from '../../types'
5
import { ROUTE_OPERATIONS } from '../operations'
6

7
const moveObjectsBodySchema = {
2✔
8
  type: 'object',
9
  properties: {
10
    bucketId: { type: 'string', examples: ['avatars'] },
11
    sourceKey: { type: 'string', examples: ['folder/cat.png'] },
12
    destinationBucket: { type: 'string', examples: ['users'] },
13
    destinationKey: { type: 'string', examples: ['folder/newcat.png'] },
14
  },
15
  required: ['bucketId', 'sourceKey', 'destinationKey'],
16
} as const
17
const successResponseSchema = {
2✔
18
  type: 'object',
19
  properties: {
20
    message: { type: 'string', examples: ['Successfully moved'] },
21
  },
22
  required: ['message'],
23
}
24
interface moveObjectRequestInterface extends AuthenticatedRequest {
25
  Body: FromSchema<typeof moveObjectsBodySchema>
26
}
27

28
export default async function routes(fastify: FastifyInstance) {
UNCOV
29
  const summary = 'Moves an object'
×
30

UNCOV
31
  const schema = createDefaultSchema(successResponseSchema, {
×
32
    body: moveObjectsBodySchema,
33
    summary,
34
    tags: ['object'],
35
  })
36

UNCOV
37
  fastify.post<moveObjectRequestInterface>(
×
38
    '/move',
39
    {
40
      schema,
41
      config: {
42
        operation: { type: ROUTE_OPERATIONS.MOVE_OBJECT },
43
        resources: (req: FastifyRequest<moveObjectRequestInterface>) => {
UNCOV
44
          const { sourceKey, destinationKey, bucketId, destinationBucket } = req.body
×
UNCOV
45
          return [`${bucketId}/${sourceKey}`, `${destinationBucket || bucketId}/${destinationKey}`]
×
46
        },
47
      },
48
    },
49
    async (request, response) => {
UNCOV
50
      const { destinationKey, sourceKey, bucketId, destinationBucket } = request.body
×
51

UNCOV
52
      const destinationBucketId = destinationBucket || bucketId
×
53

UNCOV
54
      const move = await request.storage
×
55
        .from(bucketId)
56
        .moveObject(sourceKey, destinationBucketId, destinationKey, 'standard', request.owner)
57

UNCOV
58
      return response.status(200).send({
×
59
        message: 'Successfully moved',
60
        Id: move.destObject.id,
61
        Key: move.destObject.name,
62
      })
63
    }
64
  )
65
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc