feat: add responses package
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||
|
||||
export type CloseUploadSessionResponse = MinimalHttpResponse & {
|
||||
success: boolean
|
||||
message: string
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export type CreateValetTokenPayload = {
|
||||
operation: 'read' | 'write' | 'delete'
|
||||
resources: Array<{
|
||||
remoteIdentifier: string
|
||||
unencryptedFileSize?: number
|
||||
}>
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||
import { CreateValetTokenResponseData } from './CreateValetTokenResponseData'
|
||||
|
||||
export type CreateValetTokenResponse = MinimalHttpResponse & {
|
||||
data: CreateValetTokenResponseData
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export type CreateValetTokenResponseData =
|
||||
| {
|
||||
success: true
|
||||
valetToken: string
|
||||
}
|
||||
| {
|
||||
success: false
|
||||
reason: 'no-subscription' | 'expired-subscription' | 'invalid-parameters'
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||
|
||||
export type DownloadFileChunkResponse = MinimalHttpResponse & {
|
||||
data: ArrayBuffer
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||
|
||||
export type StartUploadSessionResponse = MinimalHttpResponse & {
|
||||
success: boolean
|
||||
uploadId: string
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||
|
||||
export type UploadFileChunkResponse = MinimalHttpResponse & {
|
||||
success: boolean
|
||||
}
|
||||
Reference in New Issue
Block a user