Skip to content

Commit

Permalink
Included KClip router and generated OpenAPI types
Browse files Browse the repository at this point in the history
  • Loading branch information
Winston-Hsiao committed Nov 20, 2024
1 parent 8243c72 commit 9e4e50b
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 2 deletions.
159 changes: 159 additions & 0 deletions frontend/src/gen/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,40 @@ export interface paths {
patch?: never;
trace?: never;
};
"/kclips/create": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/** Create Kclip */
post: operations["create_kclip_kclips_create_post"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/kclips/{kclip_id}/complete": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/** Complete Upload */
post: operations["complete_upload_kclips__kclip_id__complete_post"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
}
export type webhooks = Record<string, never>;
export interface components {
Expand Down Expand Up @@ -1350,6 +1384,20 @@ export interface components {
/** Client Id */
client_id: string;
};
/** CompletedKClipUploadRequest */
CompletedKClipUploadRequest: {
/** Kclip Id */
kclip_id: string;
/** Upload Id */
upload_id: string;
/** Parts */
parts: components["schemas"]["KClipPartCompleted"][];
};
/** CompletedKClipUploadResponse */
CompletedKClipUploadResponse: {
/** Status */
status: string;
};
/** CreateCheckoutSessionRequest */
CreateCheckoutSessionRequest: {
/** Listing Id */
Expand All @@ -1371,6 +1419,19 @@ export interface components {
/** Account Id */
account_id: string;
};
/** CreateKClipRequest */
CreateKClipRequest: {
/** Name */
name: string;
/** Robot Id */
robot_id: string;
/** Description */
description?: string | null;
/** File Size */
file_size?: number | null;
/** Part Size */
part_size?: number | null;
};
/** CreateRefundsRequest */
CreateRefundsRequest: {
/** Payment Intent Id */
Expand Down Expand Up @@ -1510,6 +1571,16 @@ export interface components {
/** Detail */
detail?: components["schemas"]["ValidationError"][];
};
/**
* KClipPartCompleted
* @description Represents a completed part in a multipart upload.
*/
KClipPartCompleted: {
/** Part Number */
part_number: number;
/** Etag */
etag: string;
};
/** KeysResponseItem */
KeysResponseItem: {
/** Token */
Expand Down Expand Up @@ -1660,6 +1731,22 @@ export interface components {
/** Token */
token: string;
};
/**
* MultipartUploadDetails
* @description Details needed for multipart upload.
*/
MultipartUploadDetails: {
/** Upload Id */
upload_id: string;
/** Presigned Urls */
presigned_urls: {
[key: string]: string | number;
}[];
/** Bucket */
bucket: string;
/** Key */
key: string;
};
/** MyUserInfoResponse */
MyUserInfoResponse: {
/** User Id */
Expand All @@ -1682,6 +1769,12 @@ export interface components {
bio: string | null;
stripe_connect: components["schemas"]["UserStripeConnect"] | null;
};
/** NewKClipResponse */
NewKClipResponse: {
/** Kclip Id */
kclip_id: string;
upload_details: components["schemas"]["MultipartUploadDetails"];
};
/** NewKeyRequest */
NewKeyRequest: {
/**
Expand Down Expand Up @@ -4374,4 +4467,70 @@ export interface operations {
};
};
};
create_kclip_kclips_create_post: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": components["schemas"]["CreateKClipRequest"];
};
};
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["NewKClipResponse"];
};
};
/** @description Validation Error */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["HTTPValidationError"];
};
};
};
};
complete_upload_kclips__kclip_id__complete_post: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": components["schemas"]["CompletedKClipUploadRequest"];
};
};
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["CompletedKClipUploadResponse"];
};
};
/** @description Validation Error */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["HTTPValidationError"];
};
};
};
};
}
2 changes: 1 addition & 1 deletion store/app/crud/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
Literal,
Self,
Sequence,
TypedDict,
TypeVar,
overload,
)
Expand All @@ -26,6 +25,7 @@
CompletedPartTypeDef,
CreateMultipartUploadOutputTypeDef,
)
from typing_extensions import TypedDict

from store.app.errors import InternalError, ItemNotFoundError
from store.app.model import StoreBaseModel
Expand Down
2 changes: 1 addition & 1 deletion store/app/crud/kclips.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Defines the CRUD interface for handling user-uploaded KClips."""

from typing import TypedDict
from typing_extensions import TypedDict

from store.app.crud.base import BaseCrud, MultipartUploadDetails, MultipartUploadPart
from store.app.model import KClip
Expand Down
2 changes: 2 additions & 0 deletions store/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
)
from store.app.routers.artifacts import router as artifacts_router
from store.app.routers.auth import router as auth_router
from store.app.routers.kclips import router as kclips_router
from store.app.routers.keys import router as keys_router
from store.app.routers.listings import router as listings_router
from store.app.routers.onshape import router as onshape_router
Expand Down Expand Up @@ -189,6 +190,7 @@ async def validate_auth_token(auth_token: str = Depends(api_key_header)) -> str:
app.include_router(stripe_router, prefix="/stripe", tags=["stripe"])
app.include_router(users_router, prefix="/users", tags=["users"])
app.include_router(teleop_router, prefix="/teleop", tags=["teleop"])
app.include_router(kclips_router, prefix="/kclips", tags=["kclips"])

# For running with debugger
if __name__ == "__main__":
Expand Down

0 comments on commit 9e4e50b

Please sign in to comment.