@uniformdev/files
Advanced tools
+90
-2
@@ -33,2 +33,3 @@ import { ApiClient, ClientOptions } from '@uniformdev/context/api'; | ||
| "application/json": { | ||
| /** Format: uuid */ | ||
| id: string; | ||
@@ -42,2 +43,4 @@ state: number; | ||
| sourceId?: string; | ||
| /** Format: date-time */ | ||
| expiresAt?: string; | ||
| }; | ||
@@ -72,5 +75,8 @@ }; | ||
| "application/json": { | ||
| /** Format: uuid */ | ||
| id?: string; | ||
| /** Format: uuid */ | ||
| projectId?: string; | ||
| sourceId?: string; | ||
| /** Format: uuid */ | ||
| teamId?: string; | ||
@@ -82,2 +88,7 @@ name: string; | ||
| height?: number; | ||
| /** | ||
| * Format: date-time | ||
| * @description Optional expiry time for temporary uploads. If set, and the file is not attached to an asset at that time, it will be automatically deleted. | ||
| */ | ||
| expiresAt?: string; | ||
| }; | ||
@@ -94,2 +105,3 @@ }; | ||
| "application/json": { | ||
| /** Format: uuid */ | ||
| id: string; | ||
@@ -130,2 +142,3 @@ uploadUrl: string; | ||
| sourceId?: string; | ||
| /** Format: uuid */ | ||
| projectId?: string; | ||
@@ -143,2 +156,3 @@ }; | ||
| "application/json": { | ||
| /** Format: uuid */ | ||
| id: string; | ||
@@ -164,3 +178,60 @@ }; | ||
| head?: never; | ||
| patch?: never; | ||
| /** @description Replaces a file while preserving the existing URL */ | ||
| patch: { | ||
| parameters: { | ||
| query?: never; | ||
| header?: never; | ||
| path?: never; | ||
| cookie?: never; | ||
| }; | ||
| requestBody: { | ||
| content: { | ||
| "application/json": { | ||
| /** Format: uuid */ | ||
| projectId: string; | ||
| /** Format: uuid */ | ||
| existingFileId: string; | ||
| /** Format: uuid */ | ||
| replacementFileId: string; | ||
| }; | ||
| }; | ||
| }; | ||
| responses: { | ||
| /** @description 200 response */ | ||
| 200: { | ||
| headers: { | ||
| [name: string]: unknown; | ||
| }; | ||
| content: { | ||
| "application/json": { | ||
| /** Format: uuid */ | ||
| id: string; | ||
| state: number; | ||
| url?: string; | ||
| name: string; | ||
| mediaType: string; | ||
| metadata?: unknown; | ||
| size: number; | ||
| sourceId?: string; | ||
| /** Format: date-time */ | ||
| expiresAt?: string; | ||
| /** Format: uuid */ | ||
| deletedReplacementFileId?: string; | ||
| }; | ||
| }; | ||
| }; | ||
| 400: components["responses"]["BadRequestError"]; | ||
| 401: components["responses"]["UnauthorizedError"]; | ||
| 403: components["responses"]["ForbiddenError"]; | ||
| /** @description 404 response */ | ||
| 404: { | ||
| headers: { | ||
| [name: string]: unknown; | ||
| }; | ||
| content?: never; | ||
| }; | ||
| 429: components["responses"]["RateLimitError"]; | ||
| 500: components["responses"]["InternalServerError"]; | ||
| }; | ||
| }; | ||
| trace?: never; | ||
@@ -229,2 +300,4 @@ }; | ||
| type FileDeleteResponse = paths['/api/v1/files']['delete']['responses']['200']['content']['application/json']; | ||
| type FileReplaceRequest = paths['/api/v1/files']['patch']['requestBody']['content']['application/json']; | ||
| type FileReplaceResponse = paths['/api/v1/files']['patch']['responses']['200']['content']['application/json']; | ||
| type FileGetRequest = Required<paths['/api/v1/files']['get']['parameters']>['query']; | ||
@@ -252,2 +325,17 @@ type FileGetByIDRequest = Pick<FileGetRequest, 'id'>; | ||
| }>; | ||
| /** | ||
| * Replaces the contents behind an existing file while preserving its URL. | ||
| */ | ||
| replace(options: WithoutProjectId<FileReplaceRequest>): Promise<{ | ||
| id: string; | ||
| state: number; | ||
| url?: string; | ||
| name: string; | ||
| mediaType: string; | ||
| metadata?: unknown; | ||
| size: number; | ||
| sourceId?: string; | ||
| expiresAt?: string; | ||
| deletedReplacementFileId?: string; | ||
| }>; | ||
| } | ||
@@ -279,2 +367,2 @@ declare class UncachedFileClient extends FileClient { | ||
| export { FILE_IN_PROGRESS_STATE, FILE_MAX_SIZE, FILE_MIME_TYPES_ALL, FILE_MIME_TYPES_AUDIO, FILE_MIME_TYPES_IMAGE, FILE_MIME_TYPES_OTHER, FILE_MIME_TYPES_VIDEO, FILE_READY_STATE, FILE_TYPES_ALL, FILE_TYPES_AUDIO, FILE_TYPES_IMAGE, FILE_TYPES_OTHER, FILE_TYPES_VIDEO, FileClient, type FileDeleteRequest, type FileDeleteResponse, type FileGetByIDRequest, type FileGetBySourceIDRequest, type FileGetByURLRequest, type FileGetRequest, type FileGetResponse, type FileInsertRequest, type FileInsertResponse, UncachedFileClient, getFileNameFromUrl }; | ||
| export { FILE_IN_PROGRESS_STATE, FILE_MAX_SIZE, FILE_MIME_TYPES_ALL, FILE_MIME_TYPES_AUDIO, FILE_MIME_TYPES_IMAGE, FILE_MIME_TYPES_OTHER, FILE_MIME_TYPES_VIDEO, FILE_READY_STATE, FILE_TYPES_ALL, FILE_TYPES_AUDIO, FILE_TYPES_IMAGE, FILE_TYPES_OTHER, FILE_TYPES_VIDEO, FileClient, type FileDeleteRequest, type FileDeleteResponse, type FileGetByIDRequest, type FileGetBySourceIDRequest, type FileGetByURLRequest, type FileGetRequest, type FileGetResponse, type FileInsertRequest, type FileInsertResponse, type FileReplaceRequest, type FileReplaceResponse, UncachedFileClient, getFileNameFromUrl }; |
+90
-2
@@ -33,2 +33,3 @@ import { ApiClient, ClientOptions } from '@uniformdev/context/api'; | ||
| "application/json": { | ||
| /** Format: uuid */ | ||
| id: string; | ||
@@ -42,2 +43,4 @@ state: number; | ||
| sourceId?: string; | ||
| /** Format: date-time */ | ||
| expiresAt?: string; | ||
| }; | ||
@@ -72,5 +75,8 @@ }; | ||
| "application/json": { | ||
| /** Format: uuid */ | ||
| id?: string; | ||
| /** Format: uuid */ | ||
| projectId?: string; | ||
| sourceId?: string; | ||
| /** Format: uuid */ | ||
| teamId?: string; | ||
@@ -82,2 +88,7 @@ name: string; | ||
| height?: number; | ||
| /** | ||
| * Format: date-time | ||
| * @description Optional expiry time for temporary uploads. If set, and the file is not attached to an asset at that time, it will be automatically deleted. | ||
| */ | ||
| expiresAt?: string; | ||
| }; | ||
@@ -94,2 +105,3 @@ }; | ||
| "application/json": { | ||
| /** Format: uuid */ | ||
| id: string; | ||
@@ -130,2 +142,3 @@ uploadUrl: string; | ||
| sourceId?: string; | ||
| /** Format: uuid */ | ||
| projectId?: string; | ||
@@ -143,2 +156,3 @@ }; | ||
| "application/json": { | ||
| /** Format: uuid */ | ||
| id: string; | ||
@@ -164,3 +178,60 @@ }; | ||
| head?: never; | ||
| patch?: never; | ||
| /** @description Replaces a file while preserving the existing URL */ | ||
| patch: { | ||
| parameters: { | ||
| query?: never; | ||
| header?: never; | ||
| path?: never; | ||
| cookie?: never; | ||
| }; | ||
| requestBody: { | ||
| content: { | ||
| "application/json": { | ||
| /** Format: uuid */ | ||
| projectId: string; | ||
| /** Format: uuid */ | ||
| existingFileId: string; | ||
| /** Format: uuid */ | ||
| replacementFileId: string; | ||
| }; | ||
| }; | ||
| }; | ||
| responses: { | ||
| /** @description 200 response */ | ||
| 200: { | ||
| headers: { | ||
| [name: string]: unknown; | ||
| }; | ||
| content: { | ||
| "application/json": { | ||
| /** Format: uuid */ | ||
| id: string; | ||
| state: number; | ||
| url?: string; | ||
| name: string; | ||
| mediaType: string; | ||
| metadata?: unknown; | ||
| size: number; | ||
| sourceId?: string; | ||
| /** Format: date-time */ | ||
| expiresAt?: string; | ||
| /** Format: uuid */ | ||
| deletedReplacementFileId?: string; | ||
| }; | ||
| }; | ||
| }; | ||
| 400: components["responses"]["BadRequestError"]; | ||
| 401: components["responses"]["UnauthorizedError"]; | ||
| 403: components["responses"]["ForbiddenError"]; | ||
| /** @description 404 response */ | ||
| 404: { | ||
| headers: { | ||
| [name: string]: unknown; | ||
| }; | ||
| content?: never; | ||
| }; | ||
| 429: components["responses"]["RateLimitError"]; | ||
| 500: components["responses"]["InternalServerError"]; | ||
| }; | ||
| }; | ||
| trace?: never; | ||
@@ -229,2 +300,4 @@ }; | ||
| type FileDeleteResponse = paths['/api/v1/files']['delete']['responses']['200']['content']['application/json']; | ||
| type FileReplaceRequest = paths['/api/v1/files']['patch']['requestBody']['content']['application/json']; | ||
| type FileReplaceResponse = paths['/api/v1/files']['patch']['responses']['200']['content']['application/json']; | ||
| type FileGetRequest = Required<paths['/api/v1/files']['get']['parameters']>['query']; | ||
@@ -252,2 +325,17 @@ type FileGetByIDRequest = Pick<FileGetRequest, 'id'>; | ||
| }>; | ||
| /** | ||
| * Replaces the contents behind an existing file while preserving its URL. | ||
| */ | ||
| replace(options: WithoutProjectId<FileReplaceRequest>): Promise<{ | ||
| id: string; | ||
| state: number; | ||
| url?: string; | ||
| name: string; | ||
| mediaType: string; | ||
| metadata?: unknown; | ||
| size: number; | ||
| sourceId?: string; | ||
| expiresAt?: string; | ||
| deletedReplacementFileId?: string; | ||
| }>; | ||
| } | ||
@@ -279,2 +367,2 @@ declare class UncachedFileClient extends FileClient { | ||
| export { FILE_IN_PROGRESS_STATE, FILE_MAX_SIZE, FILE_MIME_TYPES_ALL, FILE_MIME_TYPES_AUDIO, FILE_MIME_TYPES_IMAGE, FILE_MIME_TYPES_OTHER, FILE_MIME_TYPES_VIDEO, FILE_READY_STATE, FILE_TYPES_ALL, FILE_TYPES_AUDIO, FILE_TYPES_IMAGE, FILE_TYPES_OTHER, FILE_TYPES_VIDEO, FileClient, type FileDeleteRequest, type FileDeleteResponse, type FileGetByIDRequest, type FileGetBySourceIDRequest, type FileGetByURLRequest, type FileGetRequest, type FileGetResponse, type FileInsertRequest, type FileInsertResponse, UncachedFileClient, getFileNameFromUrl }; | ||
| export { FILE_IN_PROGRESS_STATE, FILE_MAX_SIZE, FILE_MIME_TYPES_ALL, FILE_MIME_TYPES_AUDIO, FILE_MIME_TYPES_IMAGE, FILE_MIME_TYPES_OTHER, FILE_MIME_TYPES_VIDEO, FILE_READY_STATE, FILE_TYPES_ALL, FILE_TYPES_AUDIO, FILE_TYPES_IMAGE, FILE_TYPES_OTHER, FILE_TYPES_VIDEO, FileClient, type FileDeleteRequest, type FileDeleteResponse, type FileGetByIDRequest, type FileGetBySourceIDRequest, type FileGetByURLRequest, type FileGetRequest, type FileGetResponse, type FileInsertRequest, type FileInsertResponse, type FileReplaceRequest, type FileReplaceResponse, UncachedFileClient, getFileNameFromUrl }; |
+11
-0
@@ -32,2 +32,13 @@ // src/FileClient.ts | ||
| } | ||
| /** | ||
| * Replaces the contents behind an existing file while preserving its URL. | ||
| */ | ||
| async replace(options) { | ||
| const { projectId } = this.options; | ||
| const fetchUri = this.createUrl(FILE_BASE_PATH); | ||
| return this.apiClient(fetchUri, { | ||
| method: "PATCH", | ||
| body: JSON.stringify({ ...options, projectId }) | ||
| }); | ||
| } | ||
| }; | ||
@@ -34,0 +45,0 @@ var UncachedFileClient = class extends FileClient { |
+11
-0
@@ -73,2 +73,13 @@ "use strict"; | ||
| } | ||
| /** | ||
| * Replaces the contents behind an existing file while preserving its URL. | ||
| */ | ||
| async replace(options) { | ||
| const { projectId } = this.options; | ||
| const fetchUri = this.createUrl(FILE_BASE_PATH); | ||
| return this.apiClient(fetchUri, { | ||
| method: "PATCH", | ||
| body: JSON.stringify({ ...options, projectId }) | ||
| }); | ||
| } | ||
| }; | ||
@@ -75,0 +86,0 @@ var UncachedFileClient = class extends FileClient { |
+11
-0
@@ -32,2 +32,13 @@ // src/FileClient.ts | ||
| } | ||
| /** | ||
| * Replaces the contents behind an existing file while preserving its URL. | ||
| */ | ||
| async replace(options) { | ||
| const { projectId } = this.options; | ||
| const fetchUri = this.createUrl(FILE_BASE_PATH); | ||
| return this.apiClient(fetchUri, { | ||
| method: "PATCH", | ||
| body: JSON.stringify({ ...options, projectId }) | ||
| }); | ||
| } | ||
| }; | ||
@@ -34,0 +45,0 @@ var UncachedFileClient = class extends FileClient { |
+4
-3
| { | ||
| "name": "@uniformdev/files", | ||
| "version": "20.50.2-alpha.96+3f982d48ba", | ||
| "version": "20.50.2-alpha.109+846837c66a", | ||
| "description": "Uniform Files helpers", | ||
@@ -9,2 +9,3 @@ "license": "SEE LICENSE IN LICENSE.txt", | ||
| "exports": { | ||
| "source": "./src/index.ts", | ||
| "import": { | ||
@@ -38,5 +39,5 @@ "types": "./dist/index.d.ts", | ||
| "dependencies": { | ||
| "@uniformdev/context": "20.50.2-alpha.96+3f982d48ba" | ||
| "@uniformdev/context": "20.50.2-alpha.109+846837c66a" | ||
| }, | ||
| "gitHead": "3f982d48baf7aad200f687938b7f2e7c8796f759" | ||
| "gitHead": "846837c66ad0f518683c100615b59b27f91498ba" | ||
| } |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
40553
25.95%771
18.8%