refactor(server, web): create shared link (#2879)

* refactor: shared links

* chore: open api

* fix: tsc error
This commit is contained in:
Jason Rasmussen
2023-06-20 21:08:43 -04:00
committed by GitHub
parent 746ca5d5ed
commit 868f629f32
61 changed files with 2150 additions and 2642 deletions

View File

@@ -127,48 +127,6 @@
]
}
},
"/album/create-shared-link": {
"post": {
"operationId": "createAlbumSharedLink",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateAlbumShareLinkDto"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SharedLinkResponseDto"
}
}
}
}
},
"tags": [
"Album"
],
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
]
}
},
"/album/{id}": {
"patch": {
"operationId": "updateAlbumInfo",
@@ -1660,150 +1618,6 @@
]
}
},
"/asset/shared-link": {
"post": {
"operationId": "createAssetsSharedLink",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateAssetsShareLinkDto"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SharedLinkResponseDto"
}
}
}
}
},
"tags": [
"Asset"
],
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
]
}
},
"/asset/shared-link/add": {
"patch": {
"operationId": "addAssetsToSharedLink",
"parameters": [
{
"name": "key",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AddAssetsDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SharedLinkResponseDto"
}
}
}
}
},
"tags": [
"Asset"
],
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
]
}
},
"/asset/shared-link/remove": {
"patch": {
"operationId": "removeAssetsFromSharedLink",
"parameters": [
{
"name": "key",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RemoveAssetsDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SharedLinkResponseDto"
}
}
}
}
},
"tags": [
"Asset"
],
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
]
}
},
"/asset/stat/archive": {
"get": {
"operationId": "getArchivedAssetCountByUserId",
@@ -3264,7 +3078,7 @@
]
}
},
"/share": {
"/shared-link": {
"get": {
"operationId": "getAllSharedLinks",
"parameters": [],
@@ -3284,7 +3098,47 @@
}
},
"tags": [
"share"
"Shared Link"
],
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
]
},
"post": {
"operationId": "createSharedLink",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SharedLinkCreateDto"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SharedLinkResponseDto"
}
}
}
}
},
"tags": [
"Shared Link"
],
"security": [
{
@@ -3299,7 +3153,7 @@
]
}
},
"/share/me": {
"/shared-link/me": {
"get": {
"operationId": "getMySharedLink",
"parameters": [
@@ -3325,7 +3179,7 @@
}
},
"tags": [
"share"
"Shared Link"
],
"security": [
{
@@ -3340,7 +3194,7 @@
]
}
},
"/share/{id}": {
"/shared-link/{id}": {
"get": {
"operationId": "getSharedLinkById",
"parameters": [
@@ -3367,7 +3221,7 @@
}
},
"tags": [
"share"
"Shared Link"
],
"security": [
{
@@ -3399,7 +3253,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EditSharedLinkDto"
"$ref": "#/components/schemas/SharedLinkEditDto"
}
}
}
@@ -3417,7 +3271,7 @@
}
},
"tags": [
"share"
"Shared Link"
],
"security": [
{
@@ -3450,7 +3304,131 @@
}
},
"tags": [
"share"
"Shared Link"
],
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
]
}
},
"/shared-link/{id}/assets": {
"put": {
"operationId": "addSharedLinkAssets",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
},
{
"name": "key",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AssetIdsDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AssetIdsResponseDto"
}
}
}
}
}
},
"tags": [
"Shared Link"
],
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
]
},
"delete": {
"operationId": "removeSharedLinkAssets",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
},
{
"name": "key",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AssetIdsDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AssetIdsResponseDto"
}
}
}
}
}
},
"tags": [
"Shared Link"
],
"security": [
{
@@ -5089,34 +5067,6 @@
"albumName"
]
},
"CreateAlbumShareLinkDto": {
"type": "object",
"properties": {
"albumId": {
"type": "string",
"format": "uuid"
},
"expiresAt": {
"format": "date-time",
"type": "string"
},
"allowUpload": {
"type": "boolean"
},
"allowDownload": {
"type": "boolean"
},
"showExif": {
"type": "boolean"
},
"description": {
"type": "string"
}
},
"required": [
"albumId"
]
},
"CreateAssetDto": {
"type": "object",
"properties": {
@@ -5176,42 +5126,6 @@
"fileExtension"
]
},
"CreateAssetsShareLinkDto": {
"type": "object",
"properties": {
"assetIds": {
"title": "Array asset IDs to be shared",
"example": [
"bf973405-3f2a-48d2-a687-2ed4167164be",
"dd41870b-5d00-46d2-924e-1d8489a0aa0f",
"fad77c3f-deef-4e7e-9608-14c1aa4e559a"
],
"type": "array",
"items": {
"type": "string"
}
},
"expiresAt": {
"format": "date-time",
"type": "string"
},
"allowUpload": {
"type": "boolean"
},
"allowDownload": {
"type": "boolean"
},
"showExif": {
"type": "boolean"
},
"description": {
"type": "string"
}
},
"required": [
"assetIds"
]
},
"CreateProfileImageDto": {
"type": "object",
"properties": {
@@ -5392,28 +5306,6 @@
"assetIds"
]
},
"EditSharedLinkDto": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"expiresAt": {
"format": "date-time",
"type": "string",
"nullable": true
},
"allowUpload": {
"type": "boolean"
},
"allowDownload": {
"type": "boolean"
},
"showExif": {
"type": "boolean"
}
}
},
"ExifResponseDto": {
"type": "object",
"properties": {
@@ -6160,6 +6052,71 @@
"patch"
]
},
"SharedLinkCreateDto": {
"type": "object",
"properties": {
"type": {
"$ref": "#/components/schemas/SharedLinkType"
},
"assetIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"albumId": {
"type": "string",
"format": "uuid"
},
"description": {
"type": "string"
},
"expiresAt": {
"format": "date-time",
"type": "string",
"nullable": true,
"default": null
},
"allowUpload": {
"type": "boolean",
"default": false
},
"allowDownload": {
"type": "boolean",
"default": true
},
"showExif": {
"type": "boolean",
"default": true
}
},
"required": [
"type"
]
},
"SharedLinkEditDto": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"expiresAt": {
"format": "date-time",
"type": "string",
"nullable": true
},
"allowUpload": {
"type": "boolean"
},
"allowDownload": {
"type": "boolean"
},
"showExif": {
"type": "boolean"
}
}
},
"SharedLinkResponseDto": {
"type": "object",
"properties": {
@@ -6170,7 +6127,8 @@
"type": "string"
},
"description": {
"type": "string"
"type": "string",
"nullable": true
},
"userId": {
"type": "string"
@@ -6209,6 +6167,7 @@
"required": [
"type",
"id",
"description",
"userId",
"key",
"createdAt",