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

supabase / storage / 25738155938

12 May 2026 01:38PM UTC coverage: 39.251% (-35.1%) from 74.366%
25738155938

Pull #1094

github

web-flow
Merge 0f3efcca0 into defbbb616
Pull Request #1094: feat: embedded vector store

2188 of 6152 branches covered (35.57%)

Branch coverage included in aggregate %.

88 of 280 new or added lines in 6 files covered. (31.43%)

3689 existing lines in 165 files now uncovered.

4312 of 10408 relevant lines covered (41.43%)

34.74 hits per line

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

13.33
/src/http/routes/object/updateObject.ts
1
import fastifyMultipart from '@fastify/multipart'
2
import { FastifyInstance, RequestGenericInterface } from 'fastify'
3
import { FromSchema } from 'json-schema-to-ts'
4
import { createDefaultSchema } from '../../routes-helper'
5
import { ROUTE_OPERATIONS } from '../operations'
6

7
const updateObjectParamsSchema = {
2✔
8
  type: 'object',
9
  properties: {
10
    bucketName: { type: 'string', examples: ['avatars'] },
11
    '*': { type: 'string', examples: ['folder/cat.png'] },
12
  },
13
  required: ['bucketName', '*'],
14
} as const
15
const successResponseSchema = {
2✔
16
  type: 'object',
17
  properties: {
18
    Id: {
19
      type: 'string',
20
    },
21
    Key: { type: 'string', examples: ['avatars/folder/cat.png'] },
22
  },
23
  required: ['Key'],
24
}
25
interface updateObjectRequestInterface extends RequestGenericInterface {
26
  Params: FromSchema<typeof updateObjectParamsSchema>
27
  Headers: {
28
    authorization: string
29
    'content-type': string
30
    'cache-control'?: string
31
    'x-upsert'?: string
32
    'x-robots-tag'?: string
33
  }
34
}
35

36
export default async function routes(fastify: FastifyInstance) {
UNCOV
37
  const summary = 'Update the object at an existing key'
×
38

UNCOV
39
  const schema = createDefaultSchema(successResponseSchema, {
×
40
    params: updateObjectParamsSchema,
41
    summary,
42
    tags: ['object'],
43
  })
44

UNCOV
45
  fastify.register(fastifyMultipart, {
×
46
    limits: {
47
      fields: 10,
48
      files: 1,
49
    },
50
    throwFileSizeLimit: false,
51
  })
52

UNCOV
53
  fastify.addContentTypeParser(
×
54
    ['application/json', 'text/plain'],
55
    function (request, payload, done) {
56
      done(null)
×
57
    }
58
  )
59

UNCOV
60
  fastify.put<updateObjectRequestInterface>(
×
61
    '/:bucketName/*',
62
    {
63
      schema,
64
      config: {
65
        operation: { type: ROUTE_OPERATIONS.UPDATE_OBJECT },
66
      },
67
    },
68
    async (request, response) => {
UNCOV
69
      const { bucketName } = request.params
×
UNCOV
70
      const objectName = request.params['*']
×
UNCOV
71
      const owner = request.owner as string
×
72

UNCOV
73
      const { objectMetadata, path, id } = await request.storage
×
74
        .from(bucketName)
75
        .uploadFromRequest(request, {
76
          objectName,
77
          signal: request.signals.body.signal,
78
          owner,
79
          isUpsert: true,
80
        })
81

UNCOV
82
      return response.status(objectMetadata?.httpStatusCode ?? 200).send({
×
83
        Id: id,
84
        Key: path,
85
      })
86
    }
87
  )
88
}
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