@uppy/utils
Advanced tools
Comparing version 6.0.0-beta.8 to 6.0.0-beta.9
@@ -0,1 +1,2 @@ | ||
import type { CompanionFile } from './CompanionFile.js'; | ||
export type RequestOptions = { | ||
@@ -26,3 +27,7 @@ method?: string; | ||
fetchPreAuthToken(): Promise<void>; | ||
list<ResBody>(directory: string | undefined, options: RequestOptions): Promise<ResBody>; | ||
list(directory: string | null, options: RequestOptions): Promise<{ | ||
username: string; | ||
nextPagePath: string | null; | ||
items: CompanionFile[]; | ||
}>; | ||
} | ||
@@ -29,0 +34,0 @@ export interface CompanionClientSearchProvider { |
@@ -6,3 +6,3 @@ /** | ||
id: string; | ||
name: string; | ||
name?: string; | ||
icon: string; | ||
@@ -9,0 +9,0 @@ type: string; |
@@ -1,3 +0,3 @@ | ||
declare const _default: any; | ||
declare const _default: (thisArg: any, ...argArray: any[]) => any; | ||
export default _default; | ||
//# sourceMappingURL=findIndex.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import type { MinimalRequiredUppyFile } from './UppyFile.js'; | ||
import type { MinimalRequiredUppyFile, UppyFile } from './UppyFile.js'; | ||
/** | ||
@@ -6,4 +6,4 @@ * Takes a file object and turns it into fileID, by converting file.name to lowercase, | ||
*/ | ||
export default function generateFileID(file: MinimalRequiredUppyFile<any, any>, instanceId: string): string; | ||
export declare function getSafeFileId(file: MinimalRequiredUppyFile<any, any>, instanceId: string): string; | ||
export default function generateFileID(file: Omit<MinimalRequiredUppyFile<any, any>, 'name'> & Pick<UppyFile<any, any>, 'name'>, instanceId: string): string; | ||
export declare function getSafeFileId(file: Omit<MinimalRequiredUppyFile<any, any>, 'name'> & Pick<UppyFile<any, any>, 'name'>, instanceId: string): string; | ||
//# sourceMappingURL=generateFileID.d.ts.map |
@@ -18,3 +18,3 @@ import type { FileProgress } from './FileProgress.js'; | ||
meta: InternalMetadata & M; | ||
name: string; | ||
name?: string; | ||
preview?: string; | ||
@@ -21,0 +21,0 @@ progress: FileProgress; |
{ | ||
"name": "@uppy/utils", | ||
"description": "Shared utility functions for Uppy Core and plugins maintained by the Uppy team.", | ||
"version": "6.0.0-beta.8", | ||
"version": "6.0.0-beta.9", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "type": "module", |
@@ -0,1 +1,3 @@ | ||
import type { CompanionFile } from './CompanionFile.js' | ||
export type RequestOptions = { | ||
@@ -27,6 +29,10 @@ method?: string | ||
fetchPreAuthToken(): Promise<void> | ||
list<ResBody>( | ||
directory: string | undefined, | ||
list( | ||
directory: string | null, | ||
options: RequestOptions, | ||
): Promise<ResBody> | ||
): Promise<{ | ||
username: string | ||
nextPagePath: string | null | ||
items: CompanionFile[] | ||
}> | ||
} | ||
@@ -33,0 +39,0 @@ export interface CompanionClientSearchProvider { |
@@ -6,3 +6,3 @@ /** | ||
id: string | ||
name: string | ||
name?: string | ||
/* | ||
@@ -9,0 +9,0 @@ * Url to the thumbnail icon |
@@ -1,2 +0,2 @@ | ||
import type { MinimalRequiredUppyFile } from './UppyFile.js' | ||
import type { MinimalRequiredUppyFile, UppyFile } from './UppyFile.js' | ||
import getFileType from './getFileType.ts' | ||
@@ -23,3 +23,4 @@ | ||
export default function generateFileID( | ||
file: MinimalRequiredUppyFile<any, any>, | ||
file: Omit<MinimalRequiredUppyFile<any, any>, 'name'> & | ||
Pick<UppyFile<any, any>, 'name'>, | ||
instanceId: string, | ||
@@ -55,3 +56,6 @@ ): string { | ||
// Then we don't have to generate our own ID, and we can add the same file many times if needed (different path) | ||
function hasFileStableId(file: MinimalRequiredUppyFile<any, any>): boolean { | ||
function hasFileStableId( | ||
file: Omit<MinimalRequiredUppyFile<any, any>, 'name'> & | ||
Pick<UppyFile<any, any>, 'name'>, | ||
): boolean { | ||
if (!file.isRemote || !file.remote) return false | ||
@@ -70,3 +74,4 @@ // These are the providers that it seems like have stable IDs for their files. The other's I haven't checked yet. | ||
export function getSafeFileId( | ||
file: MinimalRequiredUppyFile<any, any>, | ||
file: Omit<MinimalRequiredUppyFile<any, any>, 'name'> & | ||
Pick<UppyFile<any, any>, 'name'>, | ||
instanceId: string, | ||
@@ -73,0 +78,0 @@ ): string { |
@@ -49,9 +49,9 @@ function createCancelError(cause?: string) { | ||
#pauseTimer: ReturnType<typeof setTimeout> | ||
#pauseTimer?: ReturnType<typeof setTimeout> | ||
#downLimit = 1 | ||
#upperLimit: number | ||
#upperLimit?: number | ||
#rateLimitingTimer: ReturnType<typeof setTimeout> | ||
#rateLimitingTimer?: ReturnType<typeof setTimeout> | ||
@@ -289,7 +289,7 @@ limit: number | ||
this.#downLimit = this.limit | ||
this.limit = Math.ceil((this.#upperLimit + this.#downLimit) / 2) | ||
this.limit = Math.ceil((this.#upperLimit! + this.#downLimit) / 2) | ||
for (let i = this.#downLimit; i <= this.limit; i++) { | ||
this.#queueNext() | ||
} | ||
if (this.#upperLimit - this.#downLimit > 3) { | ||
if (this.#upperLimit! - this.#downLimit > 3) { | ||
this.#rateLimitingTimer = setTimeout(this.#increaseLimit, 2000) | ||
@@ -296,0 +296,0 @@ } else { |
@@ -19,3 +19,3 @@ import type { FileProgress } from './FileProgress.js' | ||
meta: InternalMetadata & M | ||
name: string | ||
name?: string | ||
preview?: string | ||
@@ -22,0 +22,0 @@ progress: FileProgress |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
392227
4957